Re: pgsql: Move pg_stat_statements query jumbling to core.

2021-04-07 Thread Julien Rouhaud
On Thu, Apr 08, 2021 at 12:08:02PM +0530, Amit Kapila wrote: > On Thu, Apr 8, 2021 at 11:40 AM Julien Rouhaud wrote: > > > > That was indeed the problem. I think the best is to entirely ignore > > parallel > > workers in pg_stat_statements, > > > > I haven't studied this patch but I have a ques

Re: pgsql: Move pg_stat_statements query jumbling to core.

2021-04-07 Thread Amit Kapila
On Thu, Apr 8, 2021 at 11:40 AM Julien Rouhaud wrote: > > On Thu, Apr 08, 2021 at 01:22:49PM +0800, Julien Rouhaud wrote: > > Le jeu. 8 avr. 2021 à 13:17, Andres Freund a écrit : > > > > > > > > This - or something in the vicinity - seems to break running the > > > regression tests with force_par

pgsql: Update Unicode data to CLDR 39

2021-04-07 Thread Peter Eisentraut
Update Unicode data to CLDR 39 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2e0e0666790e48cec716d4947f89d067ef53490c Modified Files -- contrib/unaccent/unaccent.rules | 9 + src/Makefile.global.in | 2 +- 2 files changed, 10 insertions(

Re: pgsql: SQL-standard function body

2021-04-07 Thread Peter Eisentraut
On 08.04.21 01:06, Tom Lane wrote: Andres Freund writes: On 2021-04-07 19:53:35 +, Peter Eisentraut wrote: SQL-standard function body This is turning the BF red: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=rhinoceros&dt=2021-04-07%2022%3A52%3A19 Might be force_parallel_mode=

Re: pgsql: autovacuum: handle analyze for partitioned tables

2021-04-07 Thread Tom Lane
Alvaro Herrera writes: > autovacuum: handle analyze for partitioned tables Looks like this has issues under EXEC_BACKEND: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=culicidae&dt=2021-04-08%2005%3A50%3A08 regards, tom lane

Re: pgsql: Move pg_stat_statements query jumbling to core.

2021-04-07 Thread Julien Rouhaud
On Thu, Apr 08, 2021 at 01:22:49PM +0800, Julien Rouhaud wrote: > Le jeu. 8 avr. 2021 à 13:17, Andres Freund a écrit : > > > > > This - or something in the vicinity - seems to break running the > > regression tests with force_parallel_mode=regress. There's lots of > > differences like > > > > SE

pgsql: Provide ReadRecentBuffer() to re-pin buffers by ID.

2021-04-07 Thread Thomas Munro
Provide ReadRecentBuffer() to re-pin buffers by ID. If you know the ID of a buffer that recently held a block that you would like to pin, this function can be used check if it's still there. It can be used to avoid a second lookup in the buffer mapping table after PrefetchBuffer() reports a cache

Re: pgsql: Move pg_stat_statements query jumbling to core.

2021-04-07 Thread Julien Rouhaud
Le jeu. 8 avr. 2021 à 13:17, Andres Freund a écrit : > > This - or something in the vicinity - seems to break running the > regression tests with force_parallel_mode=regress. There's lots of > differences like > > SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE > "C"; >

pgsql: autovacuum: handle analyze for partitioned tables

2021-04-07 Thread Alvaro Herrera
autovacuum: handle analyze for partitioned tables Previously, autovacuum would completely ignore partitioned tables, which is not good regarding analyze -- failing to analyze those tables means poor plans may be chosen. Make autovacuum aware of those tables by propagating "changes since analyze"

Re: pgsql: Move pg_stat_statements query jumbling to core.

2021-04-07 Thread Andres Freund
Hi, On 2021-04-07 17:06:59 +, Bruce Momjian wrote: > Move pg_stat_statements query jumbling to core. > > Add compute_query_id GUC to control whether a query identifier should be > computed by the core (off by default). It's thefore now possible to > disable core queryid computation and use pg

pgsql: Cope with NULL query string in ExecInitParallelPlan().

2021-04-07 Thread Andres Freund
Cope with NULL query string in ExecInitParallelPlan(). It's far from clear that this is the right approach - but a good portion of the buildfarm has been red for a few hours, on the last day of the CF. And this fixes at least the obvious crash. So let's go with that for now. Discussion: https://

pgsql: Fix typo in jsonfuncs.c.

2021-04-07 Thread Amit Kapila
Fix typo in jsonfuncs.c. Author: Tatsuro Yamada Discussion: https://postgr.es/m/7c166a60-2808-6b89-9524-feefc6233...@nttcom.co.jp_1 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8ffb003591ff02f59d92c36a5791307881863146 Modified Files -- src/backend/u

pgsql: Repair find_inheritance_children with no active snapshot

2021-04-07 Thread Alvaro Herrera
Repair find_inheritance_children with no active snapshot When working on a scan with only a catalog snapshot, we may not have an ActiveSnapshot set. If we were to come across a detached partition, that would cause a crash. Fix by only ignoring detached partitions when there's an active snapshot.

pgsql: Allow psql's \df and \do commands to specify argument types.

2021-04-07 Thread Tom Lane
Allow psql's \df and \do commands to specify argument types. When dealing with overloaded function or operator names, having to look through a long list of matches is tedious. Let's extend these commands to allow specification of (input) argument types to let such results be trimmed down. Each a

pgsql: Add csvlog output for the new query_id value

2021-04-07 Thread Bruce Momjian
Add csvlog output for the new query_id value This also adjusts the printf format for query id used by log_line_prefix (%Q). Reported-by: Justin Pryzby Discussion: https://postgr.es/m/20210408005402.gg24...@momjian.us Author: Julien Rouhaud, Bruce Momjian Branch -- master Details --- h

Re: pgsql: SQL-standard function body

2021-04-07 Thread Michael Paquier
On Wed, Apr 07, 2021 at 06:50:17PM -0700, Andres Freund wrote: > I've wondered about that too. Perhaps we could reuse the pg_upgrade run? Yes, it would be a good idea to reuse that. -- Michael signature.asc Description: PGP signature

Re: pgsql: SQL-standard function body

2021-04-07 Thread Andres Freund
Hi, On 2021-04-08 13:33:18 +1200, David Rowley wrote: > On Thu, 8 Apr 2021 at 11:06, Tom Lane wrote: > > > > Andres Freund writes: > > > > > Might be force_parallel_mode=regress related. > > > > Yeah. On my machine, it's fine without force_parallel_mode and > > crashes with that. Looks like qu

Re: pgsql: SQL-standard function body

2021-04-07 Thread David Rowley
On Thu, 8 Apr 2021 at 11:06, Tom Lane wrote: > > Andres Freund writes: > > > Might be force_parallel_mode=regress related. > > Yeah. On my machine, it's fine without force_parallel_mode and > crashes with that. Looks like query text is not getting passed > to the parallel worker in some cases.

pgsql: Teach VACUUM to bypass unnecessary index vacuuming.

2021-04-07 Thread Peter Geoghegan
Teach VACUUM to bypass unnecessary index vacuuming. VACUUM has never needed to call ambulkdelete() for each index in cases where there are precisely zero TIDs in its dead_tuples array by the end of its first pass over the heap (also its only pass over the heap in this scenario). Index vacuuming i

Re: pgsql: SQL-standard function body

2021-04-07 Thread Tom Lane
Andres Freund writes: > On 2021-04-07 19:53:35 +, Peter Eisentraut wrote: >> SQL-standard function body > This is turning the BF red: > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=rhinoceros&dt=2021-04-07%2022%3A52%3A19 > Might be force_parallel_mode=regress related. Yeah. On my

Re: pgsql: SQL-standard function body

2021-04-07 Thread Andres Freund
Hi, On 2021-04-07 19:53:35 +, Peter Eisentraut wrote: > SQL-standard function body > > This adds support for writing CREATE FUNCTION and CREATE PROCEDURE > statements for language SQL with a function body that conforms to the > SQL standard and is portable to other implementations. > > Inste

Re: pgsql: Add some information about authenticated identity via log_connec

2021-04-07 Thread Michael Paquier
On Wed, Apr 07, 2021 at 12:51:57PM -0400, Tom Lane wrote: > Sounds reasonable, pushed. (I didn't actually verify it on prairiedog, > because that would have taken a couple hours :-(. We can revisit if > that animal fails to go green.) Thanks to both of you. prairiedog is the only animal running

pgsql: Fix regression test failure caused by commit 4f0b0966c8

2021-04-07 Thread Bruce Momjian
Fix regression test failure caused by commit 4f0b0966c8 The query originally used was too simple, cause explain_filter() to be unable to remove JIT output text. Reported-by: Tom Lane Author: Julien Rouhaud Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/bc70728693

pgsql: Fix some failures with connection tests on Windows hosts

2021-04-07 Thread Michael Paquier
Fix some failures with connection tests on Windows hosts The truncation of the log file, that this set of tests relies on to make sure that a connection attempt matches with its expected backend log pattern, fails, as reported by buildfarm member fairywren. Instead of a truncation, do a rotation

pgsql: SQL-standard function body

2021-04-07 Thread Peter Eisentraut
SQL-standard function body This adds support for writing CREATE FUNCTION and CREATE PROCEDURE statements for language SQL with a function body that conforms to the SQL standard and is portable to other implementations. Instead of the PostgreSQL-specific AS $$ string literal $$ syntax, this allows

pgsql: Add wraparound failsafe to VACUUM.

2021-04-07 Thread Peter Geoghegan
Add wraparound failsafe to VACUUM. Add a failsafe mechanism that is triggered by VACUUM when it notices that the table's relfrozenxid and/or relminmxid are dangerously far in the past. VACUUM checks the age of the table dynamically, at regular intervals. When the failsafe triggers, VACUUM takes

pgsql: Make use of in-core query id added by commit 5fd9dfa5f5

2021-04-07 Thread Bruce Momjian
Make use of in-core query id added by commit 5fd9dfa5f5 Use the in-core query id computation for pg_stat_activity, log_line_prefix, and EXPLAIN VERBOSE. Similar to other fields in pg_stat_activity, only the queryid from the top level statements are exposed, and if the backends status isn't active

pgsql: amcheck: fix multiple problems with TOAST pointer validation

2021-04-07 Thread Robert Haas
amcheck: fix multiple problems with TOAST pointer validation First, don't perform database access while holding a buffer lock. When checking a heap, we can validate that TOAST pointers are sane by performing a scan on the TOAST index and looking up the chunks that correspond to each value ID that

pgsql: Move pg_stat_statements query jumbling to core.

2021-04-07 Thread Bruce Momjian
Move pg_stat_statements query jumbling to core. Add compute_query_id GUC to control whether a query identifier should be computed by the core (off by default). It's thefore now possible to disable core queryid computation and use pg_stat_statements with a different algorithm to compute the query

Re: pgsql: Add some information about authenticated identity via log_connec

2021-04-07 Thread Tom Lane
Jacob Champion writes: > On Wed, 2021-04-07 at 10:27 -0400, Tom Lane wrote: >> prairiedog is also not happy, apparently for a different reason. > That one's failing because older OpenSSL doesn't support channel > binding, and the new test I wrote forgot to check to make sure channel > binding was

pgsql: Remove channel binding requirement from clientcert=verify-full t

2021-04-07 Thread Tom Lane
Remove channel binding requirement from clientcert=verify-full test. This fails on older OpenSSL versions that lack channel binding support. Since that feature is not essential to this test case, just remove it, instead of complicating matters. Per buildfarm. Jacob Champion Discussion: https:

pgsql: Comment cleanup for a1115fa07.

2021-04-07 Thread Tom Lane
Comment cleanup for a1115fa07. Amit Langote Discussion: https://postgr.es/m/ca+hiwqecawateauh1utbzmeztjelzbrortz9_x9z5cfjtwj...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/0d46771eaaf77ad08555cf34e421234d5943edfa Modified Files -- s

Re: pgsql: Add some information about authenticated identity via log_connec

2021-04-07 Thread Jacob Champion
On Wed, 2021-04-07 at 10:27 -0400, Tom Lane wrote: > Michael Paquier writes: > > On Wed, Apr 07, 2021 at 01:17:34AM +, Michael Paquier wrote: > > > Add some information about authenticated identity via log_connections > > So, fairywren, that is able to run the SSL tests on Windows, has been >

pgsql: amcheck: Remove duplicate XID/MXID bounds checks.

2021-04-07 Thread Robert Haas
amcheck: Remove duplicate XID/MXID bounds checks. Commit 3b6c1259f9ca8e21860aaf24ec6735a8e5598ea0 resulted in the same xmin and xmax bounds checking being performed in both check_tuple() and check_tuple_visibility(). Remove the duplication. While at it, adjust some code comments that were overloo

pgsql: Truncate line pointer array during VACUUM.

2021-04-07 Thread Peter Geoghegan
Truncate line pointer array during VACUUM. Teach VACUUM to truncate the line pointer array of each heap page when a contiguous group of LP_UNUSED line pointers appear at the end of the array -- these unused and unreferenced items are excluded. This process occurs during VACUUM's second pass over

pgsql: Tighten up allowed names for custom GUC parameters.

2021-04-07 Thread Tom Lane
Tighten up allowed names for custom GUC parameters. Formerly we were pretty lax about what a custom GUC's name could be; so long as it had at least one dot in it, we'd take it. However, corner cases such as dashes or equal signs in the name would cause various bits of functionality to misbehave.

Re: pgsql: Add some information about authenticated identity via log_connec

2021-04-07 Thread Tom Lane
Michael Paquier writes: > On Wed, Apr 07, 2021 at 01:17:34AM +, Michael Paquier wrote: >> Add some information about authenticated identity via log_connections > So, fairywren, that is able to run the SSL tests on Windows, has been > complaining here: prairiedog is also not happy, apparently

pgsql: Don't add non-existent pages to bitmap from BRIN

2021-04-07 Thread Tomas Vondra
Don't add non-existent pages to bitmap from BRIN The code in bringetbitmap() simply added the whole matching page range to the TID bitmap, as determined by pages_per_range, even if some of the pages were beyond the end of the heap. The query then might fail with an error like this: ERROR: coul

pgsql: Don't add non-existent pages to bitmap from BRIN

2021-04-07 Thread Tomas Vondra
Don't add non-existent pages to bitmap from BRIN The code in bringetbitmap() simply added the whole matching page range to the TID bitmap, as determined by pages_per_range, even if some of the pages were beyond the end of the heap. The query then might fail with an error like this: ERROR: coul

pgsql: Don't add non-existent pages to bitmap from BRIN

2021-04-07 Thread Tomas Vondra
Don't add non-existent pages to bitmap from BRIN The code in bringetbitmap() simply added the whole matching page range to the TID bitmap, as determined by pages_per_range, even if some of the pages were beyond the end of the heap. The query then might fail with an error like this: ERROR: coul

pgsql: Don't add non-existent pages to bitmap from BRIN

2021-04-07 Thread Tomas Vondra
Don't add non-existent pages to bitmap from BRIN The code in bringetbitmap() simply added the whole matching page range to the TID bitmap, as determined by pages_per_range, even if some of the pages were beyond the end of the heap. The query then might fail with an error like this: ERROR: coul

pgsql: Don't add non-existent pages to bitmap from BRIN

2021-04-07 Thread Tomas Vondra
Don't add non-existent pages to bitmap from BRIN The code in bringetbitmap() simply added the whole matching page range to the TID bitmap, as determined by pages_per_range, even if some of the pages were beyond the end of the heap. The query then might fail with an error like this: ERROR: coul

pgsql: Don't add non-existent pages to bitmap from BRIN

2021-04-07 Thread Tomas Vondra
Don't add non-existent pages to bitmap from BRIN The code in bringetbitmap() simply added the whole matching page range to the TID bitmap, as determined by pages_per_range, even if some of the pages were beyond the end of the heap. The query then might fail with an error like this: ERROR: coul

pgsql: libpq: Set Server Name Indication (SNI) for SSL connections

2021-04-07 Thread Peter Eisentraut
libpq: Set Server Name Indication (SNI) for SSL connections By default, have libpq set the TLS extension "Server Name Indication" (SNI). This allows an SNI-aware SSL proxy to route connections. (This requires a proxy that is aware of the PostgreSQL protocol, not just any SSL proxy.) In the futu

pgsql: Refactor hba_authname

2021-04-07 Thread Magnus Hagander
Refactor hba_authname The previous implementation (from 9afffcb833) had an unnecessary check on the boundaries of the enum which trigtered compile warnings. To clean it up, move the pre-existing static assert to a central location and call that. Reported-By: Erik Rijkers Reviewed-By: Michael Paqu

pgsql: doc: Improve wording

2021-04-07 Thread Peter Eisentraut
doc: Improve wording Discussion: https://www.postgresql.org/message-id/flat/161626776179.652.11944895442156126506%40wrigleys.postgresql.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4560e0acdafd57f3ba109b98e15ac047798d960c Modified Files -- doc/s

Re: pgsql: Add sortsupport for gist_btree opclasses, for faster index build

2021-04-07 Thread Heikki Linnakangas
On 07/04/2021 14:21, Michael Paquier wrote: On Wed, Apr 07, 2021 at 10:24:09AM +, Heikki Linnakangas wrote: Add sortsupport for gist_btree opclasses, for faster index builds. Commit 16fa9b2b30 introduced a faster way to build GiST indexes, by sorting all the data. This commit adds the sorts

pgsql: Revert "Add sortsupport for gist_btree opclasses, for faster ind

2021-04-07 Thread Heikki Linnakangas
Revert "Add sortsupport for gist_btree opclasses, for faster index builds." This reverts commit 9f984ba6d23dc6eecebf479ab1d3f2e550a4e9be. It was making the buildfarm unhappy, apparently setting client_min_messages in a regression test produces different output if log_statement='all'. Another issu

Re: pgsql: Add sortsupport for gist_btree opclasses, for faster index build

2021-04-07 Thread Andrew Dunstan
On 4/7/21 6:24 AM, Heikki Linnakangas wrote: > Add sortsupport for gist_btree opclasses, for faster index builds. > > Commit 16fa9b2b30 introduced a faster way to build GiST indexes, by > sorting all the data. This commit adds the sortsupport functions needed > to make use of that feature for btr

Re: pgsql: Add sortsupport for gist_btree opclasses, for faster index build

2021-04-07 Thread Michael Paquier
On Wed, Apr 07, 2021 at 10:24:09AM +, Heikki Linnakangas wrote: > Add sortsupport for gist_btree opclasses, for faster index builds. > > Commit 16fa9b2b30 introduced a faster way to build GiST indexes, by > sorting all the data. This commit adds the sortsupport functions needed > to make use o

Re: pgsql: Refactor all TAP test suites doing connection checks

2021-04-07 Thread Michael Paquier
On Tue, Apr 06, 2021 at 10:37:53AM +0900, Michael Paquier wrote: > Right. The kerberos suite does not do that though, so wouldn't it be > better to use the same trick with -c? For example, the attached for > ~13 does so. This was the only problem after one extra lookup, so fixed in 11~13. -- Mic

pgsql: Fix potential rare failure in the kerberos TAP tests

2021-04-07 Thread Michael Paquier
Fix potential rare failure in the kerberos TAP tests Instead of writing a query to psql's stdin, which can cause a failure where psql exits before writing, reporting a write failure with a broken pipe, this changes the logic to use -c. This was not seen in the buildfarm as no animals with a sensi

pgsql: Fix potential rare failure in the kerberos TAP tests

2021-04-07 Thread Michael Paquier
Fix potential rare failure in the kerberos TAP tests Instead of writing a query to psql's stdin, which can cause a failure where psql exits before writing, reporting a write failure with a broken pipe, this changes the logic to use -c. This was not seen in the buildfarm as no animals with a sensi

pgsql: Fix potential rare failure in the kerberos TAP tests

2021-04-07 Thread Michael Paquier
Fix potential rare failure in the kerberos TAP tests Instead of writing a query to psql's stdin, which can cause a failure where psql exits before writing, reporting a write failure with a broken pipe, this changes the logic to use -c. This was not seen in the buildfarm as no animals with a sensi

pgsql: Add sortsupport for gist_btree opclasses, for faster index build

2021-04-07 Thread Heikki Linnakangas
Add sortsupport for gist_btree opclasses, for faster index builds. Commit 16fa9b2b30 introduced a faster way to build GiST indexes, by sorting all the data. This commit adds the sortsupport functions needed to make use of that feature for btree_gist. Author: Andrey Borodin Discussion: https://ww