Re: Expr. extended stats are skipped with equality operator

2022-08-07 Thread Tom Lane
Tomas Vondra writes: > Yeah, this seems like a clear bug - we should not fail queries like > this. It's a sign statext_is_compatible_clause() and the MCV code > disagrees which clauses are compatible. Indeed. I attempted to fix that at e33ae53dd. regards, tom lane

Re: pg_restore remap schema

2022-08-08 Thread Tom Lane
e-and-after scripts before applying though :-) regards, tom lane

Re: Surprisingly forgiving behavior when a case expression is terminated with "end case"

2022-08-10 Thread Tom Lane
;AS". (Mind you, I think the SQL spec made a serious design error in allowing "AS" to be optional. But we have to live with that as best we can.) regards, tom lane

Re: Would it be possible to add functions to tab-completion in psql?

2022-08-16 Thread Tom Lane
ing with "pg_". So this idea seems like a wart rather than something anybody would think is a nice improvement. regards, tom lane

Re: Different execution plan between PostgreSQL 8.2 and 12.5

2022-08-17 Thread Tom Lane
ask this sort of question in a way that would obtain useful answers: https://wiki.postgresql.org/wiki/Slow_Query_Questions regards, tom lane

Re: ERROR: catalog is missing 3 attribute(s) for relid 150243

2022-08-18 Thread Tom Lane
, and ask some hard questions about the reliability of the storage stack you're sitting on. regards, tom lane

Re: Support for dates before 4713 BC

2022-08-21 Thread Tom Lane
pect not though, at least not without work that seems rather pointless). regards, tom lane [1] https://en.wikipedia.org/wiki/Julian_day

Re: Db log error

2022-08-23 Thread Tom Lane
x27;s not EOL. regards, tom lane

Re: Possible values of DATESTYLE / PGDATESTYLE

2022-08-23 Thread Tom Lane
per-setting documentation in chapter 20: https://www.postgresql.org/docs/current/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-FORMAT regards, tom lane

Re: Two questions about "pg_constraint"

2022-08-24 Thread Tom Lane
three) sorts of objects in the same catalog was a great design. However, that's what we've got and changing it seems like more trouble than it'd be worth. regards, tom lane

Re: pg_dump without setting search_path

2022-08-24 Thread Tom Lane
object references in the function are parsed at definition time.) regards, tom lane

Re: Two questions about "pg_constraint"

2022-08-26 Thread Tom Lane
iciency; specifically to let constraints be looked up by name+namespace without having to get other catalogs involved. (SET CONSTRAINTS is one thing that requires that, and I think there are others.) regards, tom lane

Re: Missing query plan for auto_explain.

2022-08-30 Thread Tom Lane
produces a different plan. That's when it switches > from planning every time to planning with generic arguments, as I > recall. In recent versions you can bypass that with SET plan_cache_mode = force_generic_plan; regards, tom lane

Re: Feature request for count_estimate(samplesize) aggregate or SAMPLE keyword

2022-08-31 Thread Tom Lane
d, and (c) can be adapted to a lot of other kinds of analysis besides plain count(*). regards, tom lane

Re: View definition changes after reloading pg_dump export

2022-09-01 Thread Tom Lane
ck and a hard place. Our experience has been that printing the coercions explicitly causes fewer problems than not doing so, so that's what it does. regards, tom lane

Re: Bind Parameter is Too Big

2022-09-01 Thread Tom Lane
at's the software stack on the client side, but it has to be coming from one or another layer there. regards, tom lane

Re: Bind Parameter is Too Big

2022-09-01 Thread Tom Lane
er is doing that conversion on the client side. regards, tom lane

Re: How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Tom Lane
l if it can't look up that directory. Why it's trying to resolve a symlink isn't apparent though. Is the "psql" you're invoking a symlink to somewhere? regards, tom lane

Re: How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Tom Lane
erson asking why you want to sudo to postgres at all, though. It's generally safest if the client side isn't running as the same user as the server. regards, tom lane [1] https://www.postgresql.org/message-id/797232.1662075573%40sss.pgh.pa.us

Re: Determine if a user and database are available

