Re: When does Postgres use binary I/O?

2019-09-22 Thread Tom Lane
ic test function that takes a value, runs it through the type's send and then receive functions, and returns the result (or just complains if it gets different bits out ...) regards, tom lane

Re: When does Postgres use binary I/O?

2019-09-22 Thread Tom Lane
Paul A Jungwirth writes: > On Sun, Sep 22, 2019 at 11:53 AM Tom Lane wrote: >> I thought of an easier-to-maintain approach to that part than having >> a reference file. > I just finished my multirange patch (well, "finished" :-), so I might > be willing to sign

Re: postgres 9.6: insert into select finishes only in pgadmin not psql

2019-09-23 Thread Tom Lane
query is running, to see if it seems to be eating CPU or is blocked on some condition. (I forget how thorough the wait_event coverage is in 9.6, but it does at least have those columns.) Can you create a self-contained test case that acts like this? regards, tom lane

Re: Error during analyze after upgrade from 10.10 -> 11.4

2019-09-23 Thread Tom Lane
mpty pg_statistic, run "ANALYZE;" (as superuser) to rebuild all the stats. Hard to tell what the underlying issue is here --- perhaps pg_upgrade messed up, but it would take some detailed investigation to find out. regards, tom lane

Re: Operator is not unique

2019-09-24 Thread Tom Lane
ve any way to decide whether it should use "numeric + numeric" or "bigint + bigint" here. regards, tom lane

Re: Mapping view columns to their source columns

2019-09-24 Thread Tom Lane
; if you try you'll find yourself maintaining a lot of messy code that we *will* break on a regular basis. It would be less hard in a backend extension, but I suspect you don't want to go there :-( regards, tom lane

Re: Mapping view columns to their source columns

2019-09-25 Thread Tom Lane
erialization format.) regards, tom lane

Re: Upgrading old server

2019-09-25 Thread Tom Lane
hand, try using that. 7.4 to 11 is a big jump to be doing in one step. There's definitely something to be said for porting to an intermediate release, just to break down the work into smaller chunks. But I'd go for halfway between, which if I counted releases correctly would be about 9.1, not 8.4. regards, tom lane

Re: Arrays and ANY problem

2019-09-25 Thread Tom Lane
ub-select return a rowset result rather than an array result might be the best way to resolve things. It's more SQL-y, for sure. regards, tom lane

Re: lc_numeric and negative-prefix

2019-09-25 Thread Tom Lane
ly functions that do pay attention to LC_NUMERIC are to_char() and friends. regards, tom lane

Re: pg_get_triggerdef does not use the schema qualified procedure name

2019-09-26 Thread Tom Lane
nt search_path. So you could get what you want by setting a restrictive search_path beforehand, maybe just ''. regards, tom lane

Re: pg12 rc1 on CentOS8 depend python2

2019-09-27 Thread Tom Lane
r to split out those modules as a separate package. OTOH that would add confusion, and we have a lot of subpackages already. Another idea might be to bundle them into the plpython package instead of contrib (and similarly for the plperl transforms). regards, tom lane

Re: incoherent dead tuples between pg_stat_user_tables and pgstattuple?

2019-09-27 Thread Tom Lane
rate row count, COUNT(*) or pgstattuples will give you a more reliable estimate ... at much higher cost, of course. regards, tom lane

Re: incoherent dead tuples between pg_stat_user_tables and pgstattuple?

2019-09-27 Thread Tom Lane
Luca Ferrari writes: > On Fri, Sep 27, 2019 at 3:52 PM Tom Lane wrote: >> n_live_tup/n_dead_tup should not be thought to be better than >> approximations. Most operations adjust them only incrementally, >> and messages to the stats collector can get dropped entirely >>

Re: steps of a sql

2019-09-27 Thread Tom Lane
n 500ms. But on that day something > happened, what was that, PARSE time of 10 minutes ? Something else sitting on an exclusive table lock, perhaps? regards, tom lane

Re: Operator is not unique

2019-09-27 Thread Tom Lane
'd evidently match to numeric + anything. regards, tom lane

Re: Possible bug: SQL function parameter in window frame definition

2019-09-28 Thread Tom Lane
owMarks; /* a list of RowMarkClause's */ Now probably this is never called on utility statements, and maybe there is never a reason for anyone to examine or mutate SortGroupClauses, GroupingSets, or RowMarkClauses, but I'm not sure it's any business of this module to assume that. regards, tom lane

Re: Possible bug: SQL function parameter in window frame definition

2019-09-28 Thread Tom Lane
Andrew Gierth writes: > "Tom" == Tom Lane writes: > Tom> Now probably this is never called on utility statements, and maybe > Tom> there is never a reason for anyone to examine or mutate > Tom> SortGroupClauses, GroupingSets, or RowMarkClauses, but I'm n

Re: Possible bug: SQL function parameter in window frame definition

2019-09-29 Thread Tom Lane
nd rowMarks? Also, in HEAD I'd be inclined to add assertions about utilityStmt being NULL. regards, tom lane

Re: Operator is not unique

2019-09-30 Thread Tom Lane
his will capture numeric plus *anything*, so it was not a good idea. I'd recommend dropping the use of anyelement and just making three non-polymorphic operators. regards, tom lane

Re: Possible bug: SQL function parameter in window frame definition

2019-09-30 Thread Tom Lane
Andrew Gierth writes: > "Tom" == Tom Lane writes: > Tom> Hmm. I think this is a reasonable direction to go in, but > Tom> what about groupingSets and rowMarks? > groupingSets ultimately contains nothing but numbers which are > meaningless without reference t

Re: Behaviour adding a column with and without a default (prior to PG11)

2019-09-30 Thread Tom Lane
a > conscious design choice? We read the SQL spec as requiring this behavior. regards, tom lane

Re: Schema dump/restore not restoring grants on the schema