2022-09-02 Thread Tom Lane
nown-good parameters and check the system catalogs. regards, tom lane

Re: Determine if a user and database are available

2022-09-02 Thread Tom Lane
Ron writes: > On 9/2/22 17:21, Tom Lane wrote: >> That's a feature actually. The intended use of pg_isready is to >> find out if the server is alive, not whether any particular user >> or database name is correct. > Then what's the point of the --username=U

Re: [EXT] Re: log_min_messages = warning

2022-09-06 Thread Tom Lane
have done ALTER USER SET or ALTER DATABASE SET commands that'd change it in those sessions? You could look in the pg_db_role_setting catalog to answer that definitively. regards, tom lane

Re: [EXT] Re: log_min_messages = warning

2022-09-06 Thread Tom Lane
procedures' session is changing the value itself. (This is scary, because it implies that you're running those as superuser, which seems like a bad idea.) You might have to enable log_statement = all to verify that. regards, tom lane

Re: [EXT] Re: log_min_messages = warning

2022-09-07 Thread Tom Lane
"Dirschel, Steve" writes: > I believe this clearly points to an issue with pg_cron. Would you agree? Yeah, you certainly need to look into what sort of environment that is setting up. I know zip about pg_cron, can't help you there. regards, tom lane

Re: WARNING: could not open statistics file "pg_stat_tmp/global.stat": Operation not permitted

2022-09-08 Thread Tom Lane
disk. You sound like you've set it up to be *more* persistent (ie outside the container not inside), which surely is exactly backwards. regards, tom lane

Re: ERROR: cache lookup failed for user mapping 476444

2022-09-09 Thread Tom Lane
_depend row having objid = 476444? What's in it? regards, tom lane

Re: [Beginner Question]Where can I get the source of hstore?

2022-09-10 Thread Tom Lane
Wen Yi writes: > I want to do some research on the hstore,but I can't find its source. It's in the Postgres source distribution, under contrib/hstore/ regards, tom lane

Re: lippq client library and openssl initialization: PQinitOpenSSL()

2022-09-11 Thread Tom Lane
mless as far as I can see from the OpenSSL docs. regards, tom lane

Re: lippq client library and openssl initialization: PQinitOpenSSL()

2022-09-11 Thread Tom Lane
Daniel Gustafsson writes: > On 11 Sep 2022, at 17:08, Tom Lane wrote: >> Don't believe so. The HAVE_CRYPTO_LOCK stuff is all obsolete and >> not compiled if you built against 1.1.0. The only thing left that >> will happen if you don't call PQinitOpenSSL is an ex

Re: lippq client library and openssl initialization: PQinitOpenSSL()

2022-09-12 Thread Tom Lane
wever, this is unnecessary when using OpenSSL 1.1.0 or later, + as duplicate initializations are no longer problematic. If you do use wording that specifically mentions PQinitOpenSSL, it should also mention PQinitSSL, just for clarity. regards, tom lane

Re: Resolving host to IP address

2022-09-12 Thread Tom Lane
psql -h 127.0.1.1 psql (16devel) Type "help" for help. postgres=# select client_addr from pg_stat_activity; client_addr - ... 127.0.0.1 ... Moral: don't try to use addresses in that range as real addresses. regards, tom lane

Re: Support for dates before 4713 BC

2022-09-12 Thread Tom Lane
Simon Riggs writes: > On Sun, 21 Aug 2022 at 19:04, Tom Lane wrote: >> There are existing equations for calculating Gregorian month/day/year from >> Julian day count [1]. They work back to Julian day zero, at least if >> you grant that proleptic Gregorian dates are s

Re: Support for dates before 4713 BC

2022-09-12 Thread Tom Lane
Simon Riggs writes: > On Mon, 12 Sept 2022 at 16:00, Tom Lane wrote: >> No, it applies because we aren't sure that the math would operate >> correctly with negative Julian day numbers --- for instance, division >> roundoffs might happen in the wrong direction.

Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?

2022-09-12 Thread Tom Lane
be was deemed to be a bug (after > that behavior had survived from at least version 11) and that it's now been > fixed! No, it very much looks like pilot error. But you've not shown us exactly what your test consisted of, so it's hard to say just where it went off the rails. regards, tom lane

Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?

2022-09-12 Thread Tom Lane
ave to represent a compromise that we think is generally useful. You're welcome to lock your own installation down more than that, but it doesn't follow that everybody else should too. regards, tom lane

Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?

2022-09-13 Thread Tom Lane
s about no-op grants. I wonder if issuing a warning for no-op revokes would be helpful.) Jeremy's nearby theory that the REVOKE was done in a different database seems like a pretty good explanation of Bryn's issue. regards, tom lane

Re: Mysterious performance degradation in exceptional cases

2022-09-14 Thread Tom Lane
ther 90% are below 2 > seconds, > i.e. this is digital: Or 2 seconds, or more than 180 seconds, no values > between. I'm wondering about a plan change. Can you install auto_explain on the server and capture info about the fast and slow cases? regards, tom lane

Re: massive update on gin index

2022-09-14 Thread Tom Lane
if that gets too bloated. I don't recall much about how to control that, but I think vacuuming the table will serve to empty the pending list. Also see https://www.postgresql.org/docs/current/gin-implementation.html#GIN-FAST-UPDATE regards, tom lane

Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?

2022-09-14 Thread Tom Lane
... and here you're testing the permission in the "scott" database. regards, tom lane

Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?

2022-09-14 Thread Tom Lane
rm are limited as the overall design specifies. is in any way sane or secure. There is not very much that the database server can do to clean up after insecure client-side stacks. regards, tom lane

Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?

2022-09-14 Thread Tom Lane
ROLE regression=# \c - joe You are now connected to database "regression" as user "joe". regression=> select 2+2; -- not so much for anybody else ERROR: permission denied for function int4pl regards, tom lane

Re: Re[2]: CVE-2022-2625

2022-09-15 Thread Tom Lane
ou have hostile actors able to issue arbitrary SQL in your database, in which case you're in a world of trouble anyway. regards, tom lane

Re: Re[2]: CVE-2022-2625

2022-09-15 Thread Tom Lane
Laurenz Albe writes: > On Thu, 2022-09-15 at 11:19 -0400, Tom Lane wrote: >> I'm a little bemused by your fixation on this particular CVE, >> though. As such things go, it's not a very big deal. > A lot of times, requests like that come from a brainless kind of >

Re: Extension rpath issues on MacOS

2022-09-16 Thread Tom Lane
a workaround. I suspect that Apple doesn't want people using these OS components from "outside", and this is something they're intentionally doing to prevent it. IOW: I think they want you to get that from macports or homebrew instead. It certainly works a lot easier if you do.

Re: Re: Where's the doc for "array()" — as in "select array(values (17), (42))"

2022-09-18 Thread Tom Lane
tax. But ARRAY()'s problem is semantic not syntactic. regards, tom lane

Re: Suggest using boolean index with (bflag is true) condition for the query with (bflag = true) clause

2022-09-19 Thread Tom Lane
handle some related cases like "x => x IS NOT FALSE". Whether it's worth the cycles isn't too clear to me, but we could argue about that if somebody submitted a patch. regards, tom lane

Re: Re: Where's the doc for "array()" — as in "select array(values (17), (42))"

2022-09-19 Thread Tom Lane
essary, *is* tolerated. You can pretty much always add *extra* parens in any expression context. regards, tom lane

Re: I slipped up so that no existing role allows connection. Is rescue possible?