2019-10-01 Thread Tom Lane
reasoning is lost in the mists of time :-( Another thing that is not very nice is that pg_restore lacks the ability to use patterns (wildcards) here. Someday maybe somebody will get around to fixing that. I could see changing the definition of -n to include the schema itself at the same time. regards, tom lane

Re: Wall shiping replica failed to recover database with error: invalid contrecord length 1956 at FED/38FFE208

2019-10-02 Thread Tom Lane
isting info into DETAIL and make the primary message be something like "reached apparent end of WAL stream". regards, tom lane

Re: PMChildFlags array

2019-10-03 Thread Tom Lane
tions +| > | Password valid until infinity | Hm, what's the overall max_connections limit? (I'm wondering in particular if it's more or less than 100.) regards, tom lane

Re: PMChildFlags array

2019-10-03 Thread Tom Lane
processes; it needs to be less, by the number of background processes we want to support. But it seems like a darn hard-to-hit bug, so I'm not quite sure that that explains your observation. regards, tom lane

Re: BitmapAnd on correlated column?

2019-10-04 Thread Tom Lane
ats on the column combination might allow the planner to figure out that the second IN condition adds little selectivity. But I'm not sure how hard it would be, and I am sure that the extended-stats logic hasn't been built out in that direction yet. regards, tom lane

Re: Postgres 12: backend crashes when creating non-deterministic collation

2019-10-04 Thread Tom Lane
e is to get a stack trace from the crash, if you can. regards, tom lane

Re: Clarification on the release notes of postgresql 12 regarding pg_upgrade

2019-10-04 Thread Tom Lane
indexes that could benefit from the other changes. regards, tom lane

Re: Postgres 12: backend crashes when creating non-deterministic collation

2019-10-04 Thread Tom Lane
Thomas Kellerer writes: > Tom Lane schrieb am 04.10.2019 um 16:52: >> No, this thread is a sufficient report. What *would* be a good use >> of time is to get a stack trace from the crash, if you can. > I don't know if I did everything correctly, but here it is. I hope i

Re: RowDescription message

2019-10-07 Thread Tom Lane
ard. PostgreSQL allows it to be consistent with allowing zero-column tables. However, an empty list is not allowed when DISTINCT is used. regards, tom lane

Re: PMChildFlags array

2019-10-07 Thread Tom Lane
e it never touches any relation files directly. regards, tom lane

Re: Table locking during backup

2019-10-08 Thread Tom Lane
r looking into pg_locks to see what's going on in cases like this ... regards, tom lane

Re: Segmentation fault with PG-12

2019-10-08 Thread Tom Lane
trace (or back-trace in C-land?) on sig11? You should be able to get a core file from which you can extract a stack trace (and other info) after the fact. https://wiki.postgresql.org/wiki/Generating_a_stack_trace_of_a_PostgreSQL_backend regards, tom lane

Re: Segmentation fault with PG-12

2019-10-09 Thread Tom Lane
ivery? This doesn't seem to correlate with your original report, btw, as that claimed the crash was during COMMIT. regards, tom lane

Re: Segmentation fault with PG-12

2019-10-09 Thread Tom Lane
Andreas Joseph Krogh writes: > Is it OK if I send you the table/trigger-definitions off-list? Sure, but please share with Andres [cc'ed] as well. regards, tom lane

Re: plpgsql copy import csv double quotes

2019-10-09 Thread Tom Lane
which that's legal data. The typical rule is that double quotes that are data must be doubled; at least, that's what COPY expects by default. You can also get COPY to handle variants like backslash-quote. regards, tom lane

Re: websearch_to_tsquery() and apostrophe inside double quotes

2019-10-10 Thread Tom Lane
entation that suggests it should treat "'" specially. If it didn't, you'd get # select websearch_to_tsquery('"peter o toole"'); websearch_to_tsquery 'peter' <-> 'o' <-> 'tool' (1 row) which would match this tsvector. regards, tom lane

Re: The connection to the server was lost. Attempting reset: Failed.

2019-10-10 Thread Tom Lane
pfree( cols.data ); cols.data = NULL; } /*IF col.len>0*/ Don't do that, use resetStringInfo() instead. regards, tom lane

Re: Segmentation fault with PG-12

2019-10-10 Thread Tom Lane
Andres Freund writes: > On 2019-10-09 10:16:37 -0400, Tom Lane wrote: >> Well, it shows that the failure is occurring while trying to evaluate >> a variable in a trigger's WHEN clause during >> "UPDATE origo_email_delivery SET folder_id=$1, created=$2\nWHERE e

Re: Issues with PAM : log that it failed, whether it actually failed or not

2019-10-11 Thread Tom Lane
res seems excessively chatty. More-commonly-used auth methods aren't that noisy. regards, tom lane

Re: day interval

2019-10-12 Thread Tom Lane
er's DB it is '273 days'; > Then you need to establish why that is. I recall having heard that EDB installs some non-PG datetime operators to make things act more similar to Oracle. regards, tom lane

Re: Postgres 10.7 Systemd Startup Issue

2019-10-14 Thread Tom Lane
"Lu, Dan" writes: > Is there a catalog view that I can query to see what options were used > to configure the PG instance? No, but pg_config should tell you. regards, tom lane

Re: Has there been any discussion of custom dictionaries being defined in the database?

2019-10-17 Thread Tom Lane
e beating up RDS for not letting you configure your DB the way you want. regards, tom lane

Re: Can functions containing a CTE be PARALLEL SAFE?

2019-10-17 Thread Tom Lane
for treating CTEs as parallel restricted is simply to guarantee single evaluation of the CTE. Within a function, that would only matter per-function-execution, so I can't see why a function containing such a query couldn't be pushed down to workers for execution. regards, tom lane

Re: Has there been any discussion of custom dictionaries being defined in the database?

2019-10-17 Thread Tom Lane
tall your own C functions either :-( regards, tom lane

Re: PostgreSQL memory usage

2019-10-17 Thread Tom Lane
e it feasible to have more, but only in limited use-cases. regards, tom lane

Re: stable for each row before insert trigger

2019-10-18 Thread Tom Lane
rently depending on whether they think the function is volatile or not, but that's independent of whether the function is a trigger. regards, tom lane

Re: Execute a function through fdw

2019-10-18 Thread Tom Lane
ign table on the local server. Yeah. Or if you really want to call a remote function by name, see dblink. postgres_fdw actively avoids doing that sort of thing. regards, tom lane

Re: DBD::Pg exorts char columns with trailing blanks

2019-10-18 Thread Tom Lane
Matthias Apitz writes: > When we export char columns with our Perl tools, they come out with trailing > blanks (in Sybase they don't). Can this be suppressed? Switch to varchar, perhaps? regards, tom lane

Re: UTC-6 or UTC+6?

2019-10-20 Thread Tom Lane
the ISO standard which uses the opposite sign. See https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-TIMEZONES regards, tom lane

Re: An issue installing an extension

2019-10-22 Thread Tom Lane
g_libphonenumber.so depends on. I think you forgot to install that one on this machine. regards, tom lane

Re: date function bug

2019-10-23 Thread Tom Lane
'20181501'::date; ERROR: date/time field value out of range: "20181501" LINE 1: select '20181501'::date; ^ HINT: Perhaps you need a different "datestyle" setting. regression=# select '20181001'::date; date 2018-10-01 (1 row) regards, tom lane

Re: Is this a bug ?

2019-10-23 Thread Tom Lane
the table rows, so 3 is the correct answer. > No doubt: it's a bug, no matter what the Pg devs say. Complain to the SQL standards committee, not us. regards, tom lane

Re: LocalTransactionId vs txid_current

2019-10-24 Thread Tom Lane
tion ID, while local transaction IDs are just taken from a counter within the session and have no meaning to other sessions. regards, tom lane

Re: jsonb_set() strictness considered harmful to data

2019-10-24 Thread Tom Lane
ly resist proposals to, say, make SELECT 'null'::json IS NULL return true). Maybe it's okay to make this case work like that, but don't be too high and mighty about it being logically clean; it isn't. regards, tom lane

Re: A very puzzling backup/restore problem

2019-10-24 Thread Tom Lane
ion, so that it executes with a known search_path regardless of the session's prevailing path. regards, tom lane

Re: Quere keep using temporary files

2019-10-25 Thread Tom Lane
t;foo"."col_id" IN ($1, $2, $3, $4, $5, $6, $7, $8, $9) > It looks like increasing work_mem doesn't help. Surely 16GB is enough to > cover all these small temp files? You'd need to provide a lot more detail about what that query is doing for anyone to be able to guess where the temp file usage is coming from. regards, tom lane

Re: Error building Postgres for Windows

2019-10-25 Thread Tom Lane
a set of Perl header files that don't match the Perl library you're linking to. Check for multiple Perl installations on your machine, and pay attention to the include and link search paths that are being used in your plperl build. regards, tom lane

Re: I think that my data is saved correctly, but when printing again, other data appears

2019-10-25 Thread Tom Lane
x27;re in a short-lived SPI context already inside that loop; but you could save CurrentMemoryContext before starting up SPI and then use MemoryContextStrdup. regards, tom lane

Re: Quere keep using temporary files

2019-10-25 Thread Tom Lane
rihad writes: > On 10/25/2019 05:49 PM, Tom Lane wrote: >> You'd need to provide a lot more detail about what that query is doing >> for anyone to be able to guess where the temp file usage is coming from. > I just checked and saw that the function "foo_xml_v2"

Re: PostgreSQL - unrecognized win32 error code: 38

2019-10-27 Thread Tom Lane
the doserrors[] table. But that just deepens the mystery --- if we hit an EOF, why wasn't that handled through more-normal channels? We still need to know what that function was trying to do, and whether any non-core C code was involved. regards, tom lane

Re: Automatically parsing in-line composite types

2019-10-29 Thread Tom Lane
end RowDescription to support describing composites' sub-fields, it wouldn't be in much of a position to deal with that. regards, tom lane

Re: Automatically parsing in-line composite types

2019-10-31 Thread Tom Lane
der whether the JDBC API could handle it either. tl;dr: there are a lot more worms in this can than you might guess. regards, tom lane

Re: QUERY: autovacuum: VACUUM ANALYZE table versus QUERY: autovacuum: VACUUM table

2019-11-02 Thread Tom Lane
s based on n_dead_tup and the other on n_mod_since_analyze, plus you can set different threshold parameters to compare those to). The pg_stat_activity report of what's happening does match the command-line syntax. regards, tom lane

Re: select view definition from pg_views feature request

2019-11-03 Thread Tom Lane
search_path (or else provide a new column that does > that)? Why don't you just change the search path to empty before selecting? regards, tom lane

Re: explain plan difference

2019-11-03 Thread Tom Lane
the original table, forcing the projection to be done to get rid of them. regards, tom lane

Re: explain plan difference

2019-11-04 Thread Tom Lane
deleted in the past, but > VACUUM FULL not run on that table, right ? VACUUM would not change the state of the dropped columns. regards, tom lane

Re: explain plan difference

2019-11-04 Thread Tom Lane
um is the only persistent identifier of a column. (From memory, operations like VACUUM FULL and CLUSTER will rewrite dropped columns with NULLs to reduce their storage impact. But they don't go away.) regards, tom lane

Re: select view definition from pg_views feature request

2019-11-05 Thread Tom Lane
s, references to built-in functions and operators, and temp table names will not be qualified. Everything else will be. regards, tom lane

Re: here does postgres take its timezone information from?

2019-11-05 Thread Tom Lane
"pkg". That's not a great default IMHO and > should be changed. Ugh. Who can we poke there? regards, tom lane

Re: Locked out of schema public (pg_dump lacks backup of the grant)

2019-11-06 Thread Tom Lane
and recreate it, again causing headaches for non-superuser usage. This change likewise makes the public schema less special and more like other built-in objects. regards, tom lane

Re: Rules documentation example

2019-11-11 Thread Tom Lane
optimization behavior existed then. I'm inclined to: (1) get rid of the example's MIN() function in favor of using LEAST(), which is standard and less confusing; (2) change the text to just say that the planner flattens these subqueries, so we don't pay any execution-time penalty from the way the view replacements are handled. regards, tom lane

Re: here does postgres take its timezone information from?

2019-11-13 Thread Tom Lane
system-tzdata, I guess, so that it uses tzdata it's expecting.) regards, tom lane

Re: terminated by signal 11: Segmentation fault

2019-11-13 Thread Tom Lane
an UPDATE, I suspect it's a known problem: if you have a BEFORE UPDATE row-level trigger, and a concurrent update on the same row happens, 12.0 can dump core due to a slot memory management mistake. There's a fix in 12.1, due out tomorrow. regards, tom lane

Re: Last autovacuum time - what is it?

2019-11-13 Thread Tom Lane
Durumdara writes: > I need to ask about last_autovacuum column in *pg_stat_all_tables.* > I'm not sure is this a starting time, or when the daemon finished. Looks like it's the time that the vacuum operation finished. regards, tom lane

Re: Problems modifyiong view

2019-11-14 Thread Tom Lane
fer an ALTER VIEW spelling of that, but we don't ATM. ALTER TABLE works though.) regards, tom lane

Re: Problems modifyiong view

2019-11-14 Thread Tom Lane
Adrian Klaver writes: > On 11/14/19 7:12 AM, Tom Lane wrote: >> If you actually want to rename an existing view column, use >> ALTER TABLE ... RENAME COLUMN ... for that. > Alright, I'm missing something here: > test=# alter table up_test rename COLUMN col1 to col_1;

Re: Wall shiping replica failed to recover database with error: invalid contrecord length 1956 at FED/38FFE208

2019-11-14 Thread Tom Lane
Kyotaro Horiguchi writes: > At Wed, 2 Oct 2019 19:24:02 -0400, Stephen Frost wrote > in >> * Tom Lane (t...@sss.pgh.pa.us) wrote: >>> Yeah, those messages are all pretty ancient, from when WAL was new and not >>> to be trusted much. Perhaps the thing to do is m

Re: Query which shows FK child columns?

2019-11-15 Thread Tom Lane
- but if you just want to see what the constraints are, then this is a good way. regards, tom lane

Re: porting horde to Postgresql 12, dropped pg_attrdef

2019-11-15 Thread Tom Lane
k a serial sequence to its owning column. I don't have an example right to hand, but I'm sure there is an instance in pg_dump, and probably elsewhere. regards, tom lane

Re: Create array of data from JSONB in PG 9.5

2019-11-15 Thread Tom Lane
; AND "vessels"."company_id" = '7d105acd-be5a-4225-a2db-b549105e4172'; > When I ran the same query to production I get error: > ERROR: set-valued function called in context that cannot accept a set IIRC, you can't nest calls of set-returning functions before about v10. One workaround is to put the inner set-returning function call into a sub-select. regards, tom lane

Re: here does postgres take its timezone information from?

2019-11-15 Thread Tom Lane
change the default setting then. So it seems that that change was not entirely without fallout: https://www.postgresql.org/message-id/flat/16118-ef1e45e342c52416%40postgresql.org I don't think this is reason to revert the change, exactly, but it's a concern. I wonder why FreeBSD editorializes on the set of zone names? regards, tom lane

Re: here does postgres take its timezone information from?

2019-11-15 Thread Tom Lane
a non-official alias, but I don't think it's reason to panic. regards, tom lane

Re: access to original-statement predicates in an INSTEAD-OF row trigger

2019-11-16 Thread Tom Lane
more manageable way of dealing with concurrent-update problems. regards, tom lane

Re: here does postgres take its timezone information from?

2019-11-17 Thread Tom Lane
ial names! [ shrug... ] The installed format doesn't provide any way to distinguish which are the "official" names. They're typically all hardlinks to the same file. regards, tom lane

Re: Remote Connection Help

2019-11-21 Thread Tom Lane
the listen_addresses line when you edited it. As installed, postgresql.conf is pretty much all comments. You might get more insight from select * from pg_settings where name = 'listen_addresses'; particularly the source, sourcefile, sourceline fields. regards, tom lane

Re: Remote Connection Help

2019-11-21 Thread Tom Lane
ld that make a > difference? Hm, well, *something* is overriding the setting. What did you find in pg_settings? regards, tom lane

Re: Remote Connection Help

2019-11-21 Thread Tom Lane
The OP may well need to adjust pg_hba.conf too, but he's not got that far yet :-( regards, tom lane

Re: Remote Connection Help

2019-11-21 Thread Tom Lane
"Jason L. Amerson" writes: > pg_settings show localhost. What I asked you about was the "source" columns. regards, tom lane

Re: Constants in the foreighn key constraints

2019-11-23 Thread Tom Lane
e. I think that's an okay limitation for a niche use-case. It also generalizes more easily to cases where there's more than exactly one allowed value for a referencing column. regards, tom lane

Re: Remote Connection Help

2019-11-23 Thread Tom Lane
t say whether either of those apply to you; but I would note that the DDoS scenario only applies if your server is reachable from the net-at-large, which is seldom a good idea in the first place. regards, tom lane

Re: Trouble incrementing a column

2019-11-23 Thread Tom Lane
ng like the above will work. Note that you pay a fairly substantial performance penalty for deferring the check, which is why it isn't the default, even though the SQL spec says it ought to be. This is documented in some obscure place [ ... looks around ... ] ah, see "Non-Deferred Uniqueness Constraints" under Compatibility in the CREATE TABLE reference page. regards, tom lane

Re: here does postgres take its timezone information from?

2019-11-24 Thread Tom Lane
seems possible that he'll change that policy, so I'd advise doing nothing until that discussion settles. regards, tom lane [1] https://mm.icann.org/pipermail/tz/2019-November/028633.html

Re: Trouble incrementing a column

2019-11-24 Thread Tom Lane
Jeff Janes writes: > On Sat, Nov 23, 2019 at 4:47 PM Tom Lane wrote: >> Note that you pay a fairly substantial performance penalty for deferring >> the check, which is why it isn't the default, even though the SQL spec >> says it ought to be. > Do you know what t

Re: casting Bangla characters to NUMERIC

2019-11-25 Thread Tom Lane
CII digits using replace(), then cast. It'd be a bit tedious, but fortunately there are only 10 cases to consider, and you could wrap that up in a function. regards, tom lane

Re: Range contains element filter not using index of the element column

2019-11-27 Thread Tom Lane
an with the native <@ operator. So this isn't an all-purpose fix --- but it might cover your needs and be nicer than maintaining a second index on the column. regards, tom lane

Re: status of CURSORs after DISCONNECT

2019-11-28 Thread Tom Lane
regards, tom lane

Re: using replace function

2019-11-28 Thread Tom Lane
pattern, so the PITA factor is high. And I doubt it'd be faster than the CASE solution. regards, tom lane

Re: Rows violating Foreign key constraint exists

2019-11-29 Thread Tom Lane
ed to be sure that your queries use the questionable indexes, and maybe even search for some of the specific rows that seem mis-indexed. regards, tom lane

<    1   2   3   4   5   6   7   8   9   10   >