2022-09-19 Thread Tom Lane
r and/or whatever else you wish you could take back, end that session, restart the cluster. (You're not the first to mess up like this.) regards, tom lane

Re: GIST combo index condition chosen for users queries is different from table owner's query

2022-09-19 Thread Tom Lane
ing so, you could maybe ameliorate things by implementing the RLS check functions in the fastest way you can, like writing C code for them. regards, tom lane

Re: tcp settings

2022-09-20 Thread Tom Lane
uot;. then keepalives aren't necessarily the solution anyway. When is this failure occurring ... is it while trying to establish the database connection in the first place? Or does it only happen if you've left the psql session sit idle for a long while? regards, tom lane

Re: tcp settings

2022-09-20 Thread Tom Lane
hours, at least on my Linux box: $ cat /proc/sys/net/ipv4/tcp_keepalive_time 7200 but it sounds like there's something between you and the database server that will forget connections a lot quicker than that. regards, tom lane

Re: PostgreSQL Rule does not work with deferred constraint.

2022-09-21 Thread Tom Lane
ement this sort of behavior; they are less prone to surprises. regards, tom lane

Re: pg_dump failed with error code 255, but I don't see why

2022-09-22 Thread Tom Lane
xit() with values 0 or 1. 255 would have to be coming from some outside factor. You sure your shell script isn't misbehaving and corrupting the reported return code? regards, tom lane

Re: Order by in a sub query when aggregating the main query

2022-09-24 Thread Tom Lane
ional sorting overhead, which is annoying. But work is ongoing to recognize when the input is already correctly sorted for an aggregate, so it should get better in PG 16 or so. regards, tom lane

Re: Support functions for range types

2022-09-25 Thread Tom Lane
7;d make the whole affair annoyingly data-type-specific. Not sure it's worth going there. regards, tom lane

Re: Limiting the operations that client-side code can perform upon its database backend's artifacts

2022-09-27 Thread Tom Lane
oint in user X mounting defenses against user X.) So I think the concerns you're expressing here would be better addressed at the next level up the stack. regards, tom lane

Re: table inheritance and privileges

2022-09-28 Thread Tom Lane
le, there's no need for privileges on individual children --- we only check tables(s) directly named in the query. regards, tom lane

Re: [BeginnerQuestion]Why I compile lex.yy.c failed?

2022-09-30 Thread Tom Lane
ure that that's actually required, if your action is only one C statement. I suspect it's just making the action into a valid C compound block. regards, tom lane

Re: Names of run-time configuration parameters (was: Limiting the operations that client-side code can perform upon its database backend's artifacts)

2022-10-01 Thread Tom Lane
appears from the discussion in [2] that we're probably going to stick to the policy of not encouraging use of custom parameters as application state, although if [1] keeps failing to land maybe that will change? regards, tom lane [1] https://www.postgresql.org/mess

Re: Names of run-time configuration parameters (was: Limiting the operations that client-side code can perform upon its database backend's artifacts)

2022-10-01 Thread Tom Lane
s undefined_table then you know what to do. regards, tom lane

Re: Names of run-time configuration parameters (was: Limiting the operations that client-side code can perform upon its database backend's artifacts)

2022-10-01 Thread Tom Lane
uestion. My gut feeling is that the subtransaction created by the BEGIN ... EXCEPTION construct is more expensive than a no-op CREATE IF NOT EXISTS. I've not measured it though; and I'm pretty sure that the answer would vary depending on how often you expect the code to fall through versus needing to create the table. regards, tom lane

Re: postgresql 15 for RHEL RPMs available?

2022-10-02 Thread Tom Lane
Steve Baldwin writes: > Looks like it's official ? - https://www.postgresql.org/docs/release/15.0/ No, that's just the RC1 version. Note the "Release date:" line is still not set. regards, tom lane

Re: Number of updated rows with LibPQ

2022-10-05 Thread Tom Lane
ave to use PQcmdTuples(), and you have to convert the string to an > integer. > But don't worry: the result will *not* be "INSERT 0 5", it will be just "5", > so > you won't have to parse anything. Yeah, just applying atoi() or atol() to the result should be enough. regards, tom lane

Re: ('dog$house' = quote_ident('dog$house')) is surprisingly FALSE

2022-10-05 Thread Tom Lane
ely that something quote_ident decides not to quote would be rejected by some future PG version (not to mention non-PG SQL databases). So I'm not really in a hurry to change the code. Maybe we should tweak the docs a bit. regards, tom lane

Re: Cannot convert partitioned table to a view

2022-10-06 Thread Tom Lane
that you should not rely on, and most certainly shouldn't try to make use of from user code. It exists because very ancient versions of pg_dump didn't know how to dump views as views. We're more likely to rip it out as no-longer-needed than to expand what it does. regards, tom lane

Re: pg_restore creates public schema?

2022-10-06 Thread Tom Lane
ntly the fix requires an updated pg_dump more than pg_restore. However, I believe that only happens with -c, so why are you using both -c and -C? regards, tom lane

Re: pg_restore creates public schema?

2022-10-06 Thread Tom Lane
Ron writes: > On 10/6/22 09:49, Tom Lane wrote: >> Ron writes: >>> pg_dump 9.6.24 >> You realize that that version's been out of support for a year? > Yes, which is why I'm dumping from an EOL cluster, and restoring to a > supported version. But why

Re: Cannot convert partitioned table to a view

2022-10-07 Thread Tom Lane
ike a table. regards, tom lane

Re: Cannot convert partitioned table to a view

2022-10-07 Thread Tom Lane
Kouber Saparev writes: > Excuse me, I didn't understand what was about to be ripped out then. The fact that creating a _RETURN rule for a table causes it to be changed into a view. That's ugly and arguably dangerous. regards, tom lane

Re: Different execution plan between PostgreSQL 8.4 and 12.11

2022-10-09 Thread Tom Lane
tistics yet. regards, tom lane

Re: Different execution plan between PostgreSQL 8.4 and 12.11

2022-10-09 Thread Tom Lane
n you want. If not, then there's something else going on besides poor estimates. regards, tom lane

Re: Same query, same data different plan

2022-10-10 Thread Tom Lane
that the databases are *not* identical. You just haven't figured out how yet. I'm wondering if it has something to do with the dump/reload having compacted out bloat in the tables or indexes, causing cost estimates to change. regards, tom lane

Re: Different execution plan between PostgreSQL 8.4 and 12.11

2022-10-11 Thread Tom Lane
o the LIMIT estimation to reduce the chance of being fooled this way, that would also discourage us from using fast-start plans when they *do* help. So I don't see any easy fix. regards, tom lane

Re: Weird planner issue on a standby

2022-10-11 Thread Tom Lane
r than 11.5, but I might've missed something. regards, tom lane

Re: Weird planner issue on a standby

2022-10-11 Thread Tom Lane
customer has checksums enabled, which means that > MarkBufferDirtyHint() should be guaranteed to mark the buffers as dirty, so > I'm > out of ideas to explain the different behavior on standbys. Do we propagate visibility-map bits to standbys? regards, tom lane

Re: Weird planner issue on a standby

2022-10-12 Thread Tom Lane
sed some in-fact-dead index entries to get cleaned out. But ... if the primary is allowed to vacuum away an index entry that it thinks is dead, exactly what is the point of making standbys ignore LP_DEAD bits? There's no additional interlock that guarantees the tuple will be there at all.

Re: Exponentiation confusion

2022-10-13 Thread Tom Lane
ate the result weight, so with a little code re-ordering we won't need duplicative estimates. Don't have time to work on that right now though ... Dean, are you interested in fixing this? regards, tom lane

Re: pg_upgrade to 15 fails on Windows because of xml_is_well_formed()

2022-10-13 Thread Tom Lane
" > I don't understand why this functions is included in the dump in the first > place. Indeed. No such function should be present in any version of contrib/xml2 that was ever converted to extension style. Have you never done that in this DB? regards, tom lane

Re: Exponentiation confusion

2022-10-13 Thread Tom Lane
ts, and produces a minimum of 16 significant digits, > rather than 16 digits after the decimal point. Right. I think this is not bad though. In a lot of cases (such as the example here) the current behavior is just plastering on useless zeroes. regards, tom lane

Re: [libpq] OIDs of extension types? Of custom types?

2022-10-14 Thread Tom Lane
to avoid fetching the OID altogether that way. regards, tom lane

Re: How to return argument data type from sql function

2022-10-14 Thread Tom Lane
bpchar works for me. regression=# select pg_typeof(torus(f1)) from char_tbl; pg_typeof --- character Another possibility is to have just one function declared to take and return anyelement. You'd get failures at execution if the actual argument type isn't coercible to and from text (since translate() deals in text) but that might be fine. regards, tom lane

Re: How to return argument data type from sql function

2022-10-14 Thread Tom Lane
field Personally I'd also throw in "... and atttypid = 'bpchar'::regtype", because that atttypmod calculation will give you garbage for types other than bpchar and varchar. regards, tom lane

Re: How to return argument data type from sql function

2022-10-14 Thread Tom Lane
Andrus writes: > How to change this query so that it searches schemas in set search_path > order and returns column width from it ? In this case p_namespace > parameter can removed. I showed you that already: regclass will take care of it. regards, tom lane

Re: A question about leakproof

2022-10-16 Thread Tom Lane
hat there's too much code involved to have much confidence that it would stay leakproof. regards, tom lane

Re: 回复:A question about leakproof

2022-10-16 Thread Tom Lane
leakproof. Please note that this definition talks only about the behavior of the function itself. Re-reading your email, you seem to be imagining that changes in a query's plan on the basis of changes in collected statistics have something to do with this. They do not. regards, tom lane

Re: 回复:回复:回复:A question about leakproof

2022-10-17 Thread Tom Lane
ble, or maybe we could rerrange things to remove it. But there's still enough code underneath the timezone conversion requirement that I'd be very hesitant to apply a leakproof marking. In short: it might be leakproof in practice, but we don't wish to offer a guarantee. regards, tom lane

Re: 回复:回复:回复:回复:A question about leakproof

2022-10-17 Thread Tom Lane
7;t throw errors. I don't see a good argument for making a exception for this one. regards, tom lane

Re: byte-size of column values

2022-10-18 Thread Tom Lane
tgres developers regard CHAR(N) as an obsolete hangover from the days of punched cards, no such optimizations have been attempted. regards, tom lane

Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

2022-10-18 Thread Tom Lane
interpret that differently? regards, tom lane

Re: byte-size of column values

2022-10-19 Thread Tom Lane
Dominique Devienne writes: > On Tue, Oct 18, 2022 at 6:04 PM Tom Lane wrote: >> Thus, there's always a header to store the actual length. That can >> be either 1 or 4 bytes (I think the doc you are looking at might be >> a little out of date on that point). >

Re: Custom function ROWS hint ignored due to inlining?

2022-10-19 Thread Tom Lane
h changing the function to plpgsql instead of SQL. Not sure about the relative performance of those cases, but it's worth trying it both ways. regards, tom lane

Re: Postgres 15 upgrades and template1 public schema

2022-10-19 Thread Tom Lane
ies of the public schema will depend on whether you clone it from template1 or template0. That definitely needs explained, and maybe we should recommend that DBAs consider manually changing what's in template1. regards, tom lane

Re: pg_restore 12 "permission denied for schema" errors

2022-10-19 Thread Tom Lane
nts. We don't have enough details to do more than guess, though. regards, tom lane

Re: Upgrading error

2022-10-21 Thread Tom Lane
ectory out of the way and move the new one to /home/dmartuser/pgdata/data, if you like. regards, tom lane

Re: PQconsumeinput() may close the fd

2022-10-21 Thread Tom Lane
ere. regards, tom lane

Re: possible bug

2022-10-21 Thread Tom Lane
r plan, I suppose 14.something, but is it up to date? There were Memoize-related bug fixes in 14.2 and 14.4, and the one in 14.2 looks particularly likely to be relevant. If you are on the current minor release, does "set enable_memoize = off" change the behavior? regards, tom lane

Re: possible bug

2022-10-21 Thread Tom Lane
was an actual bug. regards, tom lane

Re: possible bug

2022-10-21 Thread Tom Lane
> but probably academic and thus Perl and others picked it up "from the > source". Looks to me like you suggested our use of the terminology: https://www.postgresql.org/message-id/flat/CAKFQuwZQmCNyS_Vv2Jf3TNe7wRTiptWNs7xkgU%3DAEdqthkQe9A%40mail.gmail.com#bbcd739c97e28b17ef2e111be8

Re: pg_restore 12 "permission denied for schema" errors

2022-10-22 Thread Tom Lane
esn't depend much at all on your data, just the schema. regards, tom lane

Re: How to find an oid that's not uesd now?

2022-10-23 Thread Tom Lane
o find one? https://www.postgresql.org/docs/devel/system-catalog-initial-data.html#SYSTEM-CATALOG-OID-ASSIGNMENT regards, tom lane

<    8   9   10   11   12   13   14   15   16   17   >