PostgreSQL 16.0 commit log

Doc: fix release date in release-16.sgml.

commit   : c372fbbd8e911f2412b80a8c39d7079366565d67    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 11 Sep 2023 16:25:06 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 11 Sep 2023 16:25:06 -0400    

Click here for diff

M doc/src/sgml/release-16.sgml

Stamp 16.0.

commit   : 2439153f4477892b5af0f05e1c95eb0a048608bd    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 11 Sep 2023 16:10:09 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 11 Sep 2023 16:10:09 -0400    

Click here for diff

M configure
M configure.ac
M meson.build

Translation updates

commit   : e472a8c51c935ee074ab83197a1358325cc91b1b    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 11 Sep 2023 14:22:52 +0200    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 11 Sep 2023 14:22:52 +0200    

Click here for diff

This file was missed in the previous update.  
  
Source-Git-URL: ssh://[email protected]/pgtranslation/messages.git  
Source-Git-Hash: de944161c6153124a7bf720cb99823ff31b64bab  

A src/interfaces/ecpg/ecpglib/po/zh_TW.po

Translation updates

commit   : 6bdeed9844d77d051905771c5673364d4e385052    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 11 Sep 2023 14:08:53 +0200    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 11 Sep 2023 14:08:53 +0200    

Click here for diff

Source-Git-URL: ssh://[email protected]/pgtranslation/messages.git  
Source-Git-Hash: 06696f05da005029a2326e1cbb234917a9286914  

M src/backend/po/es.po
M src/backend/po/ko.po
M src/bin/initdb/po/el.po
M src/bin/initdb/po/ko.po
A src/bin/initdb/po/zh_TW.po
M src/bin/pg_archivecleanup/po/ko.po
M src/bin/pg_basebackup/po/el.po
M src/bin/pg_basebackup/po/ko.po
M src/bin/pg_checksums/po/ko.po
M src/bin/pg_config/po/el.po
M src/bin/pg_config/po/ko.po
M src/bin/pg_controldata/po/ko.po
M src/bin/pg_ctl/po/el.po
M src/bin/pg_ctl/po/ko.po
A src/bin/pg_ctl/po/zh_TW.po
M src/bin/pg_dump/po/el.po
M src/bin/pg_dump/po/ko.po
A src/bin/pg_dump/po/zh_TW.po
M src/bin/pg_resetwal/po/ko.po
M src/bin/pg_rewind/po/el.po
M src/bin/pg_rewind/po/ko.po
M src/bin/pg_test_fsync/po/ko.po
M src/bin/pg_test_timing/po/ko.po
M src/bin/pg_upgrade/po/ko.po
M src/bin/pg_verifybackup/po/el.po
M src/bin/pg_verifybackup/po/ko.po
M src/bin/pg_waldump/po/el.po
M src/bin/pg_waldump/po/ko.po
M src/bin/psql/po/el.po
M src/bin/psql/po/ko.po
M src/bin/scripts/po/el.po
M src/bin/scripts/po/ko.po
M src/interfaces/ecpg/preproc/po/ko.po
M src/interfaces/ecpg/preproc/po/zh_TW.po
M src/interfaces/libpq/po/el.po
M src/interfaces/libpq/po/ja.po
M src/interfaces/libpq/po/ko.po
M src/pl/plperl/po/ko.po
M src/pl/plpgsql/src/po/ko.po
M src/pl/plpython/po/el.po
M src/pl/plpython/po/ko.po
M src/pl/tcl/po/ko.po

doc: remove mention of backslash doubling in strings

commit   : efaa50c783d73d99b4e999012f9f0a9ffdad3e50    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 8 Sep 2023 17:25:15 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 8 Sep 2023 17:25:15 -0400    

Click here for diff

Reported-by: Laurenz Albe  
  
Discussion: https://postgr.es/m/[email protected]  
  
Author: Laurenz Albe  
  
Backpatch-through: 11  

M doc/src/sgml/syntax.sgml

Stabilize subscription stats test.

commit   : 1b95c8d85fa66c0ef63591b8064b023872a8f43c    
  
author   : Masahiko Sawada <[email protected]>    
date     : Fri, 8 Sep 2023 22:50:56 +0900    
  
committer: Masahiko Sawada <[email protected]>    
date     : Fri, 8 Sep 2023 22:50:56 +0900    

Click here for diff

The new test added by commit 68a59f9e9 disables the subscription and  
manually drops the associated replication slot. However, since  
disabling the subsubscription doesn't wait for a walsender to release  
the replication slot and exit, pg_drop_replication_slot() could  
fail. Avoid failure by adding a wait for the replication slot to  
become inactive.  
  
Reported-by: Hou Zhijie, as per buildfarm  
Reviewed-by: Hou Zhijie  
Discussion: https://postgr.es/m/OS0PR01MB571682316378379AA34854F694E9A%40OS0PR01MB5716.jpnprd01.prod.outlook.com  
Backpatch-through: 15  

M src/test/subscription/t/026_stats.pl

doc: Extend documentation of PG_TEST_EXTRA

commit   : bae47d78673e42bc203bc5a8172e058f1c5bb548    
  
author   : Daniel Gustafsson <[email protected]>    
date     : Fri, 8 Sep 2023 11:34:43 +0200    
  
committer: Daniel Gustafsson <[email protected]>    
date     : Fri, 8 Sep 2023 11:34:43 +0200    

Click here for diff

Extend the PG_TEST_EXTRA documentation to mention resource intensive  
tests as well. The previous wording only mentioned special software  
and security in the main paragraph, with resource usage listed on one  
of the tests in the list.  
  
Backpatch to v15 where f47ed79cc8 added wal_consistenct_checking as  
a PG_TEST_EXTRA target.  
  
Author: Nazir Bilal Yavuz <[email protected]>  
Discussion: https://postgr.es/m/CAN55FZ0OthTuBdiNkaX2BvxuHdK4Y1MVEb8_uEuD1yHMPmT9Og@mail.gmail.com  
Backpatch-through: 15  

M doc/src/sgml/regress.sgml

pg_basebackup: Generate valid temporary slot names under PQbackendPID()

commit   : 1057958436c5b9f0468fc3bf08dd49b1e0f43acb    
  
author   : Michael Paquier <[email protected]>    
date     : Thu, 7 Sep 2023 14:12:25 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Thu, 7 Sep 2023 14:12:25 +0900    

Click here for diff

pgbouncer can cause PQbackendPID() to return negative values due to it  
filling be_pid with random bytes (even these days pid_max can only be  
set up to 2^22 on 64b machines on Linux, for example, so this cannot  
happen with normal PID numbers).  When this happens, pg_basebackup may  
generate a temporary slot name that may not be accepted by the parser,  
leading to spurious failures, like:  
pg_basebackup: error: could not send replication command  
ERROR:  replication slot name "pg_basebackup_-1201966863" contains  
invalid character  
  
This commit fixes that problem by formatting the result from  
PQbackendPID() as an unsigned integer when creating the temporary  
replication slot name, so as the invalid character is gone and the  
command can be parsed.  
  
Author: Jelte Fennema  
Reviewed-by: Daniel Gustafsson, Nishant Sharma  
Discussion: https://postgr.es/m/CAGECzQQOGvYfp8ziF4fWQ_o8s2K7ppaoWBQnTmdakn3s-4Z=5g@mail.gmail.com  
Backpatch-through: 11  

M src/bin/pg_basebackup/pg_basebackup.c

Disable 031_recovery_conflict.pl in 15 and 16.

commit   : 8d1cf9674a253f88d52c365804b9b4d3a7eeab9d    
  
author   : Thomas Munro <[email protected]>    
date     : Thu, 7 Sep 2023 11:47:42 +1200    
  
committer: Thomas Munro <[email protected]>    
date     : Thu, 7 Sep 2023 11:47:42 +1200    

Click here for diff

This test fails due to known bugs in the test and the server.  Those  
will be fixed in master shortly and possibly back-patched a bit later,  
but in the meantime it is unhelpful for package maintainers if the tests  
randomly fail, and it's not a good time to make complex changes in 16.  
  
This had already been done for older branches prior to 15's release.  
Now we're about to release 16, and Debian's test builds are regularly  
failing on one architecture, so let's do the same for 15 and 16.  
  
Reported-by: Christoph Berg <[email protected]>  
Reported-by: Bharath Rupireddy <[email protected]>  
Discussion: https://postgr.es/m/CALj2ACVr8au2J_9D88UfRCi0JdWhyQDDxAcSVav0B0irx9nXEg%40mail.gmail.com  

M src/test/recovery/t/031_recovery_conflict.pl

doc: mention that to_char() values are rounded

commit   : 253bc4eb284b3d3e5fe554f74fcc50ca10e8fd61    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 6 Sep 2023 16:52:24 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 6 Sep 2023 16:52:24 -0400    

Click here for diff

Reported-by: [email protected]  
  
Diagnosed-by: Laurenz Albe  
  
Discussion: https://postgr.es/m/[email protected]  
  
Author: Laurenz Albe  
  
Backpatch-through: 11  

M doc/src/sgml/func.sgml

doc: PG 16 relnotes: fix subscriber role permission description

commit   : 3ddc889e334f21c6dc98753dcd8b485b275b5e33    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 6 Sep 2023 15:36:07 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 6 Sep 2023 15:36:07 -0400    

Click here for diff

Reported-by: Magnus Hagander  
  
Discussion: https://postgr.es/m/CABUevEwBXi5oqqMj429Lxjro1uu-fdKgSkJtgJS5aTOmujEGQQ@mail.gmail.com  
  
Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

Translation updates

commit   : b323fcc58cb15200572a8515bc9b5bb1882c4d42    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 6 Sep 2023 09:04:30 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 6 Sep 2023 09:04:30 +0200    

Click here for diff

Source-Git-URL: https://git.postgresql.org/git/pgtranslation/messages.git  
Source-Git-Hash: c5b5ab1da828e1d7a012431e417f0b75b2450c8f  

M src/backend/po/de.po
M src/backend/po/es.po
M src/backend/po/fr.po
M src/backend/po/ja.po
M src/backend/po/ka.po
M src/backend/po/ru.po
M src/backend/po/sv.po
M src/bin/initdb/po/de.po
M src/bin/initdb/po/es.po
M src/bin/initdb/po/fr.po
M src/bin/initdb/po/it.po
M src/bin/initdb/po/ja.po
M src/bin/initdb/po/ka.po
M src/bin/initdb/po/pt_BR.po
M src/bin/initdb/po/ru.po
M src/bin/initdb/po/sv.po
M src/bin/pg_amcheck/po/it.po
M src/bin/pg_amcheck/po/ru.po
M src/bin/pg_amcheck/po/sv.po
M src/bin/pg_archivecleanup/po/it.po
M src/bin/pg_archivecleanup/po/ru.po
M src/bin/pg_basebackup/po/it.po
M src/bin/pg_basebackup/po/ru.po
M src/bin/pg_basebackup/po/sv.po
M src/bin/pg_checksums/po/es.po
M src/bin/pg_checksums/po/it.po
M src/bin/pg_checksums/po/ru.po
M src/bin/pg_checksums/po/uk.po
M src/bin/pg_config/po/ru.po
M src/bin/pg_config/po/sv.po
M src/bin/pg_controldata/po/cs.po
M src/bin/pg_controldata/po/fr.po
M src/bin/pg_controldata/po/it.po
M src/bin/pg_controldata/po/pt_BR.po
M src/bin/pg_controldata/po/ru.po
M src/bin/pg_controldata/po/sv.po
M src/bin/pg_ctl/po/fr.po
M src/bin/pg_ctl/po/it.po
M src/bin/pg_ctl/po/pl.po
M src/bin/pg_ctl/po/ru.po
M src/bin/pg_ctl/po/sv.po
M src/bin/pg_ctl/po/tr.po
M src/bin/pg_dump/po/cs.po
M src/bin/pg_dump/po/de.po
M src/bin/pg_dump/po/fr.po
M src/bin/pg_dump/po/it.po
M src/bin/pg_dump/po/ja.po
M src/bin/pg_dump/po/ru.po
M src/bin/pg_resetwal/po/cs.po
M src/bin/pg_resetwal/po/de.po
M src/bin/pg_resetwal/po/es.po
M src/bin/pg_resetwal/po/fr.po
M src/bin/pg_resetwal/po/it.po
M src/bin/pg_resetwal/po/ja.po
M src/bin/pg_resetwal/po/ka.po
M src/bin/pg_resetwal/po/ru.po
M src/bin/pg_resetwal/po/sv.po
M src/bin/pg_rewind/po/fr.po
M src/bin/pg_rewind/po/it.po
M src/bin/pg_rewind/po/ru.po
M src/bin/pg_rewind/po/sv.po
M src/bin/pg_test_fsync/po/ru.po
M src/bin/pg_test_timing/po/ru.po
M src/bin/pg_upgrade/po/fr.po
M src/bin/pg_upgrade/po/ja.po
M src/bin/pg_upgrade/po/ru.po
M src/bin/pg_verifybackup/po/fr.po
M src/bin/pg_verifybackup/po/it.po
M src/bin/pg_verifybackup/po/ru.po
M src/bin/pg_waldump/po/es.po
M src/bin/pg_waldump/po/fr.po
M src/bin/pg_waldump/po/it.po
M src/bin/pg_waldump/po/ru.po
M src/bin/pg_waldump/po/sv.po
M src/bin/pg_waldump/po/uk.po
M src/bin/psql/po/cs.po
M src/bin/psql/po/el.po
M src/bin/psql/po/es.po
M src/bin/psql/po/fr.po
M src/bin/psql/po/it.po
M src/bin/psql/po/ja.po
M src/bin/psql/po/ru.po
M src/bin/scripts/po/cs.po
M src/bin/scripts/po/es.po
M src/bin/scripts/po/fr.po
M src/bin/scripts/po/it.po
M src/bin/scripts/po/ru.po
M src/interfaces/ecpg/ecpglib/po/ru.po
M src/interfaces/ecpg/preproc/po/pl.po
M src/interfaces/ecpg/preproc/po/ru.po
M src/interfaces/libpq/po/ru.po
M src/pl/plperl/po/ru.po
M src/pl/plpgsql/src/po/ru.po
M src/pl/plpython/po/ru.po
M src/pl/tcl/po/fr.po
M src/pl/tcl/po/ru.po

Update list of acknowledgments in release notes

commit   : ae7e3ae8c6ee1a877ef5940cafdb4a051d80feca    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 6 Sep 2023 08:11:22 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 6 Sep 2023 08:11:22 +0200    

Click here for diff

current through 57a011b666  

M doc/src/sgml/release-16.sgml

doc: mention libpq regression tests

commit   : 57a011b6664f284bedd172595dbeb910a53e9121    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 5 Sep 2023 13:05:28 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 5 Sep 2023 13:05:28 -0400    

Click here for diff

Reported-by: Ryo Matsumura  
  
Discussion: https://postgr.es/m/TYCPR01MB11316B3FB56EE54D70BF0CEF6E8E4A@TYCPR01MB11316.jpnprd01.prod.outlook.com  
  
Backpatch-through: 11  

M doc/src/sgml/regress.sgml

Unify gratuitously different error messages

commit   : 9ddecd40664f7523b18f760aea0e04936e8a2302    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 5 Sep 2023 11:36:55 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 5 Sep 2023 11:36:55 +0200    

Click here for diff

Fixup for commit 37188cea0c.  

M src/bin/pg_dump/pg_dump.c

Fix out-of-bound read in gtsvector_picksplit()

commit   : fac3fa0d5b21ce59258a691b88e4176a06722bfc    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 4 Sep 2023 14:55:49 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 4 Sep 2023 14:55:49 +0900    

Click here for diff

This could lead to an imprecise choice when splitting an index page of a  
GiST index on a tsvector, deciding which entries should remain on the  
old page and which entries should move to a new page.  
  
This is wrong since tsearch2 has been moved into core with commit  
140d4ebcb46e, so backpatch all the way down.  This error has been  
spotted by valgrind.  
  
Author: Alexander Lakhin  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 11  

M src/backend/utils/adt/tsgistidx.c

Fix handling of shared statistics with dropped databases

commit   : c397c98ae63d57c35766dbefe4ea34a5162abf53    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 4 Sep 2023 08:04:40 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 4 Sep 2023 08:04:40 +0900    

Click here for diff

Dropping a database while a connection is attempted on it was able to  
lead to the presence of valid database entries in shared statistics.  
The issue is that MyDatabaseId was getting set too early than it should,  
as, if the connection attempted on the dropped database fails when  
renamed or dropped, the shutdown callback of the shared statistics would  
finish by re-inserting a correct entry related to the database already  
dropped.  
  
As analyzed by the bug reporters, this issue could lead to phantom  
entries in the database list maintained by the autovacuum launcher  
(in rebuild_database_list()) if the database dropped was part of the  
database list when it was still valid.  After the database was dropped,  
it would remain the highest on the list of databases to considered by  
the autovacuum worker as things to process.  This would prevent  
autovacuum jobs to happen on all the other databases still present.  
  
The commit fixes this issue by delaying setting MyDatabaseId until the  
database existence has been re-checked with the second scan on  
pg_database after getting a shared lock on it, and by switching  
pgstat_update_dbstats() so as nothing happens if MyDatabaseId is not  
valid.  
  
Issue introduced by 5891c7a8ed8f, so backpatch down to 15.  
  
Reported-by: Will Mortensen, Jacob Speidel  
Analyzed-by: Will Mortensen, Jacob Speidel  
Author: Andres Freund  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 15  

M src/backend/utils/activity/pgstat_database.c
M src/backend/utils/init/postinit.c

doc: PG 16 relnotes: clarify LOCK TABLE description

commit   : 22297cd65fa5efeffebcfaebfdda174dcdbd821a    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 31 Aug 2023 15:14:18 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 31 Aug 2023 15:14:18 -0400    

Click here for diff

Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

Report syncscan position at end of scan.

commit   : d5feb6011e629cc1096bbaa10af5ffcc6c17f908    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 31 Aug 2023 13:02:15 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 31 Aug 2023 13:02:15 +0300    

Click here for diff

The comment in heapgettup_advance_block() says that it reports the  
scan position before checking for end of scan, but that didn't match  
the code. The code was refactored in commit 7ae0ab0ad9, which  
inadvertently changed the order of the check and reporting. Change it  
back.  
  
This caused a few regression test failures with a small shared_buffers  
setting like 10 MB. The 'portals' and 'cluster' tests perform seqscans  
that are large enough that sync seqscans kick in. When the sync scan  
position is not updated at end of scan, the next seq scan doesn't  
start at the beginning of the table, and the test queries are  
sensitive to that.  
  
Reviewed-by: Melanie Plageman, David Rowley  
Discussion: https://www.postgresql.org/message-id/[email protected]  
Backpatch-through: 16  

M src/backend/access/heap/heapam.c

Use actual backend IDs in pg_stat_get_backend_subxact().

commit   : 133654a05b4367e3e70f7cfe496a4b9386674fcf    
  
author   : Nathan Bossart <[email protected]>    
date     : Wed, 30 Aug 2023 14:47:20 -0700    
  
committer: Nathan Bossart <[email protected]>    
date     : Wed, 30 Aug 2023 14:47:20 -0700    

Click here for diff

Unlike the other pg_stat_get_backend* functions,  
pg_stat_get_backend_subxact() looks up the backend entry by using  
its integer argument as a 1-based index in an internal array.  The  
other functions look for the entry with the matching session  
backend ID.  These numbers often match, but that isn't reliably  
true.  
  
This commit resolves this discrepancy by introducing  
pgstat_get_local_beentry_by_backend_id() and using it in  
pg_stat_get_backend_subxact().  We cannot use  
pgstat_get_beentry_by_backend_id() because it returns a  
PgBackendStatus, which lacks the locally computed additions  
available in LocalPgBackendStatus that are required by  
pg_stat_get_backend_subxact().  
  
Author: Ian Barwick  
Reviewed-by: Sami Imseih, Michael Paquier, Robert Haas  
Discussion: https://postgr.es/m/CAB8KJ%3Dj-ACb3H4L9a_b3ZG3iCYDW5aEu3WsPAzkm2S7JzS1Few%40mail.gmail.com  
Backpatch-through: 16  

M src/backend/utils/activity/backend_status.c
M src/backend/utils/adt/pgstatfuncs.c
M src/include/utils/backend_status.h

Rename some support functions for pgstat* views.

commit   : 8dfa37b797843a83a5756ea3309055e8953e1a86    
  
author   : Nathan Bossart <[email protected]>    
date     : Wed, 30 Aug 2023 14:47:14 -0700    
  
committer: Nathan Bossart <[email protected]>    
date     : Wed, 30 Aug 2023 14:47:14 -0700    

Click here for diff

Presently, pgstat_fetch_stat_beentry() accepts a session's backend  
ID as its argument, and pgstat_fetch_stat_local_beentry() accepts a  
1-based index in an internal array as its argument.  The former is  
typically used wherever a user must provide a backend ID, and the  
latter is usually used internally when looping over all entries in  
the array.  This difference was first introduced by d7e39d72ca.  
Before that commit, both functions accepted a 1-based index to the  
internal array.  
  
This commit renames these two functions to make it clear whether  
they use the backend ID or the 1-based index to look up the entry.  
This is preparatory work for a follow-up change that will introduce  
a function for looking up a LocalPgBackendStatus using a backend  
ID.  
  
Reviewed-by: Ian Barwick, Sami Imseih, Michael Paquier, Robert Haas  
Discussion: https://postgr.es/m/CAB8KJ%3Dj-ACb3H4L9a_b3ZG3iCYDW5aEu3WsPAzkm2S7JzS1Few%40mail.gmail.com  
Backpatch-through: 16  

M src/backend/utils/activity/backend_status.c
M src/backend/utils/adt/pgstatfuncs.c
M src/include/utils/backend_status.h

postgres_fdw: Fix test for parameterized foreign scan.

commit   : 5220b568c5ad8d9ac97c0401453267491a378ef3    
  
author   : Etsuro Fujita <[email protected]>    
date     : Wed, 30 Aug 2023 17:15:01 +0900    
  
committer: Etsuro Fujita <[email protected]>    
date     : Wed, 30 Aug 2023 17:15:01 +0900    

Click here for diff

Commit e4106b252 should have updated this test, but did not; back-patch  
to all supported branches.  
  
Reviewed by Richard Guo.  
  
Discussion: http://postgr.es/m/CAPmGK15nR0NXLSCKQAcqbZbTzrzd5MozowWnTnGfPkayndF43Q%40mail.gmail.com  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/sql/postgres_fdw.sql

Avoid possible overflow with ltsGetFreeBlock() in logtape.c

commit   : 1d2939b6dc638f9b9f9e747bec478cb1a7a459b6    
  
author   : Michael Paquier <[email protected]>    
date     : Wed, 30 Aug 2023 08:03:48 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Wed, 30 Aug 2023 08:03:48 +0900    

Click here for diff

nFreeBlocks, defined as a long, stores the number of free blocks in a  
logical tape.  ltsGetFreeBlock() has been using an int to store the  
value of nFreeBlocks, which could lead to overflows on platforms where  
long and int are not the same size (in short everything except Windows  
where long is 4 bytes).  
  
The problematic intermediate variable is switched to be a long instead  
of an int.  
  
Issue introduced by c02fdc9223015, so backpatch down to 13.  
  
Author: Ranier vilela  
Reviewed-by: Peter Geoghegan, David Rowley  
Discussion: https://postgr.es/m/CAEudQApLDWCBR_xmwNjGBrDo+f+S4E87x3s7-+hoaKqYdtC4JQ@mail.gmail.com  
Backpatch-through: 13  

M src/backend/utils/sort/logtape.c

Rename logical_replication_mode to debug_logical_replication_streaming

commit   : 39d4207e876fa55971cd20a7677b78f067971fd3    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 29 Aug 2023 15:15:54 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 29 Aug 2023 15:15:54 +0200    

Click here for diff

The logical_replication_mode GUC is intended for testing and debugging  
purposes, but its current name may be misleading and encourage users to make  
unnecessary changes.  
  
To avoid confusion, renaming the GUC to a less misleading name  
debug_logical_replication_streaming that casual users are less likely to mistakenly  
assume needs to be modified in a regular logical replication setup.  
  
Author: Hou Zhijie <[email protected]>  
Reviewed-by: Peter Smith <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/d672d774-c44b-6fec-f993-793e744f169a%40eisentraut.org  

M doc/src/sgml/config.sgml
M doc/src/sgml/release-16.sgml
M src/backend/replication/logical/applyparallelworker.c
M src/backend/replication/logical/reorderbuffer.c
M src/backend/utils/misc/guc_tables.c
M src/include/replication/reorderbuffer.h
M src/test/subscription/t/015_stream.pl
M src/test/subscription/t/016_stream_subxact.pl
M src/test/subscription/t/018_stream_subxact_abort.pl
M src/test/subscription/t/019_stream_subxact_ddl_abort.pl
M src/test/subscription/t/023_twophase_stream.pl

Reword user-facing message for "power of two"

commit   : cd59fcff256d68e028bf8a181d4e166e81b6474b    
  
author   : Daniel Gustafsson <[email protected]>    
date     : Tue, 29 Aug 2023 14:27:40 +0200    
  
committer: Daniel Gustafsson <[email protected]>    
date     : Tue, 29 Aug 2023 14:27:40 +0200    

Click here for diff

While there are numerous instances of using "power of 2" in the code,  
translated user-facing messages use "power of two". Fix two instances  
which used "power of 2" instead.  
  
This is a backpatch of 95fff2abee in master.  
  
Author: Kyotaro Horiguchi <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: v16  

M src/bin/initdb/initdb.c
M src/bin/pg_resetwal/pg_resetwal.c

Initialize ListenSocket array earlier.

commit   : 5f38ff3d0f65b7d092362aaf7375cce050a13bba    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 29 Aug 2023 09:09:40 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 29 Aug 2023 09:09:40 +0300    

Click here for diff

After commit b0bea38705, syslogger prints 63 warnings about failing to  
close a listen socket at postmaster startup. That's because the  
syslogger process forks before the ListenSockets array is initialized,  
so ClosePostmasterPorts() calls "close(0)" 64 times. The first call  
succeeds, because fd 0 is stdin.  
  
This has been like this since commit 9a86f03b4e in version 13, which  
moved the SysLogger_Start() call to before initializing ListenSockets.  
We just didn't notice until commit b0bea38705 added the LOG message.  
  
Reported by Michael Paquier and Jeff Janes.  
  
Author: Michael Paquier  
Discussion: https://www.postgresql.org/message-id/ZOvvuQe0rdj2slA9%40paquier.xyz  
Discussion: https://www.postgresql.org/message-id/[email protected]#482670177eb4eaf4c9f03c1eed963e5f  
Backpatch-through: 13  

M src/backend/postmaster/postmaster.c

Stamp 16rc1.

commit   : d94dadcc5020f6746203896dba5a9627872ba2ee    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 28 Aug 2023 16:26:56 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 28 Aug 2023 16:26:56 -0400    

Click here for diff

M configure
M configure.ac
M meson.build

Translation updates

commit   : 66ed5a2e92d206ae95fa460d9e5648b636b8270a    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 28 Aug 2023 09:23:57 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 28 Aug 2023 09:23:57 +0200    

Click here for diff

Source-Git-URL: https://git.postgresql.org/git/pgtranslation/messages.git  
Source-Git-Hash: a58360c10bd5a0f0153fcf75d0b5291ac1acecb0  

M src/backend/po/LINGUAS
M src/backend/po/de.po
A src/backend/po/ka.po
M src/backend/po/sv.po
M src/backend/po/uk.po
M src/bin/initdb/po/pt_BR.po
M src/bin/pg_archivecleanup/po/pt_BR.po
M src/bin/pg_checksums/po/pt_BR.po
M src/bin/pg_controldata/po/pt_BR.po
M src/bin/pg_ctl/po/pt_BR.po
M src/bin/pg_dump/po/ka.po
M src/bin/pg_dump/po/sv.po
M src/bin/pg_resetwal/po/pt_BR.po
M src/bin/pg_upgrade/po/de.po
M src/bin/pg_upgrade/po/ka.po
M src/bin/pg_upgrade/po/sv.po
M src/bin/psql/po/ka.po
M src/bin/scripts/po/pt_BR.po

Update list of acknowledgments in release notes

commit   : ef0e7dbcbed403ba53a1d77faf96600785e57d7a    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 27 Aug 2023 20:30:53 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 27 Aug 2023 20:30:53 +0200    

Click here for diff

current through a842ba407c  

M doc/src/sgml/release-16.sgml

Remove incorrect name from release notes

commit   : 60d7d50f426b17b544fd8c24024d87ab8331984f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 27 Aug 2023 20:29:05 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 27 Aug 2023 20:29:05 +0200    

Click here for diff

This name was incorrect in the underlying commit message.  (The  
correct name is already listed.)  
  
Reported-by: Denis Laxalde <[email protected]>  

M doc/src/sgml/release-16.sgml

Remove incorrect/duplicate name from list of acknowledgments

commit   : 8d70eb731c43c4ccb5fa5642518a277ef3f6b860    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 27 Aug 2023 20:27:32 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 27 Aug 2023 20:27:32 +0200    

Click here for diff

Reported-by: Vik Fearing <[email protected]>  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes: fix initdb encoding/locale item

commit   : a842ba407c375b4088ee0fa569780b5328cdebe8    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 24 Aug 2023 21:44:31 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 24 Aug 2023 21:44:31 -0400    

Click here for diff

Reported-by: Jeff Davis  
  
Discussion:  https://postgr.es/m/[email protected]  
  
Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

pg_upgrade: Bump MESSAGE_WIDTH.

commit   : 2e7d15ab69d91abc874f6b5d89df4d7c5a4f2c17    
  
author   : Nathan Bossart <[email protected]>    
date     : Thu, 24 Aug 2023 10:13:31 -0700    
  
committer: Nathan Bossart <[email protected]>    
date     : Thu, 24 Aug 2023 10:13:31 -0700    

Click here for diff

Commit 7b378237aa added a status message to pg_upgrade that is 60  
characters wide.  Since the MESSAGE_WIDTH macro is currently set to  
60, there is no space between this new status message and the "ok"  
or "failed" indicator appended when the step completes.  To fix  
this problem, this commit increases the value of MESSAGE_WIDTH to  
62.  
  
Suggested-by: Bharath Rupireddy  
Reviewed-by: Peter Eisentraut  
Discussion: https://postgr.es/m/CALj2ACVVvk1cYLtWVxHv%3DZ1Ubq%3DUES9fhKbUU4c9k4W%2BfEDnbw%40mail.gmail.com  
Backpatch-through: 16  

M src/bin/pg_upgrade/pg_upgrade.h

Avoid unnecessary plancache revalidation of utility statements.

commit   : ba0d737caa44d322c709c4d64e95de86b126f3e4    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 24 Aug 2023 12:02:40 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 24 Aug 2023 12:02:40 -0400    

Click here for diff

Revalidation of a plancache entry (after a cache invalidation event)  
requires acquiring a snapshot.  Normally that is harmless, but not  
if the cached statement is one that needs to run without acquiring a  
snapshot.  We were already aware of that for TransactionStmts,  
but for some reason hadn't extrapolated to the other statements that  
PlannedStmtRequiresSnapshot() knows mustn't set a snapshot.  This can  
lead to unexpected failures of commands such as SET TRANSACTION  
ISOLATION LEVEL.  We can fix it in the same way, by excluding those  
command types from revalidation.  
  
However, we can do even better than that: there is no need to  
revalidate for any statement type for which parse analysis, rewrite,  
and plan steps do nothing interesting, which is nearly all utility  
commands.  To mechanize this, invent a parser function  
stmt_requires_parse_analysis() that tells whether parse analysis does  
anything beyond wrapping a CMD_UTILITY Query around the raw parse  
tree.  If that's what it does, then rewrite and plan will just  
skip the Query, so that it is not possible for the same raw parse  
tree to produce a different plan tree after cache invalidation.  
  
stmt_requires_parse_analysis() is basically equivalent to the  
existing function analyze_requires_snapshot(), except that for  
obscure reasons that function omits ReturnStmt and CallStmt.  
It is unclear whether those were oversights or intentional.  
I have not been able to demonstrate a bug from not acquiring a  
snapshot while analyzing these commands, but at best it seems mighty  
fragile.  It seems safer to acquire a snapshot for parse analysis of  
these commands too, which allows making stmt_requires_parse_analysis  
and analyze_requires_snapshot equivalent.  
  
In passing this fixes a second bug, which is that ResetPlanCache  
would exclude ReturnStmts and CallStmts from revalidation.  
That's surely *not* safe, since they contain parsable expressions.  
  
Per bug #18059 from Pavel Kulakov.  Back-patch to all supported  
branches.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/parser/analyze.c
M src/backend/utils/cache/plancache.c
M src/include/parser/analyze.h
M src/pl/plpgsql/src/expected/plpgsql_call.out
M src/pl/plpgsql/src/sql/plpgsql_call.sql

Fix lack of message pluralization

commit   : ce18252d0b48d206d42cfbe1028e48d776e01831    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 24 Aug 2023 14:22:02 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 24 Aug 2023 14:22:02 +0200    

Click here for diff

M src/backend/replication/slot.c

Update DECLARE_INDEX documentation

commit   : 4cdcff4d93b202fd30e6b3927874af9002247779    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 24 Aug 2023 13:59:40 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 24 Aug 2023 13:59:40 +0200    

Click here for diff

Update source code comment changes belonging to the changes in  
6a6389a08b.  
  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M src/include/catalog/genbki.h

Rename hook functions for debug_io_direct to match variable name.

commit   : 155c81463c26d908a1579b6d90e7b39b6f61df8b    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 22 Aug 2023 14:12:45 +0200    
  
committer: Thomas Munro <[email protected]>    
date     : Tue, 22 Aug 2023 14:12:45 +0200    

Click here for diff

Commit 319bae9a renamed the GUC.  Rename the check and assign functions  
to match, and alphabetize.  
  
Back-patch to 16.  
  
Author: Peter Eisentraut <[email protected]>  
Discussion: https://postgr.es/m/2769341e-fa28-c2ee-3e4b-53fdcaaf2271%40eisentraut.org  

M src/backend/storage/file/fd.c
M src/backend/utils/misc/guc_tables.c
M src/include/utils/guc_hooks.h

Fix the error message when failing to restore the snapshot.

commit   : 13e2665df3d01de5b0e039eb41b5e358e2b29ae5    
  
author   : Amit Kapila <[email protected]>    
date     : Thu, 24 Aug 2023 14:51:57 +0530    
  
committer: Amit Kapila <[email protected]>    
date     : Thu, 24 Aug 2023 14:51:57 +0530    

Click here for diff

The SnapBuildRestoreContents() used a const value in the error message to  
indicate the size in bytes it was expecting to read from the serialized  
snapshot file. Fix it by reporting the size that was actually passed.  
  
Author: Hou Zhijie  
Reviewed-by: Amit Kapila  
Backpatch-through: 16  
Discussion: http://postgr.es/m/OS0PR01MB5716D408364F7DF32221C08D941FA@OS0PR01MB5716.jpnprd01.prod.outlook.com  

M src/backend/replication/logical/snapbuild.c

Fix translation markers

commit   : 8179d1bdf7763bab8a55022268bcfada011e8a4f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 24 Aug 2023 10:24:38 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 24 Aug 2023 10:24:38 +0200    

Click here for diff

Conditionals cannot be inside gettext trigger functions, they must be  
applied outside.  

M src/backend/parser/parse_expr.c

pg_upgrade: Improve one log message

commit   : 8fa09a11c994b85a4f4e6c09c5465f561b17c22b    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 24 Aug 2023 08:23:43 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 24 Aug 2023 08:23:43 +0200    

Click here for diff

The parenthesized plural is unnecessary here and inconsistent with  
nearby similar messages.  

M src/bin/pg_upgrade/check.c

do: PG 16 relnotes: clarify last seq/index view names

commit   : 7d8e7036177a9fce94a6b99a5a12d65568556fde    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 23 Aug 2023 21:33:03 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 23 Aug 2023 21:33:03 -0400    

Click here for diff

Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

Meson: check for pg_config_paths.h left over from make

commit   : 5a16984ff1f3556f4bd29723e11d3594f41db90b    
  
author   : David Rowley <[email protected]>    
date     : Thu, 24 Aug 2023 10:33:48 +1200    
  
committer: David Rowley <[email protected]>    
date     : Thu, 24 Aug 2023 10:33:48 +1200    

Click here for diff

The meson build scripts attempt to find files left over from configure  
and fail, mentioning that "make maintainer-clean" should be run to remove  
these.  This seems to have been done for files generated from configure.  
pg_config_paths.h is generated during the actual make build, so seems to  
have been missed.  This would result in compilation using the wrong  
pg_config_paths.h file.  
  
Here we just add this file to generated_sources_ac so that meson errors  
out if pg_config_paths.h exists.  
  
Likely this wasn't noticed before because make maintainer-clean will  
remove pg_config_paths.h, however, people using the MSVC build scripts  
are more likely to run into issues and they have to manually remove  
these files and pg_config_paths.h wasn't listed as a conflicting file to  
remove in the meson log.  
  
Backpatch-through: 16, where meson support was added  
Discussion: https://postgr.es/m/CAApHDvqjYOxZfmLKAOWKFEE7LOr9_E6UA6YNmx9r8nxStcS3gg@mail.gmail.com  

M src/port/meson.build

ci: Make compute resources for CI configurable

commit   : e8a8cd05d4b9533cf5bff0f4a4ee83a40df62875    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 23 Aug 2023 15:15:28 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 23 Aug 2023 15:15:28 -0700    

Click here for diff

See prior commit for an explanation for the goal of the change and why it had  
to be split into two commits.  
  
Reviewed-by: Daniel Gustafsson <[email protected]>  
Reviewed-by: Nazir Bilal Yavuz <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Backpatch: 15-, where CI support was added  

M .cirrus.tasks.yml
A .cirrus.yml
M src/tools/ci/README

ci: Prepare to make compute resources for CI configurable

commit   : 9ed46c78a3625001a863bbcbfd5f1c696c1def46    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 23 Aug 2023 15:15:28 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 23 Aug 2023 15:15:28 -0700    

Click here for diff

cirrus-ci will soon restrict the amount of free resources every user gets (as  
have many other CI providers). For most users of CI that should not be an  
issue. But e.g. for cfbot it will be an issue.  
  
To allow configuring different resources on a per-repository basis, introduce  
infrastructure for overriding the task execution environment. Unfortunately  
this is not entirely trivial, as yaml anchors have to be defined before their  
use, and cirrus-ci only allows injecting additional contents at the end of  
.cirrus.yml.  
  
To deal with that, move the definition of the CI tasks to  
.cirrus.tasks.yml. The main .cirrus.yml is loaded first, then, if defined, the  
file referenced by the REPO_CI_CONFIG_GIT_URL variable, will be added,  
followed by the contents of .cirrus.tasks.yml. That allows  
REPO_CI_CONFIG_GIT_URL to override the yaml anchors defined in .cirrus.yml.  
  
Unfortunately git's default merge / rebase strategy does not handle copied  
files, just renamed ones. To avoid painful rebasing over this change, this  
commit just renames .cirrus.yml to .cirrus.tasks.yml, without adding a new  
.cirrus.yml. That's done in the followup commit, which moves the relevant  
portion of .cirrus.tasks.yml to .cirrus.yml.  Until that is done,  
REPO_CI_CONFIG_GIT_URL does not fully work.  
  
The subsequent commit adds documentation for how to configure custom compute  
resources to src/tools/ci/README  
  
Reviewed-by: Daniel Gustafsson <[email protected]>  
Reviewed-by: Nazir Bilal Yavuz <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Backpatch: 15-, where CI support was added  

A .cirrus.star
R100 .cirrus.yml .cirrus.tasks.yml

ci: Use VMs for SanityCheck and CompilerWarnings

commit   : f518c909ead1be7c88ee1f53db13bdef7c50d1ca    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 23 Aug 2023 12:29:50 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 23 Aug 2023 12:29:50 -0700    

Click here for diff

The main reason for this change is to reduce different ways of executing  
tasks, making it easier to use custom compute resources for cfbot. A secondary  
benefit is that the tasks seem slightly faster this way, apparently the  
increased startup overhead is outweighed by reduced runtime overhead.  
  
Reviewed-by: Daniel Gustafsson <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Backpatch: 15-, where CI support was added  

M .cirrus.yml

ci: Move execution method of tasks into yaml templates

commit   : cad461b044b521c5f80d180194d6e27dce82c424    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 23 Aug 2023 12:27:40 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 23 Aug 2023 12:27:40 -0700    

Click here for diff

This is done in preparation for making the compute resources for CI  
configurable. It also looks cleaner.  
  
Reviewed-by: Daniel Gustafsson <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Backpatch: 15-, where CI support was added  

M .cirrus.yml

ci: Don't specify amount of memory

commit   : 5581a9a3953020dd9df18ffd00b788f296bd60e0    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 23 Aug 2023 12:27:29 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 23 Aug 2023 12:27:29 -0700    

Click here for diff

The number of CPUs is the cost-determining factor. Most instance types that  
run tests have more memory/core than what we specified, there's no real  
benefit in wasting that.  
  
Reviewed-by: Daniel Gustafsson <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Backpatch: 15-, where CI support was added  

M .cirrus.yml

Fix _bt_allequalimage() call within critical section.

commit   : c3b874c431bc5d1399c011e9e5ce1e30b756f930    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Aug 2023 18:08:40 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Aug 2023 18:08:40 +0300    

Click here for diff

_bt_allequalimage() does complicated things, so it's not OK to call it  
in a critical section. Per buildfarm failure on 'prion', which uses  
-DRELCACHE_FORCE_RELEASE -DCATCACHE_FORCE_RELEASE options.  
  
Discussion: https://www.postgresql.org/message-id/[email protected]  
Backpatch-through: 16, like commit ccadf73163 that introduced this  

M src/backend/access/nbtree/nbtree.c

Use the buffer cache when initializing an unlogged index.

commit   : 6bc1fd4e60e9556ba5e04710049fdf42e3134f47    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Aug 2023 17:21:31 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 23 Aug 2023 17:21:31 +0300    

Click here for diff

Some of the ambuildempty functions used smgrwrite() directly, followed  
by smgrimmedsync(). A few small problems with that:  
  
Firstly, one is supposed to use smgrextend() when extending a  
relation, not smgrwrite(). It doesn't make much difference in  
production builds. smgrextend() updates the relation size cache, so  
you miss that, but that's harmless because we never use the cached  
relation size of an init fork. But if you compile with  
CHECK_WRITE_VS_EXTEND, you get an assertion failure.  
  
Secondly, the smgrwrite() calls were performed before WAL-logging, so  
the page image written to disk had 0/0 as the LSN, not the LSN of the  
WAL record. That's also harmless in practice, but seems sloppy.  
  
Thirdly, it's better to use the buffer cache, because then you don't  
need to smgrimmedsync() the relation to disk, which adds latency.  
Bypassing the cache makes sense for bulk operations like index  
creation, but not when you're just initializing an empty index.  
Creation of unlogged tables is hardly performance bottleneck in any  
real world applications, but nevertheless.  
  
Backpatch to v16, but no further. These issues should be harmless in  
practice, so better to not rock the boat in older branches.  
  
Reviewed-by: Robert Haas  
Discussion: https://www.postgresql.org/message-id/[email protected]  

M contrib/bloom/blinsert.c
M contrib/bloom/bloom.h
M contrib/bloom/blutils.c
M src/backend/access/nbtree/nbtree.c
M src/backend/access/spgist/spginsert.c

doc: Replace list of drivers and PLs with wiki link

commit   : 5fd424c87a86dd19d6cb15a18d1662ffc7368de1    
  
author   : Daniel Gustafsson <[email protected]>    
date     : Wed, 23 Aug 2023 14:13:07 +0200    
  
committer: Daniel Gustafsson <[email protected]>    
date     : Wed, 23 Aug 2023 14:13:07 +0200    

Click here for diff

The list of external language drivers and procedural languages was  
never complete or exhaustive, and rather than attempting to manage  
it the content has migrated to the wiki.  This replaces the tables  
altogether with links to the wiki as we regularly get requests for  
adding various projects,  which we reject without any clear policy  
for why or how the content should be managed.  
  
The threads linked to below are the most recent discussions about  
this, the archives contain many more.  
  
Backpatch to all supported branches since the list on the wiki  
applies to all branches.  
  
Author: Jonathan Katz <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: v11  

M doc/src/sgml/external-projects.sgml

doc: Add more ICU rules examples

commit   : 103df207a71e74d64173edcb7bacec872933755b    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 23 Aug 2023 11:23:42 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 23 Aug 2023 11:23:42 +0200    

Click here for diff

In particular, add an example EBCDIC collation.  
  
Author: Daniel Verite <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M doc/src/sgml/charset.sgml
M doc/src/sgml/ref/create_collation.sgml
M doc/src/sgml/ref/create_database.sgml

doc: Improve ICU external link

commit   : 0b9127de12daf4b6eb33766a592c38fda3853bff    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 23 Aug 2023 08:25:56 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 23 Aug 2023 08:25:56 +0200    

Click here for diff

It previously pointed to the collation API documentation, which our  
users don't need, but the containing chapter seems useful.  

M doc/src/sgml/charset.sgml

Improve vertical spacing of documentation markup

commit   : 6f168e077e4671ecc0796e9aeb7ad61fc3e5b6dd    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 23 Aug 2023 08:12:50 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 23 Aug 2023 08:12:50 +0200    

Click here for diff

M doc/src/sgml/charset.sgml

ExtendBufferedWhat -> BufferManagerRelation.

commit   : f58af9f416f95b1b396aab55c5978f277fe13ac7    
  
author   : Thomas Munro <[email protected]>    
date     : Wed, 23 Aug 2023 12:10:18 +1200    
  
committer: Thomas Munro <[email protected]>    
date     : Wed, 23 Aug 2023 12:10:18 +1200    

Click here for diff

Commit 31966b15 invented a way for functions dealing with relation  
extension to accept a Relation in online code and an SMgrRelation in  
recovery code.  It seems highly likely that future bufmgr.c interfaces  
will face the same problem, and need to do something similar.  
Generalize the names so that each interface doesn't have to re-invent  
the wheel.  
  
Back-patch to 16.  Since extension AM authors might start using the  
constructor macros once 16 ships, we agreed to do the rename in 16  
rather than waiting for 17.  
  
Reviewed-by: Peter Geoghegan <[email protected]>  
Reviewed-by: Andres Freund <[email protected]>  
Discussion: https://postgr.es/m/CA%2BhUKG%2B6tLD2BhpRWycEoti6LVLyQq457UL4ticP5xd8LqHySA%40mail.gmail.com  

M contrib/bloom/blutils.c
M src/backend/access/brin/brin.c
M src/backend/access/brin/brin_revmap.c
M src/backend/access/gin/gininsert.c
M src/backend/access/gin/ginutil.c
M src/backend/access/gist/gist.c
M src/backend/access/gist/gistutil.c
M src/backend/access/hash/hashpage.c
M src/backend/access/heap/hio.c
M src/backend/access/heap/visibilitymap.c
M src/backend/access/nbtree/nbtpage.c
M src/backend/access/spgist/spgutils.c
M src/backend/access/transam/xlogutils.c
M src/backend/commands/sequence.c
M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/buffer/localbuf.c
M src/backend/storage/freespace/freespace.c
M src/include/storage/buf_internals.h
M src/include/storage/bufmgr.h
M src/tools/pgindent/typedefs.list

doc: PG 16 relnotes: properly indent and word-wrap text

commit   : d8cd49e992eb0d0f3d447d6b41866ce1b573b01d    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 22 Aug 2023 19:37:26 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 22 Aug 2023 19:37:26 -0400    

Click here for diff

Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

Fix pg_dump assertion failure when dumping pg_catalog.

commit   : 501704e826fc75d7d1c8976a8d177f8ce3ea0b4c    
  
author   : Jeff Davis <[email protected]>    
date     : Tue, 22 Aug 2023 11:21:36 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Tue, 22 Aug 2023 11:21:36 -0700    

Click here for diff

Commit 396d348b04 did not account for the default collation.  
  
Also, use pg_log_warning() instead of Assert().  
  
Discussion: https://postgr.es/m/ce071503fee88334aa70f360e6e4ea14d48305ee.camel%40j-davis.com  
Reviewed-by: Michael Paquier  
Backpatch-through: 15  

M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/t/002_pg_dump.pl

Cache by-reference missing values in a long lived context

commit   : f938acd68b08704a086b5f41eaf1989026d6f013    
  
author   : Andrew Dunstan <[email protected]>    
date     : Tue, 22 Aug 2023 11:57:08 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Tue, 22 Aug 2023 11:57:08 -0400    

Click here for diff

Attribute missing values might be needed past the lifetime of the tuple  
descriptors from which they are extracted. To avoid possibly using  
pointers for by-reference values which might thus be left dangling, we  
cache a datumCopy'd version of the datum in the TopMemoryContext. Since  
we first search for the value this only needs to be done once per  
session for any such value.  
  
Original complaint from Tom Lane, idea for mitigation by Andrew Dunstan,  
tweaked by Tom Lane.  
  
Backpatch to version 11 where missing values were introduced.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/access/common/heaptuple.c
M src/tools/pgindent/typedefs.list

doc: PG 16 relnotes: separate out psql \drg item

commit   : e9f535463a12af2d4e7973dbf1db53c7097df31b    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 22 Aug 2023 15:15:24 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 22 Aug 2023 15:15:24 -0400    

Click here for diff

Reported-by: Pavel Luzanov  
  
Discussion: https://postgr.es/m/[email protected]  
  
Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

Add list of acknowledgments to release notes

commit   : 8c76a556658ddb56e33be5507131874776c00907    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 22 Aug 2023 10:54:16 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 22 Aug 2023 10:54:16 +0200    

Click here for diff

This contains all individuals mentioned in the commit messages during  
PostgreSQL 16 development.  
  
current through REL_16_BETA3  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes: adjust RANGE/ROWS window item

commit   : 7fb906d80aa07cd83ada2a60588679e68f635939    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 21 Aug 2023 18:55:41 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 21 Aug 2023 18:55:41 -0400    

Click here for diff

Reported-by: Erwin Brandstetter  
  
Discussion: https://postgr.es/m/CAGHENJ5Cj3wBH07YM5Lw2h5q8s65cNg_NEdkkWvmRo+vOormWw@mail.gmail.com  
  
Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes: move role INHERIT item and clarify it

commit   : 00be0bc3d57f1b01249429bc0a154ecb41e02e7f    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 21 Aug 2023 17:54:29 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 21 Aug 2023 17:54:29 -0400    

Click here for diff

Also split out new role ADMIN syntax entry.  
  
Reported-by: Pavel Luzanov  
  
Discussion: https://postgr.es/m/[email protected]  
  
Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

Fix pg_stat_reset_single_table_counters() for shared relations

commit   : d6af45052dc8a9d97a18e1a3b9febabd891ba270    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 21 Aug 2023 13:33:04 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 21 Aug 2023 13:33:04 +0900    

Click here for diff

This commit fixes the function of $subject for shared relations.  This  
feature has been added by e042678.  Unfortunately, this new behavior got  
removed by 5891c7a when moving statistics to shared memory.  
  
Reported-by: Mitsuru Hinata  
Author: Masahiro Ikeda  
Reviewed-by: Kyotaro Horiguchi, Masahiko Sawada  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 15  

M src/backend/utils/adt/pgstatfuncs.c
M src/test/regress/expected/stats.out
M src/test/regress/sql/stats.sql

ci: macos: use cached macports install

commit   : dd2a731d9caffa8c9f6d82f2b72dd460b67decd7    
  
author   : Andres Freund <[email protected]>    
date     : Sat, 19 Aug 2023 12:40:45 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Sat, 19 Aug 2023 12:40:45 -0700    

Click here for diff

A significant chunk of the time on the macos CI task is spent installing  
packages using homebrew. The downloads of the packages are cached, but the  
installation needs to happen every time. We can't cache the whole homebrew  
installation, because it is too large due to pre-installed packages.  
  
Speed this up by installing packages using macports and caching the  
installation as .dmg. That's a lot faster than unpacking a tarball.  
  
In addition, don't install llvm - it wasn't enabled when building, so it's  
just a waste of time/space.  
  
This substantially speeds up the mac CI time, both in the cold cache and in  
the warm cache case (the latter from ~1m20s to ~5s).  
  
It doesn't seem great to have diverging sources of packages for CI between  
branches, so backpatch to 15 (where CI was added).  
  
Discussion: https://postgr.es/m/[email protected]  
Backpatch: 15-, where CI was added  

M .cirrus.yml
A src/tools/ci/ci_macports_packages.sh

Remove dubious warning message from SQL/JSON functions

commit   : dcfc49c1b652dfe41273579aeaf6b454c51f037b    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 18 Aug 2023 07:41:14 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 18 Aug 2023 07:41:14 +0200    

Click here for diff

There was a warning that FORMAT JSON has no effect on json/jsonb  
types, which is true, but it's not clear why we should issue a warning  
about it.  The SQL standard does not say anything about this, which  
should generally govern the behavior here.  So remove it.  
  
Discussion: https://www.postgresql.org/message-id/flat/dfec2cae-d17e-c508-6d16-c2dba82db486%40eisentraut.org  

M src/backend/parser/parse_expr.c
M src/test/regress/expected/sqljson.out

Invalidate smgr_targblock in smgrrelease().

commit   : 6337e994e89797d60b68ac6786c6a322ac00a382    
  
author   : Thomas Munro <[email protected]>    
date     : Thu, 17 Aug 2023 15:45:13 +1200    
  
committer: Thomas Munro <[email protected]>    
date     : Thu, 17 Aug 2023 15:45:13 +1200    

Click here for diff

In rare circumstances involving relfilenode reuse, it might have been  
possible for smgr_targblock to finish up pointing past the end.  
  
Oversight in b74e94dc.  Back-patch to 15.  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Discussion: https://postgr.es/m/CA%2BhUKGJ8NTvqLHz6dqbQnt2c8XCki4r2QvXjBQcXpVwxTY_pvA%40mail.gmail.com  

M src/backend/storage/smgr/smgr.c

commit   : 11f4935490eb8597fcc0e3e71c2caf90e6154943    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 16 Aug 2023 22:22:12 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 16 Aug 2023 22:22:12 -0400    

Click here for diff

Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, initial markup

commit   : 6b86a3e0b421a0e0c9cfa02ddc0525e431379ee4    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 16 Aug 2023 14:34:49 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 16 Aug 2023 14:34:49 -0400    

Click here for diff

Still need to add links to doc sections.  
  
Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

Unify some error messages

commit   : c672262779833a6b58cf5a4e85a9b76efd660cb7    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 16 Aug 2023 16:17:00 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 16 Aug 2023 16:17:00 +0200    

Click here for diff

We had essentially the same error in several different wordings.  
Unify that.  

M src/backend/utils/adt/json.c
M src/backend/utils/adt/jsonb_util.c
M src/interfaces/ecpg/test/expected/sql-sqljson.stderr
M src/test/regress/expected/sqljson.out

Improved CREATE SUBSCRIPTION message for clarity

commit   : 842b65905046be8a979a67484c9fd4110e4e2dfe    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 16 Aug 2023 15:09:50 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 16 Aug 2023 15:09:50 +0200    

Click here for diff

Discussion: https://www.postgresql.org/message-id/CAHut+PtfzQ7JRkb0-Y_UejAxaLQ17-bGMvV4MJJHcPoP3ML2bg@mail.gmail.com  

M src/backend/commands/subscriptioncmds.c

doc: PG 16 relnotes, update "current as of" date

commit   : c5c8bd29b9a22a05f81857c6921c0bc615140cc5    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 15 Aug 2023 09:15:21 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 15 Aug 2023 09:15:21 -0400    

Click here for diff

Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

De-pessimize ConditionVariableCancelSleep().

commit   : acc5c4fd8f83e5991cab11d7299d112e89cb3fe7    
  
author   : Thomas Munro <[email protected]>    
date     : Tue, 15 Aug 2023 10:20:11 +1200    
  
committer: Thomas Munro <[email protected]>    
date     : Tue, 15 Aug 2023 10:20:11 +1200    

Click here for diff

Commit b91dd9de was concerned with a theoretical problem with our  
non-atomic condition variable operations.  If you stop sleeping, and  
then cancel the sleep in a separate step, you might be signaled in  
between, and that could be lost.  That doesn't matter for callers of  
ConditionVariableBroadcast(), but callers of ConditionVariableSignal()  
might be upset if a signal went missing like this.  
  
Commit bc971f4025c interacted badly with that logic, because it doesn't  
use ConditionVariableSleep(), which would normally put us back in the  
wait list.  ConditionVariableCancelSleep() would be confused and think  
we'd received an extra signal, and try to forward it to another backend,  
resulting in wakeup storms.  
  
New idea: ConditionVariableCancelSleep() can just return true if we've  
been signaled.  Hypothetical users of ConditionVariableSignal() would  
then still have a way to deal with rare lost signals if they are  
concerned about that problem.  
  
Back-patch to 16, where bc971f4025c arrived.  
  
Reported-by: Tomas Vondra <[email protected]>  
Reviewed-by: Andres Freund <[email protected]>  
Discussion: https://postgr.es/m/2840876b-4cfe-240f-0a7e-29ffd66711e7%40enterprisedb.com  

M src/backend/storage/lmgr/condition_variable.c
M src/include/storage/condition_variable.h

doc: PG 16 relnotes: udpate for commits since branching

commit   : 03fb43f6ed63fd2d52bf8ec305893a31ef0a38e5    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 14 Aug 2023 17:28:39 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 14 Aug 2023 17:28:39 -0400    

Click here for diff

Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

hio: Take number of prior relation extensions into account

commit   : d37ab378b6e773c278c14b9554a1ea23b355aab9    
  
author   : Andres Freund <[email protected]>    
date     : Mon, 14 Aug 2023 09:54:03 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Mon, 14 Aug 2023 09:54:03 -0700    

Click here for diff

The new relation extension logic, introduced in 00d1e02be24, could lead to  
slowdowns in some scenarios. E.g., when loading narrow rows into a table using  
COPY, the caller of RelationGetBufferForTuple() will only request a small  
number of pages. Without concurrency, we just extended using pwritev() in that  
case. However, if there is *some* concurrency, we switched between extending  
by a small number of pages and a larger number of pages, depending on the  
number of waiters for the relation extension logic.  However, some  
filesystems, XFS in particular, do not perform well when switching between  
extending files using fallocate() and pwritev().  
  
To avoid that issue, remember the number of prior relation extensions in  
BulkInsertState and extend more aggressively if there were prior relation  
extensions. That not just avoids the aforementioned slowdown, but also leads  
to noticeable performance gains in other situations, primarily due to  
extending more aggressively when there is no concurrency. I should have done  
it this way from the get go.  
  
Reported-by: Masahiko Sawada <[email protected]>  
Author: Andres Freund <[email protected]>  
Discussion: https://postgr.es/m/CAD21AoDvDmUQeJtZrau1ovnT_smN940=Kp6mszNGK3bq9yRN6g@mail.gmail.com  
Backpatch: 16-, where the new relation extension code was added  

M src/backend/access/heap/heapam.c
M src/backend/access/heap/hio.c
M src/include/access/hio.h

ci: macos: Remove use of -Dsegsize_blocks=6

commit   : 2243ef8dd6fbe1f4ae3ffc7db1ee9af9427ecadb    
  
author   : Andres Freund <[email protected]>    
date     : Sat, 12 Aug 2023 13:09:45 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Sat, 12 Aug 2023 13:09:45 -0700    

Click here for diff

The option causes a measurable slowdown. Macos is, by far, the most expensive  
platform for CI, therefore it doesn't make sense to run such a test there.  
  
d3b111e3205 used a small segment size for two tasks, one with autoconf, one  
with meson. In hindsight that is a bit overkill, it's unlikely that the option  
would silently break. Thus don't move the -Dsegsize_blocks=6, just remove  
it. I did however change the autoconf test to use 6 instead of 8 blocks, as  
long as we allow it, a non-power-of-two test seems like a good idea.  
  
While at it, add a comment explaining why we use a small segment size for CI.  
  
Author: Andres Freund <[email protected]>  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Backpatch: 16-, where d3b111e3205 introduced the use of -Dsegsize_blocks=6  

M .cirrus.yml

ci: macos: Remove use of -DRANDOMIZE_ALLOCATED_MEMORY

commit   : 4bec616f26f5f39a6819804f2b7992495a1a7a6f    
  
author   : Andres Freund <[email protected]>    
date     : Sat, 12 Aug 2023 13:06:04 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Sat, 12 Aug 2023 13:06:04 -0700    

Click here for diff

RANDOMIZE_ALLOCATED_MEMORY causes a measurable slowdown. Macos is, by far, the  
most expensive platform for CI, therefore it doesn't make sense to run such a  
test there.  
  
Ubsan and asan on linux should detect most of the the cases of uninitialized  
memory, so it doesn't really seem worth using -DRANDOMIZE_ALLOCATED_MEMORY in  
another instance type.  
  
Author: Andres Freund <[email protected]>  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Backpatch: 16-, where 89d16b635 added the use of -DRANDOMIZE_ALLOCATED_MEMORY  

M .cirrus.yml

Fix off-by-one in XLogRecordMaxSize check.

commit   : 7823a298ba5c54a67f98c928f73500bc4089449f    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 12 Aug 2023 14:37:05 -0700    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 12 Aug 2023 14:37:05 -0700    

Click here for diff

pg_logical_emit_message(false, '_', repeat('x', 1069547465)) failed with  
self-contradictory message "WAL record would be 1069547520 bytes (of  
maximum 1069547520 bytes)".  There's no particular benefit from allowing  
or denying one byte in either direction; XLogRecordMaxSize could rise a  
few megabytes without trouble.  Hence, this is just for cleanliness.  
Back-patch to v16, where this check first appeared.  

M src/backend/access/transam/xloginsert.c

Remove test from commit fa2e874946.

commit   : 7bed93a469bfa6954ce937b72ef1dc76fda7159e    
  
author   : Jeff Davis <[email protected]>    
date     : Thu, 10 Aug 2023 10:16:59 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Thu, 10 Aug 2023 10:16:59 -0700    

Click here for diff

The fix itself is fine, but the test revealed other problems related  
to parallel query that are not easily fixable. Remove the test for  
now to fix the buildfarm.  
  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 11  

D src/test/isolation/expected/search-path-inval.out
M src/test/isolation/isolation_schedule
D src/test/isolation/specs/search-path-inval.spec

Document RelationGetIndexAttrBitmap better

commit   : 1b594a326a88bf1604360daa5a274096c0762fec    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 10 Aug 2023 12:04:07 +0200    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 10 Aug 2023 12:04:07 +0200    

Click here for diff

Commit 19d8e2308bc5 changed the list of set-of-columns that can be  
returned by RelationGetIndexAttrBitmap, but didn't update its  
"documentation".  That was pretty hard to read already, so rewrite to  
make it more comprehensible, adding the missing values while at it.  
  
Backpatch to 16, like that commit.  
  
Discussion: https://postgr.es/m/[email protected]  
Reviewed-by: Tomas Vondra <[email protected]>  

M src/backend/utils/cache/relcache.c
M src/include/utils/relcache.h

doc: PG 16 relnotes, mark current as of 2023-08-09

commit   : c8c033f721de1e25c90acf146fabee77c9dbf92e    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 22:09:17 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 22:09:17 -0400    

Click here for diff

Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, move createuser and SCM items

commit   : fc3e21282fae2b5b44c59e56e1fc4958915bd817    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 20:48:31 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 20:48:31 -0400    

Click here for diff

Reported-by: Noah Misch  
  
Discussion: https://postgr.es/m/[email protected]  
  
Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, small wording improvement

commit   : 0752461d3a1114d560225fae7522dde0ab544b63    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 20:37:41 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 20:37:41 -0400    

Click here for diff

Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, merge and adjust CREATEROLE items

commit   : 6e1d1c58488e685370de0becc5a81d6502a8e099    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 18:01:50 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 18:01:50 -0400    

Click here for diff

Reported-by: Noah Misch  
  
Discussion: https://postgr.es/m/[email protected]  
  
Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, add Windows 10 huge pages fix

commit   : 89cadf30c605d509f12b0b7f80119cbba38efc6e    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 17:47:03 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 17:47:03 -0400    

Click here for diff

Reported-by: Michael Paquier  
  
Discussion: https://postgr.es/m/ZL0M28/[email protected]  
  
Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

Recalculate search_path after ALTER ROLE.

commit   : 0d56c32c8e724f96f4aa5b15645d427f6e2ddf21    
  
author   : Jeff Davis <[email protected]>    
date     : Mon, 7 Aug 2023 15:13:06 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Mon, 7 Aug 2023 15:13:06 -0700    

Click here for diff

Renaming a role can affect the meaning of the special string $user, so  
must cause search_path to be recalculated.  
  
Discussion: https://postgr.es/m/[email protected]  
Reviewed-by: Nathan Bossart, Michael Paquier  
Backpatch-through: 11  

M src/backend/catalog/namespace.c
A src/test/isolation/expected/search-path-inval.out
M src/test/isolation/isolation_schedule
A src/test/isolation/specs/search-path-inval.spec

doc: PG 16 relnotes, fix various typos

commit   : e90308ae6b4a468d089733cc6f650bda144c01cc    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 13:56:26 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 13:56:26 -0400    

Click here for diff

Reported-by: Erik Rijkers  
  
Discussion: https://postgr.es/m/[email protected]  
  
Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, adjust \ef+ body comment to mention \sf

commit   : 98cb73f5c98de86e85a90c06babdd7b1a37540db    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 13:23:39 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 13:23:39 -0400    

Click here for diff

Reported-by: Laurenz Albe  
  
Discussion: https://postgr.es/m/[email protected]  
  
Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, remove MAINTAIN item

commit   : 86415153f47a4ad8e332262592e0a32f14f226c6    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 11:16:26 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 9 Aug 2023 11:16:26 -0400    

Click here for diff

Feature was removed by commit 957445996f.  
  
Discussion: 957445996f  
  
Backpatch-through: 16  

M doc/src/sgml/release-16.sgml

Stamp 16beta3.

commit   : 0dd5545378d79bc0080dd34824f428458cf7448d    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 7 Aug 2023 16:05:20 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 7 Aug 2023 16:05:20 -0400    

Click here for diff

M configure
M configure.ac
M meson.build

Reject substituting extension schemas or owners matching ["$'\].

commit   : f53511010b72d7d314e22be7c63ef94792fee345    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 7 Aug 2023 06:05:56 -0700    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 7 Aug 2023 06:05:56 -0700    

Click here for diff

Substituting such values in extension scripts facilitated SQL injection  
when @extowner@, @extschema@, or @extschema:...@ appeared inside a  
quoting construct (dollar quoting, '', or "").  No bundled extension was  
vulnerable.  Vulnerable uses do appear in a documentation example and in  
non-bundled extensions.  Hence, the attack prerequisite was an  
administrator having installed files of a vulnerable, trusted,  
non-bundled extension.  Subject to that prerequisite, this enabled an  
attacker having database-level CREATE privilege to execute arbitrary  
code as the bootstrap superuser.  By blocking this attack in the core  
server, there's no need to modify individual extensions.  Back-patch to  
v11 (all supported versions).  
  
Reported by Micah Gate, Valerie Woolard, Tim Carey-Smith, and Christoph  
Berg.  
  
Security: CVE-2023-39417  

M src/backend/commands/extension.c
M src/test/modules/test_extensions/Makefile
M src/test/modules/test_extensions/expected/test_extensions.out
M src/test/modules/test_extensions/meson.build
M src/test/modules/test_extensions/sql/test_extensions.sql
A src/test/modules/test_extensions/test_ext_extschema–1.0.sql
A src/test/modules/test_extensions/test_ext_extschema.control

Translation updates

commit   : e8386b2cef7741aa4e49870691d67f792d5f6789    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 7 Aug 2023 12:06:49 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 7 Aug 2023 12:06:49 +0200    

Click here for diff

Source-Git-URL: https://git.postgresql.org/git/pgtranslation/messages.git  
Source-Git-Hash: 97398d714ace69f0c919984e160f429b6fd2300e  

M src/backend/po/de.po
M src/backend/po/fr.po
M src/backend/po/ja.po
M src/backend/po/sv.po
M src/bin/initdb/po/fr.po
M src/bin/initdb/po/ja.po
M src/bin/initdb/po/ka.po
M src/bin/initdb/po/sv.po
M src/bin/pg_archivecleanup/po/ja.po
M src/bin/pg_basebackup/po/fr.po
M src/bin/pg_basebackup/po/ka.po
M src/bin/pg_basebackup/po/sv.po
M src/bin/pg_config/po/fr.po
M src/bin/pg_config/po/sv.po
M src/bin/pg_ctl/po/fr.po
M src/bin/pg_ctl/po/sv.po
M src/bin/pg_dump/po/fr.po
M src/bin/pg_dump/po/ka.po
M src/bin/pg_dump/po/sv.po
M src/bin/pg_rewind/po/fr.po
M src/bin/pg_rewind/po/ka.po
M src/bin/pg_rewind/po/sv.po
M src/bin/pg_upgrade/po/fr.po
M src/bin/pg_upgrade/po/ka.po
M src/bin/pg_upgrade/po/sv.po
M src/bin/pg_verifybackup/po/fr.po
M src/bin/pg_verifybackup/po/sv.po
M src/bin/pg_waldump/po/fr.po
M src/bin/pg_waldump/po/sv.po
M src/bin/psql/po/de.po
M src/bin/psql/po/fr.po
M src/bin/psql/po/ja.po
M src/bin/psql/po/ka.po
M src/bin/psql/po/sv.po
M src/bin/scripts/po/fr.po
M src/bin/scripts/po/ka.po
M src/bin/scripts/po/sv.po
M src/interfaces/libpq/po/fr.po
M src/interfaces/libpq/po/ka.po
M src/interfaces/libpq/po/sv.po
M src/pl/plpython/po/fr.po
M src/pl/plpython/po/ka.po
M src/pl/plpython/po/sv.po

Don't Memoize lateral joins with volatile join conditions

commit   : ae89129aa3555c263b8c3ccc4c0f1ef7e46201aa    
  
author   : David Rowley <[email protected]>    
date     : Mon, 7 Aug 2023 22:14:54 +1200    
  
committer: David Rowley <[email protected]>    
date     : Mon, 7 Aug 2023 22:14:54 +1200    

Click here for diff

The use of Memoize was already disabled in normal joins when the join  
conditions had volatile functions per the code in  
match_opclause_to_indexcol().  Ordinarily, the parameterization for the  
inner side of a nested loop will be an Index Scan or at least eventually  
lead to an index scan (perhaps nested several joins deep). However, for  
lateral joins, that's not the case and seq scans can be parameterized  
too, so we can't rely on match_opclause_to_indexcol().  
  
Here we explicitly check the parameterization for volatile functions and  
don't consider the generation of a Memoize path when such functions  
are present.  
  
Author: Richard Guo  
Discussion: https://postgr.es/m/CAMbWs49nHFnHbpepLsv_yF3qkpCS4BdB-v8HoJVv8_=Oat0u_w@mail.gmail.com  
Backpatch-through: 14, where Memoize was introduced  

M src/backend/optimizer/path/joinpath.c

Fix RLS policy usage in MERGE.

commit   : 67a007dc0cdb8578726c2000a7abc513109cb4a2    
  
author   : Dean Rasheed <[email protected]>    
date     : Mon, 7 Aug 2023 09:27:09 +0100    
  
committer: Dean Rasheed <[email protected]>    
date     : Mon, 7 Aug 2023 09:27:09 +0100    

Click here for diff

If MERGE executes an UPDATE action on a table with row-level security,  
the code incorrectly applied the WITH CHECK clauses from the target  
table's INSERT policies to new rows, instead of the clauses from the  
table's UPDATE policies. In addition, it failed to check new rows  
against the target table's SELECT policies, if SELECT permissions were  
required (likely to always be the case).  
  
In addition, if MERGE executes a DO NOTHING action for matched rows,  
the code incorrectly applied the USING clauses from the target table's  
DELETE policies to existing target tuples. These policies were applied  
as checks that would throw an error, if they did not pass.  
  
Fix this, so that a MERGE UPDATE action applies the same RLS policies  
as a plain UPDATE query with a WHERE clause, and a DO NOTHING action  
does not apply any RLS checks (other than adding clauses from SELECT  
policies to the join).  
  
Back-patch to v15, where MERGE was introduced.  
  
Dean Rasheed, reviewed by Stephen Frost.  
  
Security: CVE-2023-39418  

M src/backend/executor/nodeModifyTable.c
M src/backend/rewrite/rowsecurity.c
M src/test/regress/expected/rowsecurity.out
M src/test/regress/sql/rowsecurity.sql

Doc: update documentation for creating custom scan paths.

commit   : f0a3805d7c44ed1c01668061bc2f6458e7b1369a    
  
author   : Etsuro Fujita <[email protected]>    
date     : Thu, 3 Aug 2023 17:45:01 +0900    
  
committer: Etsuro Fujita <[email protected]>    
date     : Thu, 3 Aug 2023 17:45:01 +0900    

Click here for diff

Commit f49842d1e added a new callback for custom scan paths, but missed  
updating the documentation.  
  
Back-patch to all supported branches.  
  
Discussion: https://postgr.es/m/CAPmGK15ODkN%2B%3DhkBCufj1HBW0x5OTb65Xuy7ryXchMdiCMpx_g%40mail.gmail.com  

M doc/src/sgml/custom-scan.sgml

Update comments on CustomPath struct.

commit   : c575e00230ed1262edb7845e2e9a22ec164bf9f0    
  
author   : Etsuro Fujita <[email protected]>    
date     : Thu, 3 Aug 2023 17:15:01 +0900    
  
committer: Etsuro Fujita <[email protected]>    
date     : Thu, 3 Aug 2023 17:15:01 +0900    

Click here for diff

Commit e7cb7ee14 allowed custom scan providers to create CustomPath  
paths for join relations as well, but missed updating the comments.  
  
Back-patch to all supported branches.  
  
Discussion: https://postgr.es/m/CAPmGK15ODkN%2B%3DhkBCufj1HBW0x5OTb65Xuy7ryXchMdiCMpx_g%40mail.gmail.com  

M src/include/nodes/pathnodes.h

Fix ReorderBufferCheckMemoryLimit() comment.

commit   : 5c0fcef76a44bb834d4d13685b877e62409e6984    
  
author   : Masahiko Sawada <[email protected]>    
date     : Wed, 2 Aug 2023 15:01:10 +0900    
  
committer: Masahiko Sawada <[email protected]>    
date     : Wed, 2 Aug 2023 15:01:10 +0900    

Click here for diff

Commit 7259736a6 updated the comment but it was not correct since  
ReorderBufferLargestStreamableTopTXN() returns only top-level  
transactions.  
  
Reviewed-by: Amit Kapila  
Discussion: https://postgr.es/m/CAD21AoA9XB7OR86BqvrCe2dMYX%2BZv3-BvVmjF%3DGY2z6jN-kqjg%40mail.gmail.com  
Backpatch-through: 14  

M src/backend/replication/logical/reorderbuffer.c

Fix pg_stat_io buffer reuse test instability

commit   : 803660ea4c5d9d2b3c7e1b0a9fc4b99359ba0a85    
  
author   : Andres Freund <[email protected]>    
date     : Tue, 1 Aug 2023 11:22:03 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Tue, 1 Aug 2023 11:22:03 -0700    

Click here for diff

The stats regression test attempts to ensure that Buffer Access Strategy  
"reuses" are being counted in pg_stat_io by vacuuming a table which is larger  
than the size of the strategy ring. However, when shared buffers are in  
sufficiently high demand, another backend could evict one of the blocks in the  
strategy ring before the first backend has a chance to reuse the buffer. The  
backend using the strategy would then evict another shared buffer and add that  
buffer to the strategy ring. This counts as an eviction and not a reuse in  
pg_stat_io. Count both evictions and reuses in the test to ensure it does not  
fail incorrectly.  
  
Reported-by: Jeff Davis <[email protected]>,  
Author: Melanie Plageman <[email protected]>  
Reviewed-by: Alexander Lakhin <[email protected]>  
Reviewed-by: Masahiko Sawada <[email protected]>  
Discussion: https://postgr.es/m/CAAKRu_bNG27AxG9TdPtwsL6wg8AWbVckjmTL2t1HF=miDQuNtw@mail.gmail.com  

M src/test/regress/expected/stats.out
M src/test/regress/sql/stats.sql

Fix performance regression in pg_strtointNN_safe functions

commit   : 4e2e75cd29eb7bc591afe30fd7425629fe2c5a5d    
  
author   : David Rowley <[email protected]>    
date     : Wed, 2 Aug 2023 12:06:08 +1200    
  
committer: David Rowley <[email protected]>    
date     : Wed, 2 Aug 2023 12:06:08 +1200    

Click here for diff

Between 6fcda9aba and 1b6f632a3, the pg_strtoint functions became quite  
a bit slower in v16, despite efforts in 6b423ec67 to speed these up.  
  
Since the majority of cases for these functions will only contain  
base-10 digits, perhaps prefixed by a '-', it makes sense to have a  
special case for this and just fall back on the more complex version  
which processes hex, octal, binary and underscores if the fast path  
version fails to parse the string.  
  
While we're here, update the header comments for these functions to  
mention that hex, octal and binary formats along with underscore  
separators are now supported.  
  
Author: Andres Freund, David Rowley  
Reported-by: Masahiko Sawada  
Reviewed-by: Dean Rasheed, John Naylor  
Discussion: https://postgr.es/m/CAD21AoDvDmUQeJtZrau1ovnT_smN940%3DKp6mszNGK3bq9yRN6g%40mail.gmail.com  
Backpatch-through: 16, where 6fcda9aba and 1b6f632a3 were added  

M src/backend/utils/adt/numutils.c

Fix overly strict Assert in jsonpath code

commit   : b25acc302524cf61bee46e1aad5bebb276449270    
  
author   : David Rowley <[email protected]>    
date     : Wed, 2 Aug 2023 01:40:27 +1200    
  
committer: David Rowley <[email protected]>    
date     : Wed, 2 Aug 2023 01:40:27 +1200    

Click here for diff

This was failing for queries which try to get the .type() of a  
jpiLikeRegex.  For example:  
  
select jsonb_path_query('["string", "string"]',  
                        '($[0] like_regex ".{7}").type()');  
  
Reported-by: Alexander Kozhemyakin  
Bug: #18035  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 12, where SQL/JSON path was added.  

M src/backend/utils/adt/jsonpath.c

Disallow replacing joins with scans in problematic cases.

commit   : 695f5deb7902865901eb2d50a70523af655c3a00    
  
author   : Etsuro Fujita <[email protected]>    
date     : Fri, 28 Jul 2023 15:45:01 +0900    
  
committer: Etsuro Fujita <[email protected]>    
date     : Fri, 28 Jul 2023 15:45:01 +0900    

Click here for diff

Commit e7cb7ee14, which introduced the infrastructure for FDWs and  
custom scan providers to replace joins with scans, failed to add support  
handling of pseudoconstant quals assigned to replaced joins in  
createplan.c, leading to an incorrect plan without a gating Result node  
when postgres_fdw replaced a join with such a qual.  
  
To fix, we could add the support by 1) modifying the ForeignPath and  
CustomPath structs to store the list of RestrictInfo nodes to apply to  
the join, as in JoinPaths, if they represent foreign and custom scans  
replacing a join with a scan, and by 2) modifying create_scan_plan() in  
createplan.c to use that list in that case, instead of the  
baserestrictinfo list, to get pseudoconstant quals assigned to the join;  
but #1 would cause an ABI break.  So fix by modifying the infrastructure  
to just disallow replacing joins with such quals.  
  
Back-patch to all supported branches.  
  
Reported by Nishant Sharma.  Patch by me, reviewed by Nishant Sharma and  
Richard Guo.  
  
Discussion: https://postgr.es/m/CADrsxdbcN1vejBaf8a%2BQhrZY5PXL-04mCd4GDu6qm6FigDZd6Q%40mail.gmail.com  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/sql/postgres_fdw.sql
M src/backend/optimizer/path/joinpath.c
M src/backend/optimizer/util/restrictinfo.c
M src/include/optimizer/restrictinfo.h

Eliminate fixed token-length limit in hba.c.

commit   : de3f0e3fe0e7d44620111c5723504a3a6e8c046e    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 27 Jul 2023 11:56:35 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 27 Jul 2023 11:56:35 -0400    

Click here for diff

Historically, hba.c limited tokens in the authentication configuration  
files (pg_hba.conf and pg_ident.conf) to less than 256 bytes.  We have  
seen a few reports of this limit causing problems; notably, for  
moderately-complex LDAP configurations.  Let's get rid of the fixed  
limit by using a StringInfo instead of a fixed-size buffer.  
This actually takes less code than before, since we can get rid of  
a nontrivial error recovery stanza.  It's doubtless a hair slower,  
but parsing the content of the HBA files should in no way be  
performance-critical.  
  
Although this is a pretty straightforward patch, it doesn't seem  
worth the risk to back-patch given the small number of complaints  
to date.  In released branches, we'll just raise MAX_TOKEN to  
ameliorate the problem.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/libpq/hba.c

Fix performance problem with new COPY DEFAULT code

commit   : c1308ce2d9224f0ec08128ab35e161837f9a5105    
  
author   : David Rowley <[email protected]>    
date     : Thu, 27 Jul 2023 14:48:44 +1200    
  
committer: David Rowley <[email protected]>    
date     : Thu, 27 Jul 2023 14:48:44 +1200    

Click here for diff

9f8377f7a added code to allow COPY FROM insert a column's default value  
when the input matches the DEFAULT string specified in the COPY command.  
  
Here we fix some inefficient code which needlessly palloc0'd an array to  
store if we should use the default value or input value for the given  
column.  This array was being palloc0'd and pfree'd once per row.  It's  
much more efficient to allocate this once and just reset the values once  
per row.  
  
Reported-by: Masahiko Sawada  
Author: Masahiko Sawada  
Discussion: https://postgr.es/m/CAD21AoDvDmUQeJtZrau1ovnT_smN940%3DKp6mszNGK3bq9yRN6g%40mail.gmail.com  
Backpatch-through: 16, where 9f8377f7a was introduced.  

M src/backend/commands/copyfrom.c
M src/backend/commands/copyfromparse.c

Fix crash with RemoveFromWaitQueue() when detecting a deadlock.

commit   : b4f14d2e433bf9f2499f07bcaca07b9ff13d641b    
  
author   : Masahiko Sawada <[email protected]>    
date     : Wed, 26 Jul 2023 14:41:23 +0900    
  
committer: Masahiko Sawada <[email protected]>    
date     : Wed, 26 Jul 2023 14:41:23 +0900    

Click here for diff

Commit 5764f611e used dclist_delete_from() to remove the proc from the  
wait queue. However, since it doesn't clear dist_node's next/prev to  
NULL, it could call RemoveFromWaitQueue() twice: when the process  
detects a deadlock and then when cleaning up locks on aborting the  
transaction. The waiting lock information is cleared in the first  
call, so it led to a crash in the second call.  
  
Backpatch to v16, where the change was introduced.  
  
Bug: #18031  
Reported-by: Justin Pryzby, Alexander Lakhin  
Reviewed-by: Andres Freund  
Discussion: https://postgr.es/m/ZKy4AdrLEfbqrxGJ%40telsasoft.com  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 16  

M src/backend/storage/lmgr/lock.c

Remove unnecessary checks for indexes for REPLICA IDENTITY FULL tables.

commit   : 35c85c3c9b90eb70937c8f409d2e7615b2bdb538    
  
author   : Masahiko Sawada <[email protected]>    
date     : Tue, 25 Jul 2023 15:09:31 +0900    
  
committer: Masahiko Sawada <[email protected]>    
date     : Tue, 25 Jul 2023 15:09:31 +0900    

Click here for diff

Previously, when selecting an usable index for update/delete for the  
REPLICA IDENTITY FULL table, in IsIndexOnlyExpression(), we used to  
check if all index fields are not expressions. However, it was not  
necessary, because it is enough to check if only the leftmost index  
field is not an expression (and references the remote table column)  
and this check has already been done by  
RemoteRelContainsLeftMostColumnOnIdx().  
  
This commit removes IsIndexOnlyExpression() and  
RemoteRelContainsLeftMostColumnOnIdx() and all checks for usable  
indexes for REPLICA IDENTITY FULL tables are now performed by  
IsIndexUsableForReplicaIdentityFull().  
  
Backpatch this to remain the code consistent.  
  
Reported-by: Peter Smith  
Reviewed-by: Amit Kapila, Önder Kalacı  
Discussion: https://postgr.es/m/CAHut%2BPsGRE5WSsY0jcLHJEoA17MrbP9yy8FxdjC_ZOAACxbt%2BQ%40mail.gmail.com  
Backpatch-through: 16  

M src/backend/executor/execReplication.c
M src/backend/replication/logical/relation.c
M src/backend/replication/logical/worker.c
M src/include/replication/logicalrelation.h

Fix the display of UNKNOWN message type in apply worker.

commit   : ad486b0eaef4b2fcb7c672fcbf5c2f31eb99ac83    
  
author   : Amit Kapila <[email protected]>    
date     : Tue, 25 Jul 2023 09:01:29 +0530    
  
committer: Amit Kapila <[email protected]>    
date     : Tue, 25 Jul 2023 09:01:29 +0530    

Click here for diff

We include the message type while displaying an error context in the  
apply worker. Now, while retrieving the message type string if the  
message type is unknown we throw an error that will hide the original  
error. So, instead, we need to simply return the string indicating an  
unknown message type.  
  
Reported-by: Ashutosh Bapat  
Author: Euler Taveira, Amit Kapila  
Reviewed-by: Ashutosh Bapat  
Backpatch-through: 15  
Discussion: https://postgr.es/m/CAExHW5suAEDW-mBZt_qu4RVxWZ1vL54-L+ci2zreYWebpzxYsA@mail.gmail.com  

M src/backend/replication/logical/proto.c
M src/backend/replication/logical/worker.c
M src/include/replication/logicalproto.h

Fix off-by-one in LimitAdditionalPins()

commit   : bd2f46c6559ddcafe7bae5015ac45b69bc014067    
  
author   : Andres Freund <[email protected]>    
date     : Mon, 24 Jul 2023 19:07:52 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Mon, 24 Jul 2023 19:07:52 -0700    

Click here for diff

Due to the bug LimitAdditionalPins() could return 0, violating  
LimitAdditionalPins()'s API ("One additional pin is always allowed"). This  
could be hit when setting shared_buffers very low and using a fair amount of  
concurrency.  
  
This bug was introduced in 31966b151e6a.  
  
Author: "Anton A. Melnikov" <[email protected]>  
Reported-by: "Anton A. Melnikov" <[email protected]>  
Reported-by: Victoria Shepard  
Discussion: https://postgr.es/m/[email protected]  
Backpatch: 16-  

M src/backend/storage/buffer/bufmgr.c

Make test_decoding ddl.out shorter

commit   : b1dc946eee3d8d4fd9776ccbc21bcb4ab747b998    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 24 Jul 2023 17:48:06 +0200    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 24 Jul 2023 17:48:06 +0200    

Click here for diff

Some of the test_decoding test output was extremely wide, because it  
deals with massive toasted values, and the aligned mode causes psql to  
produce 200kB of whitespace and dashes. Change to unaligned mode  
temporarily to avoid that behavior.  
  
Backpatch to 14, where it applies cleanly.  
  
Discussion: https://postgr.es/m/[email protected]  

M contrib/test_decoding/expected/ddl.out
M contrib/test_decoding/sql/ddl.sql

Compare only major versions in AdjustUpgrade.pm

commit   : 28ce9d51f9082318e84f2a84385871394dcf2130    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 24 Jul 2023 17:14:22 +0200    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 24 Jul 2023 17:14:22 +0200    

Click here for diff

Because PostgreSQL::Version is very nuanced about development version  
numbers, the comparison to 16beta2 makes it think that that release is  
older than 16, therefore applying a database tweak that doesn't work  
there (the comparison is only supposed to match when run on version 15).  
As suggested by Andrew Dunstan, fix by having AdjustUpgrade.pm public  
methods create a separate PostgreSQL::Version object to use for these  
comparisons, that only carries the major version number.  
  
While at it, have the same methods ensure that the objects given are of  
the expected type.  
  
Backpatch to 16.  This module goes all the way back to 9.2, but there's  
probably no need for this fix except where betas still live.  
  
Co-authored-by: Andrew Dunstan <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm

Avoid compiler warning in non-assert builds.

commit   : 11237e5a46ca2221aca5c74bf43bb58eff8dcc3b    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 22 Jul 2023 10:32:52 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 22 Jul 2023 10:32:52 -0400    

Click here for diff

After 3c90dcd03, try_partitionwise_join's child_joinrelids  
variable is read only in an Assert, provoking a compiler  
warning in non-assert builds.  Rearrange code to avoid the  
warning and eliminate unnecessary work in the non-assert case.  
  
Per CI testing (via Jeff Davis and Bharath Rupireddy)  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/optimizer/path/joinrels.c

Fix calculation of relid sets for partitionwise child joins.

commit   : f75595cd80d134d5a63929a90a0347ff9729b79a    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 21 Jul 2023 12:00:14 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 21 Jul 2023 12:00:14 -0400    

Click here for diff

Applying add_outer_joins_to_relids() to a child join doesn't actually  
work, even if we've built a SpecialJoinInfo specialized to the child,  
because that function will also compare the join's relids to elements  
of the main join_info_list, which only deal in regular relids not  
child relids.  This mistake escaped detection by the existing  
partitionwise join tests because they didn't test any cases where  
add_outer_joins_to_relids() needs to add additional OJ relids (that  
is, any cases where join reordering per identity 3 is possible).  
  
Instead, let's apply adjust_child_relids() to the relids of the parent  
join.  This requires minor code reordering to collect the relevant  
AppendRelInfo structures first, but that's work we'd do shortly anyway.  
  
Report and fix by Richard Guo; cosmetic changes by me  
  
Discussion: https://postgr.es/m/CAMbWs49NCNbyubZWgci3o=_OTY=snCfAPtMnM-32f3mm-K-Ckw@mail.gmail.com  

M src/backend/optimizer/path/joinrels.c
M src/backend/optimizer/util/relnode.c
M src/test/regress/expected/partition_join.out
M src/test/regress/sql/partition_join.sql

Don't include CaseTestExpr in JsonValueExpr.formatted_expr

commit   : 66a9003e2e3ec05e9b62d6bfb6797fa35fb01d15    
  
author   : Amit Langote <[email protected]>    
date     : Fri, 21 Jul 2023 19:28:31 +0900    
  
committer: Amit Langote <[email protected]>    
date     : Fri, 21 Jul 2023 19:28:31 +0900    

Click here for diff

A CaseTestExpr is currently being put into  
JsonValueExpr.formatted_expr as placeholder for the result of  
evaluating JsonValueExpr.raw_expr, which in turn is evaluated  
separately.  Though, there's no need for this indirection if  
raw_expr itself can be embedded into formatted_expr and evaluated  
as part of evaluating the latter, especially as there is no  
special reason to evaluate it separately.  So this commit makes it  
so.  As a result, JsonValueExpr.raw_expr no longer needs to be  
evaluated in ExecInterpExpr(), eval_const_exprs_mutator() etc. and  
is now only used for displaying the original "unformatted"  
expression in ruleutils.c.  Comments about and the code manipulating  
formatted_expr is updated to mention that it is now always set and  
is the expression that gives a JsonValueExpr its runtime value.  
  
While at it, this also removes the function makeCaseTestExpr(),  
because the code in makeJsonConstructorExpr() looks more readable  
without it IMO and isn't used by anyone else either.  
  
Finally, a note is added in the comment above CaseTestExpr's  
definition that JsonConstructorExpr is also using it.  
  
Backpatched to 16 from the development branch to keep the code in  
sync across branches.  
  
Reviewed-by: Álvaro Herrera <[email protected]>  
Discussion: https://postgr.es/m/CA+HiwqE4XTdfb1nW=Ojoy_tQSRhYt-q_kb6i5d4xcKyrLC1Nbg@mail.gmail.com  

M src/backend/executor/execExpr.c
M src/backend/nodes/makefuncs.c
M src/backend/nodes/nodeFuncs.c
M src/backend/optimizer/util/clauses.c
M src/backend/parser/gram.y
M src/backend/parser/parse_expr.c
M src/include/nodes/makefuncs.h
M src/include/nodes/primnodes.h

Guard against null plan pointer in CachedPlanIsSimplyValid().

commit   : c0f53139611cf6b24175bea27bfbddb0ea5b7378    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 20 Jul 2023 14:23:46 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 20 Jul 2023 14:23:46 -0400    

Click here for diff

If both the passed-in plan pointer and plansource->gplan are  
NULL, CachedPlanIsSimplyValid would think that the plan pointer  
is possibly-valid and try to dereference it.  For the one extant  
call site in plpgsql, this situation doesn't normally happen  
which is why we've not noticed. However, it appears to be possible  
if the previous use of the cached plan failed, as per report from  
Justin Pryzby.  Add an extra check to prevent crashing.  
Back-patch to v13 where this code was added.  
  
Discussion: https://postgr.es/m/ZLlV+STFz1l/[email protected]  

M src/backend/utils/cache/plancache.c

Pass constructName to transformJsonValueExpr()

commit   : 7825a1b01e400434835253b4ff38dd96d823d454    
  
author   : Amit Langote <[email protected]>    
date     : Thu, 20 Jul 2023 16:23:49 +0900    
  
committer: Amit Langote <[email protected]>    
date     : Thu, 20 Jul 2023 16:23:49 +0900    

Click here for diff

This allows it to pass to coerce_to_specific_type() the actual name  
corresponding to the specific JSON_* function expression being  
transformed, instead of the currently hardcoded string.  
  
Backpatched to 16 from the development branch to keep the code in  
sync across branches.  
  
Reviewed-by: Álvaro Herrera <[email protected]>  
Discussion: https://postgr.es/m/CA+HiwqHu58pO3cJ7rB6ZLwUztVdG1J66xSjDdjfan5uT5NhESw@mail.gmail.com  

M src/backend/parser/parse_expr.c

Add psql \drg command to display role grants.

commit   : 0a1d2a7df852f16c452eef8a83003943125162c7    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 19 Jul 2023 12:46:30 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 19 Jul 2023 12:46:30 -0400    

Click here for diff

With the addition of INHERIT and SET options for role grants,  
the historical display of role memberships in \du/\dg is woefully  
inadequate.  Besides those options, there are pre-existing  
shortcomings that you can't see the ADMIN option nor the grantor.  
  
To fix this, remove the "Member of" column from \du/\dg altogether  
(making that output usefully narrower), and invent a new meta-command  
"\drg" that is specifically for displaying role memberships.  It  
shows one row for each role granted to the selected role(s), with  
the grant options and grantor.  
  
We would not normally back-patch such a feature addition post  
feature freeze, but in this case the change is mainly driven by  
v16 changes in the server, so it seems appropriate to include it  
in v16.  
  
Pavel Luzanov, with bikeshedding and review from a lot of people,  
but particularly David Johnston  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/ref/psql-ref.sgml
M src/bin/psql/command.c
M src/bin/psql/describe.c
M src/bin/psql/describe.h
M src/bin/psql/help.c
M src/bin/psql/tab-complete.c
M src/test/regress/expected/psql.out
M src/test/regress/sql/psql.sql

Doc: improve description of IN and row-constructor comparisons.

commit   : 245d0e6d0d1cc563c986fa34736b111bdf260af0    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 19 Jul 2023 11:00:34 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 19 Jul 2023 11:00:34 -0400    

Click here for diff

IN and NOT IN work fine on records and arrays, so just say that  
they accept "expressions" not "scalar expressions".  I think that  
that phrasing was meant to say that they don't work on set-returning  
expressions, but that's not the common meaning of "scalar".  
  
Revise the description of row-constructor comparisons to make it  
perhaps a bit less confusing.  (This partially reverts some  
dubious wording changes made by commit f56651519.)  
  
Per gripe from Ilya Nenashev.  Back-patch to supported branches.  
In HEAD and v16, also drop a NOTE about pre-8.2 behavior, which  
is hopefully no longer of interest to anybody.  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/func.sgml

Doc: fix out-of-date example of SPI usage.

commit   : e6e451c1d7e5bc70f0f3a63cbf06eb298f56a76e    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 18 Jul 2023 11:59:39 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 18 Jul 2023 11:59:39 -0400    

Click here for diff

The "count" argument of SPI_exec() only limits execution when  
the query is actually returning rows.  This was not the case  
before PG 9.0, so this example was correct when written; but  
we missed updating it in commit 2ddc600f8.  Extend the example  
to show the behavior both with and without RETURNING.  
  
While here, improve the commentary and markup for the rest  
of the example.  
  
David G. Johnston and Tom Lane, per report from Curt Kolovson.  
Back-patch to all supported branches.  
  
Discussion: https://postgr.es/m/CANhYJV6HWtgz_qjx_APfK0PAgLUzY-2vjLuj7i_o=TZF1LAQew@mail.gmail.com  

M doc/src/sgml/spi.sgml

Fix indentation in twophase.c

commit   : 926aa6d11bde9f0b6b0e45ca5a26646aacac8be3    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 18 Jul 2023 14:04:46 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 18 Jul 2023 14:04:46 +0900    

Click here for diff

This has been missed in cb0cca1, noticed before buildfarm member koel  
has been able to complain while poking at a different patch.  Like the  
other commit, backpatch all the way down to limit the odds of merge  
conflicts.  
  
Backpatch-through: 11  

M src/backend/access/transam/twophase.c

Fix recovery of 2PC transaction during crash recovery

commit   : f88bc9f3883970327598271d26afdb525112874b    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 18 Jul 2023 13:44:27 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 18 Jul 2023 13:44:27 +0900    

Click here for diff

A crash in the middle of a checkpoint with some two-phase state data  
already flushed to disk by this checkpoint could cause a follow-up crash  
recovery to recover twice the same transaction, once from what has been  
found in pg_twophase/ at the beginning of recovery and a second time  
when replaying its corresponding record.  
  
This would lead to FATAL failures in the startup process during  
recovery, where the same transaction would have a state recovered twice  
instead of once:  
LOG:  recovering prepared transaction 731 from shared memory  
LOG:  recovering prepared transaction 731 from shared memory  
FATAL:  lock ExclusiveLock on object 731/0/0 is already held  
  
This issue is fixed by skipping the addition of any 2PC state coming  
from a record whose equivalent 2PC state file has already been loaded in  
TwoPhaseState at the beginning of recovery by restoreTwoPhaseData(),  
which is OK as long as the system has not reached a consistent state.  
  
The timing to get a messed up recovery processing is very racy, and  
would very unlikely happen.  The thread that has reported the issue has  
demonstrated the bug using injection points to force a PANIC in the  
middle of a checkpoint.  
  
Issue introduced in 728bd99, so backpatch all the way down.  
  
Reported-by: "suyu.cmj" <[email protected]>  
Author: "suyu.cmj" <[email protected]>  
Author: Michael Paquier  
Discussion: https://postgr.es/m/109e6994-b971-48cb-84f6-829646f18b4c.mengjuan.cmj@alibaba-inc.com  
Backpatch-through: 11  

M src/backend/access/transam/twophase.c

Include <limits.h> in fe-auth.c, to get CHAR_BIT reliably.

commit   : efe8d8226929137f8c96f45e0904868b53ba56bc    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 17 Jul 2023 16:54:54 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 17 Jul 2023 16:54:54 -0400    

Click here for diff

fe-auth.c references CHAR_BIT since commit 3a465cc67, but it  
did not #include <limits.h>, which per POSIX is where that  
symbol is defined.  This escaped notice so far because  
(a) on most platforms, <sys/param.h> pulls in <limits.h>,  
(b) even if yours doesn't, OpenSSL pulls it in, so compiling  
with --with-openssl masks the omission.  
  
Per bug #18026 from Marcel Hofstetter.  Back-patch to v16.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/interfaces/libpq/fe-auth.c

Add missing initializations of p_perminfo

commit   : 4a7301c7ad1c504c5a3f485a1d28cfd62b3ecbb0    
  
author   : Amit Langote <[email protected]>    
date     : Fri, 14 Jul 2023 14:28:38 +0900    
  
committer: Amit Langote <[email protected]>    
date     : Fri, 14 Jul 2023 14:28:38 +0900    

Click here for diff

In a61b1f74823, we failed to update transformFromClauseItem() and  
buildNSItemFromLists() to set ParseNamespaceItem.p_perminfo causing  
it to point to garbage.  
  
Pointed out by Tom Lane.  
  
Reported-by: Farias de Oliveira <[email protected]>  
Discussion: https://postgr.es/m/3173476.1689286373%40sss.pgh.pa.us  
Backpatch-through: 16  

M src/backend/parser/parse_clause.c
M src/backend/parser/parse_relation.c

Add indisreplident to fields refreshed by RelationReloadIndexInfo()

commit   : 27da47122075971aeacd4e2284d7907dde8a7204    
  
author   : Michael Paquier <[email protected]>    
date     : Fri, 14 Jul 2023 11:16:03 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Fri, 14 Jul 2023 11:16:03 +0900    

Click here for diff

RelationReloadIndexInfo() is a fast-path used for index reloads in the  
relation cache, and it has always forgotten about updating  
indisreplident, which is something that would happen after an index is  
selected for a replica identity.  This can lead to incorrect cache  
information provided when executing a command in a transaction context  
that updates indisreplident.  
  
None of the code paths currently on HEAD that need to check upon  
pg_index.indisreplident fetch its value from the relation cache, always  
relying on a fresh copy on the syscache.  Unfortunately, this may not be  
the case of out-of-core code, that could see out-of-date value.  
  
Author: Shruthi Gowda  
Reviewed-by: Robert Haas, Dilip Kumar, Michael Paquier  
Discussion: https://postgr.es/m/CAASxf_PBcxax0wW-3gErUyftZ0XrCs3Lrpuhq4-Z3Fak1DoW7Q@mail.gmail.com  
Backpatch-through: 11  

M src/backend/utils/cache/relcache.c

Fix updates of indisvalid for partitioned indexes

commit   : 31f9d41d625dc6ca8c1469edd6919316b18174fe    
  
author   : Michael Paquier <[email protected]>    
date     : Fri, 14 Jul 2023 10:13:14 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Fri, 14 Jul 2023 10:13:14 +0900    

Click here for diff

indisvalid is switched to true for partitioned indexes when all its  
partitions have valid indexes when attaching a new partition, up to the  
top-most parent if all its leaves are themselves valid when dealing with  
multiple layers of partitions.  
  
The copy of the tuple from pg_index used to switch indisvalid to true  
came from the relation cache, which is incorrect.  Particularly, in the  
case reported by Shruthi Gowda, executing a series of commands in a  
single transaction would cause the validation of partitioned indexes to  
use an incorrect version of a pg_index tuple, as indexes are reloaded  
after an invalidation request with RelationReloadIndexInfo(), a much  
faster version than a full index cache rebuild.  In this case, the  
limited information updated in the cache leads to an incorrect version  
of the tuple used.  One of the symptoms reported was the following  
error, with a replica identity update, for instance:  
"ERROR: attempted to update invisible tuple"  
  
This is incorrect since 8b08f7d, so backpatch all the way down.  
  
Reported-by: Shruthi Gowda  
Author: Michael Paquier  
Reviewed-by: Shruthi Gowda, Dilip Kumar  
Discussion: https://postgr.es/m/CAASxf_PBcxax0wW-3gErUyftZ0XrCs3Lrpuhq4-Z3Fak1DoW7Q@mail.gmail.com  
Backpatch-through: 11  

M src/backend/commands/tablecmds.c
M src/test/regress/expected/indexing.out
M src/test/regress/sql/indexing.sql

Handle DROP DATABASE getting interrupted

commit   : a4b4cc1d60f7e8ccfcc8ff8cb80c28ee411ad9a9    
  
author   : Andres Freund <[email protected]>    
date     : Thu, 13 Jul 2023 13:03:30 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Thu, 13 Jul 2023 13:03:30 -0700    

Click here for diff

Until now, when DROP DATABASE got interrupted in the wrong moment, the removal  
of the pg_database row would also roll back, even though some irreversible  
steps have already been taken. E.g. DropDatabaseBuffers() might have thrown  
out dirty buffers, or files could have been unlinked. But we continued to  
allow connections to such a corrupted database.  
  
To fix this, mark databases invalid with an in-place update, just before  
starting to perform irreversible steps. As we can't add a new column in the  
back branches, we use pg_database.datconnlimit = -2 for this purpose.  
  
An invalid database cannot be connected to anymore, but can still be  
dropped.  
  
Unfortunately we can't easily add output to psql's \l to indicate that some  
database is invalid, it doesn't fit in any of the existing columns.  
  
Add tests verifying that a interrupted DROP DATABASE is handled correctly in  
the backend and in various tools.  
  
Reported-by: Evgeny Morozov <[email protected]>  
Author: Andres Freund <[email protected]>  
Reviewed-by: Daniel Gustafsson <[email protected]>  
Reviewed-by: Thomas Munro <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Discussion: https://postgr.es/m/[email protected]  
Backpatch: 11-, bug present in all supported versions  

M doc/src/sgml/catalogs.sgml
M src/backend/commands/dbcommands.c
M src/backend/commands/vacuum.c
M src/backend/postmaster/autovacuum.c
M src/backend/utils/init/postinit.c
M src/bin/pg_amcheck/pg_amcheck.c
M src/bin/pg_amcheck/t/002_nonesuch.pl
M src/bin/pg_dump/pg_dumpall.c
M src/bin/pg_dump/t/002_pg_dump.pl
M src/bin/pg_upgrade/t/002_pg_upgrade.pl
M src/bin/scripts/clusterdb.c
M src/bin/scripts/reindexdb.c
M src/bin/scripts/t/011_clusterdb_all.pl
M src/bin/scripts/t/050_dropdb.pl
M src/bin/scripts/t/091_reindexdb_all.pl
M src/bin/scripts/t/101_vacuumdb_all.pl
M src/bin/scripts/vacuumdb.c
M src/include/catalog/pg_database.h
M src/test/recovery/meson.build
A src/test/recovery/t/037_invalid_database.pl

Release lock after encountering bogs row in vac_truncate_clog()

commit   : 03ccc9569cd87fcbe01e4ba052c22ad0d9a3b71d    
  
author   : Andres Freund <[email protected]>    
date     : Thu, 13 Jul 2023 13:03:30 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Thu, 13 Jul 2023 13:03:30 -0700    

Click here for diff

When vac_truncate_clog() encounters bogus datfrozenxid / datminmxid values, it  
returns early. Unfortunately, until now, it did not release  
WrapLimitsVacuumLock. If the backend later tries to acquire  
WrapLimitsVacuumLock, the session / autovacuum worker hangs in an  
uncancellable way. Similarly, other sessions will hang waiting for the  
lock. However, if the backend holding the lock exited or errored out for some  
reason, the lock was released.  
  
The bug was introduced as a side effect of 566372b3d643.  
  
It is interesting that there are no production reports of this problem. That  
is likely due to a mix of bugs leading to bogus values having gotten less  
common, process exit releasing locks and instances of hangs being hard to  
debug for "normal" users.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/commands/vacuum.c

Remove unnecessary pfree() in g_intbig_compress().

commit   : e27f3f52c289a2f6e67f9319602df190a92446c0    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 13 Jul 2023 13:07:51 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 13 Jul 2023 13:07:51 -0400    

Click here for diff

GiST compress functions (like all GiST opclass functions) are  
supposed to be called in short-lived memory contexts, so that  
minor memory leaks in them are not of concern, and indeed  
explicit pfree's are likely slightly counterproductive.  
But this one in g_intbig_compress() is more than  
slightly counterproductive, because it's guarded by  
"if (in != DatumGetArrayTypeP(entry->key))" which means  
that if this test succeeds, we've detoasted the datum twice.  
(And to add insult to injury, the extra detoast result is  
leaked.)  Let's just drop the whole stanza, relying on the  
GiST temporary context mechanism to clean up in good time.  
  
The analogous bit in g_int_compress() is  
       if (r != (ArrayType *) DatumGetPointer(entry->key))  
           pfree(r);  
which doesn't have the gratuitous-detoast problem so  
I left it alone.  Perhaps there is a case for removing  
unnecessary pfree's more widely, but I'm not sure if it's  
worth the code churn.  
  
The potential extra decompress seems expensive enough to  
justify calling this a (minor) performance bug and  
back-patching.  
  
Konstantin Knizhnik, Matthias van de Meent, Tom Lane  
  
Discussion: https://postgr.es/m/CAEze2Wi86=DxErfvf+SCB2UKmU2amKOF60BKuJOX=w-RojRn0A@mail.gmail.com  

M contrib/intarray/_intbig_gist.c

Fix untranslatable log message assembly

commit   : b4018ecb88a49612730398d15d3d96d68abe1137    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 13 Jul 2023 12:56:35 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 13 Jul 2023 12:56:35 +0200    

Click here for diff

We can't inject the name of the logical replication worker into a log  
message like that.  But for these messages we don't really need the  
precision of knowing what kind of worker it was, so just write  
"logical replication worker" and keep the message in one piece.  
  
Discussion: https://www.postgresql.org/message-id/flat/CAHut%2BPt1xwATviPGjjtJy5L631SGf3qjV9XUCmxLu16cHamfgg%40mail.gmail.com  

M src/backend/replication/logical/worker.c

Doc: clarify the conditions of usable indexes for REPLICA IDENTITY FULL tables.

commit   : 4946910a875ce84823236f2a06e576b16080465f    
  
author   : Masahiko Sawada <[email protected]>    
date     : Thu, 13 Jul 2023 15:03:24 +0900    
  
committer: Masahiko Sawada <[email protected]>    
date     : Thu, 13 Jul 2023 15:03:24 +0900    

Click here for diff

Commit 89e46da5e allowed REPLICA IDENTITY FULL tables to use an index  
on the subscriber during apply of update/delete. This commit clarifies  
in the documentation that the leftmost field of candidate indexes must  
be a column (not an expression) that references the published relation  
column.  
  
The source code comments are also updated accordingly.  
  
Reviewed-by: Peter Smith, Amit Kapila  
Discussion: https://postgr.es/m/CAD21AoDJjffEvUFKXT27Q5U8-UU9JHv4rrJ9Ke8Zkc5UPWHLvA@mail.gmail.com  
Backpatch-through: 16  

M doc/src/sgml/logical-replication.sgml
M src/backend/executor/execReplication.c
M src/backend/replication/logical/relation.c

meson: Tie adding C++ support to the llvm Meson option

commit   : 7fc064d9b70f58998d3e8de78ece52b4e1376428    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 12 Jul 2023 16:26:03 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 12 Jul 2023 16:26:03 -0700    

Click here for diff

In the event the llvm option is defined to be 'auto', it is possible  
that the host machine might not have a C++ compiler. If that is the  
case, then we shouldn't continue reaching for the llvm dependency.  
  
To make it easier to understand the case where LLVM support is disabled due to  
lacking a C++ compiler, add a message noting that fact.  
  
Author: Tristan Partin <[email protected]>  
Reviewed-by: Andres Freund <[email protected]>  
Discussion: https://postgr.es/m/CSPIJVUDZFKX.3KHMOAVGF94RV@c3po  
Backpatch: 16-, where meson support was added  

M meson.build

meson: Pass more feature option through to required kwargs

commit   : 5a7280d9880f94c632425703ac68a17a218474fb    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 12 Jul 2023 16:26:03 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 12 Jul 2023 16:26:03 -0700    

Click here for diff

That was already done in a lot of places, but not all.  
  
Backpatch this to keep the the meson files aligned as long as reasonably  
possible.  
  
Author: Tristan Partin <[email protected]>  
Reviewed-by: Andres Freund <[email protected]>  
Discussion: https://postgr.es/m/CSPIJVUDZFKX.3KHMOAVGF94RV@c3po  
Backpatch: 16-, where meson support was added  

M meson.build

pg_bsd_indent: Collect test diffs in test.diffs instead of tests.diff

commit   : eeb28a2d94220a8540a57ca8204eaff8cadaf1fa    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 12 Jul 2023 16:26:03 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 12 Jul 2023 16:26:03 -0700    

Click here for diff

That way CI knows to pick up the file if the test fails.  
  
Discussion: https://postgr.es/m/[email protected]  
Backpatch: 16-, where the test was added  

M src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl

Be more rigorous about local variables in PostgresMain().

commit   : 93dcdfa88f5f9befb781558920e02d3ee86dc629    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 10 Jul 2023 12:14:34 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 10 Jul 2023 12:14:34 -0400    

Click here for diff

Since PostgresMain calls sigsetjmp, any local variables that are not  
marked "volatile" have a risk of unspecified behavior.  In practice  
this means that when control returns via longjmp, such variables might  
get reset to their values as of the time of sigsetjmp, depending on  
whether the compiler chose to put them in registers or on the stack.  
We were careful about this for "send_ready_for_query", but not the  
other local variables.  
  
In the case of the timeout_enabled flags, resetting them to  
their initial "false" states is actually good, since we do  
"disable_all_timeouts()" in the longjmp cleanup code path.  If that  
does not happen, we risk uselessly calling "disable_timeout()" later,  
which is harmless but a little bit expensive.  Let's explicitly reset  
these flags so that the behavior is correct and platform-independent.  
(This change means that we really don't need the new "volatile"  
markings after all, but let's install them anyway since any change  
in this logic could re-introduce a problem.)  
  
There is no issue for "firstchar" and "input_message" because those  
are explicitly reinitialized each time through the query processing  
loop.  To make that clearer, move them to be declared inside the loop.  
That leaves us with all the function-lifespan locals except the  
sigjmp_buf itself marked as volatile, which seems like a good policy  
to have going forward.  
  
Because of the possibility of extra disable_timeout() calls, this  
seems worth back-patching.  
  
Sergey Shinderuk and Tom Lane  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/tcop/postgres.c

Fix pgindent

commit   : e004cb0394402a26b7142721e59a4f8e179bd1e4    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 10 Jul 2023 12:05:32 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 10 Jul 2023 12:05:32 +0200    

Click here for diff

for commit e53a611523  

M src/backend/tcop/utility.c

Message wording improvements

commit   : 2631ebab7b18bdc079fd86107c47d6104a6b3c6e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 10 Jul 2023 10:46:54 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 10 Jul 2023 10:46:54 +0200    

Click here for diff

M src/backend/access/common/reloptions.c
M src/backend/backup/basebackup_zstd.c
M src/backend/commands/copyfromparse.c
M src/backend/commands/tablecmds.c
M src/backend/libpq/auth.c
M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/backend/replication/walsender.c
M src/backend/storage/ipc/procarray.c
M src/backend/tcop/postgres.c
M src/backend/tcop/utility.c
M src/backend/utils/adt/jsonpath_scan.l
M src/backend/utils/adt/pg_locale.c
M src/backend/utils/misc/guc_tables.c
M src/test/regress/expected/alter_table.out
M src/test/regress/expected/collate.icu.utf8.out
M src/test/regress/expected/copy2.out
M src/test/regress/expected/create_table.out
M src/test/regress/expected/foreign_key.out
M src/test/regress/expected/jsonpath_encoding.out
M src/test/regress/expected/jsonpath_encoding_1.out

Fix ALTER EXTENSION SET SCHEMA with objects outside an extension's schema

commit   : 55c95f24cd7c91fc80d7c0d2c842c0b633f9bdc9    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 10 Jul 2023 09:40:12 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 10 Jul 2023 09:40:12 +0900    

Click here for diff

As coded, the code would use as a base comparison the namespace OID from  
the first object scanned in pg_depend when switching its namespace  
dependency entry to the new one, and use it as a base of comparison for  
any follow-up checks.  It would also be used as the old namespace OID to  
switch *from* for the extension's pg_depend entry.  Hence, if the first  
object scanned has a namespace different than the one stored in the  
extension, we would finish by:  
- Not checking that the extension objects map with the extension's  
schema.  
- Not switching the extension -> namespace dependency entry to the new  
namespace provided by the user, making ALTER EXTENSION ineffective.  
  
This issue exists since this command has been introduced in d9572c4 for  
relocatable extension, so backpatch all the way down to 11.  The test  
case has been provided by Heikki, that I have tweaked a bit to show the  
effects on pg_depend for the extension.  
  
Reported-by: Heikki Linnakangas  
Author: Michael Paquier, Heikki Linnakangas  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 11  

M src/backend/commands/extension.c
M src/test/modules/test_extensions/expected/test_extensions.out
M src/test/modules/test_extensions/sql/test_extensions.sql

doc: Use proper markup for emphasis

commit   : 25da5cd32f73eec9a7ea9b49fbf04d97059ad402    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 9 Jul 2023 10:02:15 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 9 Jul 2023 10:02:15 +0200    

Click here for diff

M doc/src/sgml/config.sgml

doc: Move DEFAULT parameter on COPY reference page

commit   : 1da1cd2944701d5f6d8e4e9514a4a19b0fdf852a    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 9 Jul 2023 09:46:24 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 9 Jul 2023 09:46:24 +0200    

Click here for diff

The DEFAULT parameter seems most similar to the NULL parameter, so  
move it next to it, instead of having it at the end of the parameter  
list because it was the last one added.  

M doc/src/sgml/ref/copy.sgml

Doc: update old reference to "result cache"

commit   : 6d8b5f49f0e18a0e8a926a4315c6a70efa34036e    
  
author   : David Rowley <[email protected]>    
date     : Sun, 9 Jul 2023 16:14:47 +1200    
  
committer: David Rowley <[email protected]>    
date     : Sun, 9 Jul 2023 16:14:47 +1200    

Click here for diff

During the PostgreSQL 14 cycle, the Memoize executor node was briefly  
called "Result Cache" until it was renamed in 83f4fcc65.  That commit  
missed one reference.  
  
Reported-by: Paul A Jungwirth  
Packpatch-through: 14, where Memoize was added  
Discussion: https://postgr.es/m/CA+renyX=40YXhsfPTzn13oNOPO3TJ12CK9GX-2P2pvnQiScefA@mail.gmail.com  

M doc/src/sgml/config.sgml

Fix tmpdir issues with commit e213de8e78

commit   : 6d8a8bb0104ccd9ba5199dc54647d58ce006324e    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sat, 8 Jul 2023 12:34:25 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sat, 8 Jul 2023 12:34:25 -0400    

Click here for diff

Commit e213de8e78 fixed a problem with path lengths to a tempdir on  
Windows, but caused problems on at least some Unix systems where the  
system tempdir is on a different file system. To work around this, only  
used the system temdir for the destination of pg_replslot on Windows,  
and otherwise restore the old behaviour.  
  
Backpatch to relase 14 like the previous patch.  
  
Problem exposed by a myriad of buildfarm animals.  

M src/bin/pg_basebackup/t/010_pg_basebackup.pl

Use shorter location for pg_replslot in pg_basebackup test

commit   : 67ece2e709c44880bd634daa18c0f9d6862857f5    
  
author   : Andrew Dunstan <[email protected]>    
date     : Sat, 8 Jul 2023 11:21:58 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Sat, 8 Jul 2023 11:21:58 -0400    

Click here for diff

The symlink to a longer location tripped up some Windows limit on  
buildfarm animal fairywren when running with meson, which uses slightly  
longer paths.  
  
Backpatch to all live branches to keep the script in sync.  

M src/bin/pg_basebackup/t/010_pg_basebackup.pl

Fix Perl warning

commit   : 1421e8f3b6fc489f66d665d2a657f1af8bcd6595    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 8 Jul 2023 17:24:41 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 8 Jul 2023 17:24:41 +0200    

Click here for diff

Use of uninitialized value $content in concatenation (.) or string  

M src/test/perl/PostgreSQL/Test/Utils.pm

Make some indentation in gram.y consistent

commit   : 01f1f789df5631b831dbd38b5a2b70d066f79fe2    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 8 Jul 2023 15:50:35 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 8 Jul 2023 15:50:35 +0200    

Click here for diff

Reviewed-by: Amit Langote <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CA+HiwqE4XTdfb1nW=Ojoy_tQSRhYt-q_kb6i5d4xcKyrLC1Nbg@mail.gmail.com  

M src/backend/parser/gram.y

Revert MAINTAIN privilege and pg_maintain predefined role.

commit   : 957445996fda2d6939a8748f2a19c10b15941c5e    
  
author   : Nathan Bossart <[email protected]>    
date     : Fri, 7 Jul 2023 11:25:23 -0700    
  
committer: Nathan Bossart <[email protected]>    
date     : Fri, 7 Jul 2023 11:25:23 -0700    

Click here for diff

This reverts the following commits: 4dbdb82513, c2122aae63,  
5b1a879943, 9e1e9d6560, ff9618e82a, 60684dd834, 4441fc704d,  
and b5d6382496.  A role with the MAINTAIN privilege may be able to  
use search_path tricks to escalate privileges to the table owner.  
Unfortunately, it is too late in the v16 development cycle to apply  
the proposed fix, i.e., restricting search_path when running  
maintenance commands.  
  
Bumps catversion.  
  
Reviewed-by: Jeff Davis  
Discussion: https://postgr.es/m/E1q7j7Y-000z1H-Hr%40gemulon.postgresql.org  
Backpatch-through: 16  

M doc/src/sgml/ddl.sgml
M doc/src/sgml/func.sgml
M doc/src/sgml/ref/alter_default_privileges.sgml
M doc/src/sgml/ref/analyze.sgml
M doc/src/sgml/ref/cluster.sgml
M doc/src/sgml/ref/grant.sgml
M doc/src/sgml/ref/lock.sgml
M doc/src/sgml/ref/refresh_materialized_view.sgml
M doc/src/sgml/ref/reindex.sgml
M doc/src/sgml/ref/revoke.sgml
M doc/src/sgml/ref/vacuum.sgml
M doc/src/sgml/user-manag.sgml
M src/backend/catalog/aclchk.c
M src/backend/commands/analyze.c
M src/backend/commands/cluster.c
M src/backend/commands/indexcmds.c
M src/backend/commands/lockcmds.c
M src/backend/commands/matview.c
M src/backend/commands/tablecmds.c
M src/backend/commands/vacuum.c
M src/backend/utils/adt/acl.c
M src/bin/pg_dump/dumputils.c
M src/bin/pg_dump/t/002_pg_dump.pl
M src/bin/psql/tab-complete.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_authid.dat
M src/include/commands/tablecmds.h
M src/include/commands/vacuum.h
M src/include/nodes/parsenodes.h
M src/include/utils/acl.h
M src/test/isolation/expected/cluster-conflict-partition.out
M src/test/isolation/specs/cluster-conflict-partition.spec
M src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
M src/test/regress/expected/cluster.out
M src/test/regress/expected/create_index.out
M src/test/regress/expected/dependency.out
M src/test/regress/expected/privileges.out
M src/test/regress/expected/rowsecurity.out
M src/test/regress/sql/cluster.sql
M src/test/regress/sql/dependency.sql
M src/test/regress/sql/privileges.sql

Document relaxed HOT for summarizing indexes

commit   : 1124cb2cf2ebc1b0adb9c5289e53ffe094ce3206    
  
author   : Tomas Vondra <[email protected]>    
date     : Fri, 7 Jul 2023 19:04:32 +0200    
  
committer: Tomas Vondra <[email protected]>    
date     : Fri, 7 Jul 2023 19:04:32 +0200    

Click here for diff

Commit 19d8e2308b allowed a weaker check for HOT with summarizing  
indexes, but it did not update README.HOT. So do that now.  
  
Patch by Matthias van de Meent, minor changes by me. Backpatch to 16,  
where the optimization was introduced.  
  
Author: Matthias van de Meent  
Reviewed-by: Tomas Vondra  
Backpatch-through: 16  
Discussion: https://postgr.es/m/CAEze2WiEOm8V+c9kUeYp2BPhbEc5s473fUf51xNeqvSFGv44Ew@mail.gmail.com  

M src/backend/access/heap/README.HOT

Fix type of iterator variable in SH_START_ITERATE

commit   : 727d96511ef58521bd4be0d3acb7ba88df44e762    
  
author   : Andres Freund <[email protected]>    
date     : Thu, 6 Jul 2023 08:34:17 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Thu, 6 Jul 2023 08:34:17 -0700    

Click here for diff

Also add comment to make the reasoning behind the Assert() more explicit (per  
Tom).  
  
Reported-by: Ranier Vilela  
Discussion: https://postgr.es/m/CAEudQAocXNJ6s1VLz+hMamLAQAiewRoW17OJ6-+9GACKfj6iPQ@mail.gmail.com  
Backpatch: 11-  

M src/include/lib/simplehash.h

Skip pg_baseback long filename test if path too long on Windows

commit   : b94d70a632aabb02079f094b9c9a32f4f6b8c984    
  
author   : Andrew Dunstan <[email protected]>    
date     : Thu, 6 Jul 2023 12:27:40 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Thu, 6 Jul 2023 12:27:40 -0400    

Click here for diff

On Windows, it's sometimes difficult to create a file with a path longer  
than 255 chars, and if it can be created it might not be seen by the  
archiver. This can be triggered by the test for tar backups with  
filenames greater than 100 bytes. So we skip that test if the path would  
exceed 255.  
  
Backpatch to all live branches.  
  
Reviewed by Daniel Gustafsson  
  
Discussion: https://postgr.es/m/[email protected]  

M src/bin/pg_basebackup/t/010_pg_basebackup.pl

WAL-log the creation of the init fork of unlogged indexes.

commit   : bf7b70e6bf4ad07f4a46c51a7f866ef89f82404c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 6 Jul 2023 17:25:29 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 6 Jul 2023 17:25:29 +0300    

Click here for diff

We create a file, so we better WAL-log it. In practice, all the  
built-in index AMs and all extensions that I'm aware of write a  
metapage to the init fork, which is WAL-logged, and replay of the  
metapage implicitly creates the fork too. But if ambuildempty() didn't  
write any page, we would miss it.  
  
This can be seen with dummy_index_am. Set up replication, create a  
'dummy_index_am' index on an unlogged table, and look at the files  
created in the replica: the init fork is not created on the  
replica. Dummy_index_am doesn't do anything with the relation files,  
however, so it doesn't lead to any user-visible errors.  
  
Backpatch to all supported versions.  
  
Reviewed-by: Robert Haas  
Discussion: https://www.postgresql.org/message-id/6e5bbc08-cdfc-b2b3-9e23-1a914b9850a9%40iki.fi  

M src/backend/catalog/index.c

commit   : 3c1adbbf86c2cfa44ebed64bd01ed589ad0b832b    
  
author   : Amit Kapila <[email protected]>    
date     : Thu, 6 Jul 2023 08:41:30 +0530    
  
committer: Amit Kapila <[email protected]>    
date     : Thu, 6 Jul 2023 08:41:30 +0530    

Click here for diff

This commit reverts the work done by commits 3ba59ccc89 and 72e78d831a.  
Those commits were incorrect in asserting that we never acquire any other  
heavy-weight lock after acquring page lock other than relation extension  
lock. We can acquire a lock on catalogs while doing catalog look up after  
acquring page lock.  
  
This won't impact any existing feature but we need to think some other way  
to achieve this before parallelizing other write operations or even  
improving the parallelism in vacuum (like allowing multiple workers  
for an index).  
  
Reported-by: Jaime Casanova  
Author: Amit Kapila  
Backpatch-through: 13  
Discussion: https://postgr.es/m/CAJKUy5jffnRKNvRHKQ0LynRb0RJC-o4P8Ku3x9vGAVLwDBWumQ@mail.gmail.com  

M src/backend/optimizer/plan/planner.c
M src/backend/storage/lmgr/README
M src/backend/storage/lmgr/deadlock.c
M src/backend/storage/lmgr/lock.c
M src/backend/storage/lmgr/proc.c

Fix leak of LLVM "fatal-on-oom" section counter.

commit   : dc0b5841746c025f6e51b0a6ba0e423b2ac518f0    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 5 Jul 2023 13:13:13 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 5 Jul 2023 13:13:13 +0300    

Click here for diff

llvm_release_context() called llvm_enter_fatal_on_oom(), but was missing  
the corresponding llvm_leave_fatal_on_oom() call. As a result, if JIT was  
used at all, we were almost always in the "fatal-on-oom" state.  
  
It only makes a difference if you use an extension written in C++, and  
run out of memory in a C++ 'new' call. In that case, you would get a  
PostgreSQL FATAL error, instead of the default behavior of throwing a  
C++ exception.  
  
Back-patch to all supported versions.  
  
Reviewed-by: Daniel Gustafsson  
Discussion: https://www.postgresql.org/message-id/[email protected]  

M src/backend/jit/llvm/llvmjit.c

pgstat: fix subscription stats entry leak.

commit   : be8cae7e2f03f35a049e2b1f1113860fea6d0212    
  
author   : Masahiko Sawada <[email protected]>    
date     : Wed, 5 Jul 2023 14:49:58 +0900    
  
committer: Masahiko Sawada <[email protected]>    
date     : Wed, 5 Jul 2023 14:49:58 +0900    

Click here for diff

Commit 7b64e4b3 taught DropSubscription() to drop stats entry of  
subscription that is not associated with a replication slot for apply  
worker at DROP SUBSCRIPTION but missed covering the case where the  
subscription is not associated with replication slots for both apply  
worker and tablesync worker.  
  
Also add a test to verify that the stats for slot-less subscription is  
removed at DROP SUBSCRIPTION time.  
  
Backpatch down to 15.  
  
Author: Masahiko Sawada  
Reviewed-by: Nathan Bossart, Hayato Kuroda, Melih Mutlu, Amit Kapila  
Discussion: https://postgr.es/m/CAD21AoB71zkP7uPT7JDPsZcvp0749ExEQnOJxeNKPDFisHar+w@mail.gmail.com  
Backpatch-through: 15  

M src/backend/commands/subscriptioncmds.c
M src/test/subscription/t/026_stats.pl

Fix assertion failure in snapshot building

commit   : eb27d3dc88879cb148ae0365394aae0ab84fa1a7    
  
author   : Daniel Gustafsson <[email protected]>    
date     : Tue, 4 Jul 2023 17:36:13 +0200    
  
committer: Daniel Gustafsson <[email protected]>    
date     : Tue, 4 Jul 2023 17:36:13 +0200    

Click here for diff

Clear any potential stale next_phase_at value from the snapshot  
builder which otherwise may trip an assertion check ensuring  
that there is no next_phase_at value.  
  
This can be reproduced by running 80 concurrent sessions like  
the below where $c is a loop counter (assumes there has been  
1..$c databases created) :  
  
  echo "  
    CREATE TABLE replication_example(id SERIAL PRIMARY KEY,  
                                     somedata int,  
                                     text varchar(120));  
    SELECT 'init' FROM  
      pg_create_logical_replication_slot('regression_slot_$c',  
                                         'test_decoding');  
    SELECT data FROM  
      pg_logical_slot_get_changes('regression_slot_$c', NULL,  
                                  NULL, 'include-xids', '0',  
                                  'skip-empty-xacts', '1');  
  " | psql -d regress_$c >>psql.log &  
  
Backpatch down to v16.  
  
Bug: #17695  
Author: Masahiko Sawada <[email protected]>  
Reviewed-by: Alexander Lakhin <[email protected]>  
Reported-by: bowenshi <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: v16  

M src/backend/replication/logical/snapbuild.c

Ensure that creation of an empty relfile is fsync'd at checkpoint.

commit   : d431644b43fcce9b7c2f677db18452b0ee216b42    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 4 Jul 2023 17:57:03 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 4 Jul 2023 17:57:03 +0300    

Click here for diff

If you create a table and don't insert any data into it, the relation file  
is never fsync'd. You don't lose data, because an empty table doesn't have  
any data to begin with, but if you crash and lose the file, subsequent  
operations on the table will fail with "could not open file" error.  
  
To fix, register an fsync request in mdcreate(), like we do for mdwrite().  
  
Per discussion, we probably should also fsync the containing directory  
after creating a new file. But that's a separate and much wider issue.  
  
Backpatch to all supported versions.  
  
Reviewed-by: Andres Freund, Thomas Munro  
Discussion: https://www.postgresql.org/message-id/d47d8122-415e-425c-d0a2-e0160829702d%40iki.fi  

M src/backend/storage/smgr/md.c

Re-bin segment when memory pages are freed.

commit   : af8f9ec66bd19a920d02b4c0eb65b3dd6057d324    
  
author   : Thomas Munro <[email protected]>    
date     : Tue, 4 Jul 2023 15:16:34 +1200    
  
committer: Thomas Munro <[email protected]>    
date     : Tue, 4 Jul 2023 15:16:34 +1200    

Click here for diff

It's OK to be lazy about re-binning memory segments when allocating,  
because that can only leave segments in a bin that's too high.  We'll  
search higher bins if necessary while allocating next time, and  
also eventually re-bin, so no memory can become unreachable that way.  
  
However, when freeing memory, the largest contiguous range of free pages  
might go up, so we should re-bin eagerly to make sure we don't leave the  
segment in a bin that is too low for get_best_segment() to find.  
  
The re-binning code is moved into a function of its own, so it can be  
called whenever free pages are returned to the segment's free page map.  
  
Back-patch to all supported releases.  
  
Author: Dongming Liu <[email protected]>  
Reviewed-by: Robert Haas <[email protected]> (earlier version)  
Reviewed-by: Thomas Munro <[email protected]>  
Discussion: https://postgr.es/m/CAL1p7e8LzB2LSeAXo2pXCW4%2BRya9s0sJ3G_ReKOU%3DAjSUWjHWQ%40mail.gmail.com  

M src/backend/utils/mmgr/dsa.c

Fix race in SSI interaction with gin fast path.

commit   : 12529028a4e55eb0500477d2589eec625466facf    
  
author   : Thomas Munro <[email protected]>    
date     : Mon, 3 Jul 2023 16:20:01 +1200    
  
committer: Thomas Munro <[email protected]>    
date     : Mon, 3 Jul 2023 16:20:01 +1200    

Click here for diff

The ginfast.c code previously checked for conflicts in before locking  
the relevant buffer, leaving a window where a RW conflict could be  
missed.  Re-order.  
  
There was also a place where buffer ID and block number were confused  
while trying to predicate-lock a page, noted by visual inspection.  
  
Back-patch to all supported releases.  Fixes one more problem discovered  
with the reproducer from bug #17949, in this case when Dmitry tried  
other index types.  
  
Reported-by: Artem Anisimov <[email protected]>  
Reported-by: Dmitry Dolgov <[email protected]>  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Discussion: https://postgr.es/m/17949-a0f17035294a55e2%40postgresql.org  

M src/backend/access/gin/ginfast.c
M src/backend/access/gin/ginget.c

Fix race in SSI interaction with bitmap heap scan.

commit   : d03d9a2614fd58d4a9e90107f1700952333ce2a2    
  
author   : Thomas Munro <[email protected]>    
date     : Mon, 3 Jul 2023 16:18:20 +1200    
  
committer: Thomas Munro <[email protected]>    
date     : Mon, 3 Jul 2023 16:18:20 +1200    

Click here for diff

When performing a bitmap heap scan, we don't want to miss concurrent  
writes that occurred after we observed the heap's rs_nblocks, but before  
we took predicate locks on index pages.  Therefore, we can't skip  
fetching any heap tuples that are referenced by the index, because we  
need to test them all with CheckForSerializableConflictOut().  The  
old optimization that would ignore any references to blocks >=  
rs_nblocks gets in the way of that requirement, because it means that  
concurrent writes in that window are ignored.  
  
Removing that optimization shouldn't affect correctness at any isolation  
level, because any new tuples shouldn't be visible to an MVCC snapshot.  
There also shouldn't be any error-causing references to heap blocks past  
the end, because we should have held at least an AccessShareLock on the  
table before the index scan.  It can't get smaller while our transaction  
is running.  For now, though, we'll keep the optimization at lower  
levels to avoid making unnecessary changes in a bug fix.  
  
Back-patch to all supported releases.  In release 11, the code is in a  
different place but not fundamentally different.  Fixes one aspect of  
bug #17949.  
  
Reported-by: Artem Anisimov <[email protected]>  
Reviewed-by: Dmitry Dolgov <[email protected]>  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Discussion: https://postgr.es/m/17949-a0f17035294a55e2%40postgresql.org  

M src/backend/access/heap/heapam_handler.c

Fix race in SSI interaction with empty btrees.

commit   : 0cb1fb2c9bf8fdc27044082757cde79de1a8e482    
  
author   : Thomas Munro <[email protected]>    
date     : Mon, 3 Jul 2023 16:16:27 +1200    
  
committer: Thomas Munro <[email protected]>    
date     : Mon, 3 Jul 2023 16:16:27 +1200    

Click here for diff

When predicate-locking btrees, we have a special case for completely  
empty btrees, since there is no page to lock.  This was racy, because,  
without buffer lock held, a matching key could be inserted between the  
_bt_search() and the PredicateLockRelation() calls.  
  
Fix, by rechecking _bt_search() after taking the relation-level SIREAD  
lock, if using SERIALIZABLE isolation and an empty btree is discovered.  
  
Back-patch to all supported releases.  Fixes one aspect of bug #17949.  
  
Reported-by: Artem Anisimov <[email protected]>  
Reviewed-by: Dmitry Dolgov <[email protected]>  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Discussion: https://postgr.es/m/17949-a0f17035294a55e2%40postgresql.org  

M src/backend/access/nbtree/nbtsearch.c

Remove expensive test of postgres_fdw batch inserts

commit   : 6b488d5dc2fe4dc12e1ef15c0ea4c1a4e7170ae0    
  
author   : Tomas Vondra <[email protected]>    
date     : Mon, 3 Jul 2023 18:16:58 +0200    
  
committer: Tomas Vondra <[email protected]>    
date     : Mon, 3 Jul 2023 18:16:58 +0200    

Click here for diff

The test inserted 70k rows into a foreign table, in order to verify  
correct behavior with more than 65535 parameters, and was added in  
response to a bug report.  
  
However, this is rather expensive, especially when running the tests  
under valgrind, CLOBBER_CACHE_ALWAYS etc. It doesn't seem worth it to  
keep running the test, so remove it from all branches (14+).  
  
Backpatch-through: 14  
Discussion: https://postgr.es/m/[email protected]  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/sql/postgres_fdw.sql

Improve pg_basebackup long file name test Windows robustness

commit   : 16152705b31d12c339e3a9ee44ed43972a6ee96c    
  
author   : Andrew Dunstan <[email protected]>    
date     : Mon, 3 Jul 2023 10:06:26 -0400    
  
committer: Andrew Dunstan <[email protected]>    
date     : Mon, 3 Jul 2023 10:06:26 -0400    

Click here for diff

Creation of a file with a very long name can create problems on Windows  
due to its file path limits. Work around that by creating the file via a  
symlink with a shorter name.  
  
Error displayed by buildfarm animal fairywren.o  
  
Backpatch to all live branches  

M src/bin/pg_basebackup/t/010_pg_basebackup.pl

Make PG_TEST_NOCLEAN work for temporary directories in TAP tests

commit   : c24e9ef330ac7da1d1628d21b2d5defb0ec03c54    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 3 Jul 2023 10:06:13 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 3 Jul 2023 10:06:13 +0900    

Click here for diff

When set, this environment variable was only effective for data  
directories but not for all the other temporary files created by  
PostgreSQL::Test::Utils.  Keeping the temporary files after a successful  
run can be useful for debugging purposes.  
  
The documentation is updated to reflect the new behavior, with contents  
available in doc/ since v16 and in src/test/perl/README since v15.  
  
Author: Jacob Champion  
Reviewed-by: Daniel Gustafsson  
Discussion: https://postgr.es/m/CAAWbhmgHtDH1SGZ+Fw05CsXtE0mzTmjbuUxLB9mY9iPKgM6cUw@mail.gmail.com  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 11  

M doc/src/sgml/regress.sgml
M src/test/perl/PostgreSQL/Test/Utils.pm
M src/test/perl/README

Silence "missing contrecord" error.

commit   : 76d5966b3b798cc58025c77164fa944f2b6dd667    
  
author   : Thomas Munro <[email protected]>    
date     : Mon, 3 Jul 2023 10:53:44 +1200    
  
committer: Thomas Munro <[email protected]>    
date     : Mon, 3 Jul 2023 10:53:44 +1200    

Click here for diff

Commit dd38ff28ad added a new error message "missing contrecord" when  
we fail to reassemble a record.  Unfortunately that caused noisy  
messages to be logged by pg_waldump at end of segment, and by walsender  
when asked to shut down on a segment boundary.  
  
Remove the new error message, so that this condition signals end-of-  
WAL without a message.  It's arguably a reportable condition that should  
not be silenced while performing crash recovery, but fixing that without  
introducing noise in the other cases will require more research.  
  
Back-patch to 15.  
  
Reported-by: Tomas Vondra <[email protected]>  
Discussion: https://postgr.es/m/6a1df56e-4656-b3ce-4b7a-a9cb41df8189%40enterprisedb.com  

M src/backend/access/transam/xlogreader.c

Fix oversight in handling of modifiedCols since f24523672d

commit   : 9cf85093b55979e7d8ccfd9d0da21ce277a2f321    
  
author   : Tomas Vondra <[email protected]>    
date     : Sun, 2 Jul 2023 20:29:01 +0200    
  
committer: Tomas Vondra <[email protected]>    
date     : Sun, 2 Jul 2023 20:29:01 +0200    

Click here for diff

Commit f24523672d fixed a memory leak by moving the modifiedCols bitmap  
into the per-row memory context. In the case of AFTER UPDATE triggers,  
the bitmap is however referenced from an event kept until the end of the  
query, resulting in a use-after-free bug.  
  
Fixed by copying the bitmap into the AfterTriggerEvents memory context,  
which is the one where we keep the trigger events. There's only one  
place that needs to do the copy, but the memory context may not exist  
yet. Doing that in a separate function seems more readable.  
  
Report by Alexander Pyhalov, fix by me. Backpatch to 13, where the  
bitmap was added to the event by commit 71d60e2aa0.  
  
Reported-by: Alexander Pyhalov  
Backpatch-through: 13  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/commands/trigger.c

Fix memory leak in Incremental Sort rescans

commit   : 9ae7b5d1f3ad2dc31ba7552a19d2efb24e7dbc0e    
  
author   : Tomas Vondra <[email protected]>    
date     : Sun, 2 Jul 2023 18:54:09 +0200    
  
committer: Tomas Vondra <[email protected]>    
date     : Sun, 2 Jul 2023 18:54:09 +0200    

Click here for diff

The Incremental Sort had a couple issues, resulting in leaking memory  
during rescans, possibly triggering OOM. The code had a couple of  
related flaws:  
  
1. During rescans, the sort states were reset but then also set to NULL  
   (despite the comment saying otherwise). ExecIncrementalSort then  
   sees NULL and initializes a new sort state, leaking the memory used  
   by the old one.  
  
2. Initializing the sort state also automatically rebuilt the info about  
   presorted keys, leaking the already initialized info. presorted_keys  
   was also unnecessarily reset to NULL.  
  
Patch by James Coleman, based on patches by Laurenz Albe and Tom Lane.  
Backpatch to 13, where Incremental Sort was introduced.  
  
Author: James Coleman, Laurenz Albe, Tom Lane  
Reported-by: Laurenz Albe, Zu-Ming Jiang  
Backpatch-through: 13  
Discussion: https://postgr.es/m/b2bd02dff61af15e3526293e2771f874cf2a3be7.camel%40cybertec.at  
Discussion: https://postgr.es/m/db03c582-086d-e7cd-d4a1-3bc722f81765%40inf.ethz.ch  

M src/backend/executor/nodeIncrementalSort.c

Fix test of pg_stat_io for wal_level=minimal.

commit   : cb5fd121d539b5c1ed91c5609c04e603c1bc8b50    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 1 Jul 2023 10:00:39 -0700    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 1 Jul 2023 10:00:39 -0700    

Click here for diff

Back-patch to v16, which introduced the test.  

M contrib/amcheck/expected/check_heap.out
M contrib/amcheck/sql/check_heap.sql

doc: PG 16 relnotes, remove "Have initdb use ICU by default"

commit   : c729642bd760c9d450592e3904d8d093b438b592    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 30 Jun 2023 17:35:47 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 30 Jun 2023 17:35:47 -0400    

Click here for diff

Item reverted.  
  
Backpatch-through: 16 only  

M doc/src/sgml/release-16.sgml

Add a test case for a316a3bc

commit   : 0a14bca662a44310305ad3fcc1079ef75d4a6316    
  
author   : Amit Langote <[email protected]>    
date     : Fri, 30 Jun 2023 15:48:54 +0900    
  
committer: Amit Langote <[email protected]>    
date     : Fri, 30 Jun 2023 15:48:54 +0900    

Click here for diff

a316a3bc fixed the code in build_simpl_rel() that propagates  
RelOptInfo.userid from parent to child rels so that it works  
correctly for the child rels of a UNION ALL subquery rel, though  
no tests were added in that commit.  So do so here.  
  
As noted in the discussion, coming up with a test case in the core  
regression suite for this fix has turned out to be tricky, so the  
test case is added to the postgres_fdw's suite instead.  
postgresGetForeignRelSize()'s use of user mapping for the user  
specified in RelOptInfo.userid makes it relatively easier to craft  
a test case around.  
  
Discussion: https://postgr.es/m/CA%2BHiwqH91GaFNXcXbLAM9L%3DzBwUmSyv699Mtv3i1_xtk9Xec_A%40mail.gmail.com  
Backpatch-through: 16  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/sql/postgres_fdw.sql

Fix marking of indisvalid for partitioned indexes at creation

commit   : f4691e2e76a4ba6a340668160d8008124c2140a0    
  
author   : Michael Paquier <[email protected]>    
date     : Fri, 30 Jun 2023 13:54:53 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Fri, 30 Jun 2023 13:54:53 +0900    

Click here for diff

The logic that introduced partitioned indexes missed a few things when  
invalidating a partitioned index when these are created, still the code  
is written to handle recursions:  
1) If created from scratch because a mapping index could not be found,  
the new index created could be itself invalid, if for example it was a  
partitioned index with one of its leaves invalid.  
2) A CCI was missing when indisvalid is set for a parent index, leading  
to inconsistent trees when recursing across more than one level for a  
partitioned index creation if an invalidation of the parent was  
required.  
  
This could lead to the creation of a partition index tree where some of  
the partitioned indexes are marked as invalid, but some of the parents  
are marked valid, which is not something that should happen (as  
validatePartitionedIndex() defines, indisvalid is switched to true for a  
partitioned index iff all its partitions are themselves valid).  
  
This patch makes sure that indisvalid is set to false on a partitioned  
index if at least one of its partition is invalid.  The flag is set to  
true if *all* its partitions are valid.  
  
The regression test added in this commit abuses of a failed concurrent  
index creation, marked as invalid, that maps with an index created on  
its partitioned table afterwards.  
  
Reported-by: Alexander Lakhin  
Reviewed-by: Alexander Lakhin  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 11  

M src/backend/commands/indexcmds.c
M src/test/regress/expected/indexing.out
M src/test/regress/sql/indexing.sql

Arm gen_node_support.pl's nodetag ABI stability check in v16.

commit   : 871d342bf3d51a7502ce7dfcbd7fe1682e1cb8fb    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 29 Jun 2023 19:14:22 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 29 Jun 2023 19:14:22 -0400    

Click here for diff

Per RELEASE_CHANGES checklist.  

M src/backend/nodes/gen_node_support.pl

Fix pg_depend entry to AMs after ALTER TABLE .. SET ACCESS METHOD

commit   : 97d89101045fac8cb36f4ef6c08526ea0841a596    
  
author   : Michael Paquier <[email protected]>    
date     : Fri, 30 Jun 2023 07:49:01 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Fri, 30 Jun 2023 07:49:01 +0900    

Click here for diff

ALTER TABLE .. SET ACCESS METHOD was not registering a dependency to the  
new access method with the relation altered in its rewrite phase, making  
possible the drop of an access method even if there are relations that  
depend on it.  During the rewrite, a temporary relation is created to  
build the new relation files before swapping the new and old files, and,  
while the temporary relation was registering a correct dependency to the  
new AM, the old relation did not do that.  A dependency on the access  
method is added when the relation files are swapped, which is the point  
where pg_class is updated.  
  
Materialized views and tables use the same code path, hence both were  
impacted.  
  
Backpatch down to 15, where this command has been introduced.  
  
Reported-by: Alexander Lakhin  
Reviewed-by: Nathan Bossart, Andres Freund  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 15  

M src/backend/commands/cluster.c
M src/test/regress/expected/create_am.out
M src/test/regress/sql/create_am.sql

meson: Remove redundant return code check

commit   : 5f87a021257f1ea1cacdced0cf49ff1c58ecf5e9    
  
author   : Andres Freund <[email protected]>    
date     : Thu, 29 Jun 2023 09:12:52 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Thu, 29 Jun 2023 09:12:52 -0700    

Click here for diff

run_command(check: true) already would have errorred out before the check is  
reached.  
  
Author: Tristan Partin <[email protected]>  
Discussion: CSPIJVUDZFKX.3KHMOAVGF94RV@c3po  

M meson.build

Defend against bogus parameterization of join input paths.

commit   : a798660ebe3ff1feb310db13b957c5cda4c8c50d    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 29 Jun 2023 12:12:52 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 29 Jun 2023 12:12:52 -0400    

Click here for diff

An outer join cannot be formed using an input path that is parameterized  
by a value that is supposed to be nulled by the outer join.  This is  
obviously nonsensical, and it could lead to a bad plan being selected;  
although currently it seems that we'll hit various sanity-check  
assertions first.  
  
I think that such cases were formerly prevented by the delay_upper_joins  
mechanism, but now that that's gone we need an explicit check.  
  
(Perhaps we should avoid generating baserel paths that could  
lead to this situation in the first place; but it seems like  
having a defense at the join level would be a good idea anyway.)  
  
Richard Guo and Tom Lane, per report from Jaime Casanova  
  
Discussion: https://postgr.es/m/CAJKUy5g2uZRrUDZJ8p-=giwcSHVUn0c9nmdxPSY0jF0Ov8VoEA@mail.gmail.com  

M src/backend/optimizer/path/joinpath.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Fix order of operations in ExecEvalFieldStoreDeForm().

commit   : 43af714defa00145981eb542cb71647836b3efa4    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 29 Jun 2023 10:19:10 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 29 Jun 2023 10:19:10 -0400    

Click here for diff

If the given composite datum is toasted out-of-line,  
DatumGetHeapTupleHeader will perform database accesses to detoast it.  
That can invalidate the result of get_cached_rowtype, as documented  
(perhaps not plainly enough) in that function's API spec; which leads  
to strange errors or crashes when we try to use the TupleDesc to read  
the tuple.  In short then, trying to update a field of a composite  
column could fail intermittently if the overall column value is wide  
enough to require toasting.  
  
We can fix the bug at no cost by just changing the order of  
operations, since we don't need the TupleDesc until after detoasting.  
(Other callers of get_cached_rowtype appear to get this right already,  
so there's only one bug.)  
  
Note that the added regression test case reveals this bug reliably  
only with debug_discard_caches/CLOBBER_CACHE_ALWAYS.  
  
Per bug #17994 from Alexander Lakhin.  Sadly, this patch does not fix  
the missing-values issue revealed in the bug discussion; we'll need  
some more work to cover that.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/executor/execExprInterp.c
M src/test/regress/expected/rowtypes.out
M src/test/regress/sql/rowtypes.sql

meson: Fix intl misspelling

commit   : b750e74e6ec324f4c9de82587cb6a07490f86cfe    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 13:16:52 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 13:16:52 +0200    

Click here for diff

Author: Tristan Partin <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CSPIJVUDZFKX.3KHMOAVGF94RV%40c3po  

M meson.build

meson: Use a better error message in an impossible case

commit   : 99e57663518b0eaf8fa69d20d0e796321bc8e558    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 13:06:41 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 13:06:41 +0200    

Click here for diff

Meson validates 'choice' options for us, so technically this case is  
impossible. A better error message helps people reading the code  
understand what is going on in that branch.  
  
Author: Tristan Partin <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CSPIJVUDZFKX.3KHMOAVGF94RV%40c3po  

M meson.build

meson: Make some Meson style more consistent with surrounding code

commit   : af492eb6d6c90cf470c544083d3b6b3648f1bea2    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 13:06:02 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 13:06:02 +0200    

Click here for diff

Author: Tristan Partin <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CSPIJVUDZFKX.3KHMOAVGF94RV%40c3po  

M meson.build
M src/include/meson.build

meson: Fix some grammar usage in Meson comments

commit   : 74668cbf0fcc356faef271aa2fb42896e323f8b1    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 13:05:05 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 13:05:05 +0200    

Click here for diff

Author: Tristan Partin <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CSPIJVUDZFKX.3KHMOAVGF94RV%40c3po  

M meson.build

meson: Mention the correct way to disable readline support

commit   : f5159c734fe41526805c49d62c61fb2f320531e0    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 13:04:04 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 13:04:04 +0200    

Click here for diff

Using false to disable a feature option is incorrect.  
  
Author: Tristan Partin <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CSPIJVUDZFKX.3KHMOAVGF94RV%40c3po  

M meson.build

meson: Remove old comment

commit   : 45c88eecb4a6cf286b2bd8fc977ccf932525933a    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 13:03:19 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 13:03:19 +0200    

Click here for diff

That portion of code is not run in the Windows case already given the  
structure of the surrounding if statement.  
  
Author: Tristan Partin <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CSPIJVUDZFKX.3KHMOAVGF94RV%40c3po  

M meson.build

meson: Use the not_found_dep constant

commit   : 38977dd2bdacdfa5ca36377d3197029993929d7f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 12:56:30 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 12:56:30 +0200    

Click here for diff

Previously in the build description, a not_found_dep was defined. Make  
use of it.  
  
Author: Tristan Partin <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CSPIJVUDZFKX.3KHMOAVGF94RV%40c3po  

M meson.build

meson: Attach colon to keyword argument

commit   : c55d31e59c8980147b2103cbcf5ef0c3e6434f70    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 12:53:41 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 12:53:41 +0200    

Click here for diff

This matches the style found in the rest of the Meson build description.  
  
Author: Tristan Partin <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CSPIJVUDZFKX.3KHMOAVGF94RV%40c3po  

M meson_options.txt

meson: Use consistent Meson option description formats

commit   : b2ec7f543f9e3b9ab1ad21e5512cfe5c6c2b4a6f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 12:52:12 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 12:52:12 +0200    

Click here for diff

Author: Tristan Partin <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CSPIJVUDZFKX.3KHMOAVGF94RV%40c3po  

M meson_options.txt

meson: Use consistent casing in Meson option descriptions

commit   : 529449c379b9248ad1b2b8af308799a149a6d0c1    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 12:47:33 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 12:47:33 +0200    

Click here for diff

Meson itself uses capital letters for option descriptions, so follow  
that.  
  
Author: Tristan Partin <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CSPIJVUDZFKX.3KHMOAVGF94RV%40c3po  

M meson_options.txt

meson: Remove triple-quoted strings

commit   : 559bdd58eb712d413aff662cf797a7a4598baf00    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 12:44:27 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 12:44:27 +0200    

Click here for diff

Triple-quoted strings are for multiline strings in Meson. None of the  
descriptions that got changed were multiline and the entire file uses  
single-line descriptions.  
  
Author: Tristan Partin <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CSPIJVUDZFKX.3KHMOAVGF94RV%40c3po  

M meson_options.txt

Remove inappropriate raw_expression_tree_walker() code

commit   : efcf55f8fe00b46198cd34557431c87ce5da8040    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 10:30:55 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 10:30:55 +0200    

Click here for diff

It was walking into the ColumnDef->compression field, which is not a  
node but a string.  This code is currently not reachable (because the  
compression field is only set in situations that don't go through  
raw_expression_tree_walker()), but if it had been, this could have  
behaved erratically.  

M src/backend/nodes/nodeFuncs.c

Error message wording improvements

commit   : 39a584dc90324b7323424d7450df8586ab2a0ca1    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 09:14:55 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 29 Jun 2023 09:14:55 +0200    

Click here for diff

M src/backend/commands/user.c
M src/backend/storage/ipc/signalfuncs.c
M src/backend/utils/init/postinit.c
M src/test/regress/expected/create_role.out

Fix psql \?'s entries for \dp and \z.

commit   : dda9f8e7bc2e1e5cc6c77b86ce54786e9df8e0c6    
  
author   : Nathan Bossart <[email protected]>    
date     : Wed, 28 Jun 2023 21:32:53 -0700    
  
committer: Nathan Bossart <[email protected]>    
date     : Wed, 28 Jun 2023 21:32:53 -0700    

Click here for diff

d913928c9c added support for the "S" modifier to psql's \dp and \z  
meta-commands, but it missed updating the corresponding entries in  
\?'s output.  
  
Author: Noriyoshi Shinoda  
Discussion: https://postgr.es/m/DM4PR84MB17342A51B3A1556CFBC7A4B2EE25A%40DM4PR84MB1734.NAMPRD84.PROD.OUTLOOK.COM  

M src/bin/psql/help.c

pg_stat_statements: Fix second comment related to entry resets

commit   : bc8e9a6a25e1674d49b977c1d3fc80e7c22f5b30    
  
author   : Michael Paquier <[email protected]>    
date     : Thu, 29 Jun 2023 09:17:26 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Thu, 29 Jun 2023 09:17:26 +0900    

Click here for diff

This should have been part of dc73db6, but it got lost in the mix.  
Oversight in 6b4d23f.  
  
Author: Japin Li  
Discussion: https://postgr.es/m/MEYP282MB1669FC91C764E277821936D3B624A@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM  
Backpatch-through: 14  

M contrib/pg_stat_statements/pg_stat_statements.c

pg_stat_statements: Fix incorrect comment with entry resets

commit   : dc73db67433c5a9ee0d7a7dc788178553ef8afce    
  
author   : Michael Paquier <[email protected]>    
date     : Thu, 29 Jun 2023 08:04:47 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Thu, 29 Jun 2023 08:04:47 +0900    

Click here for diff

Oversight in 6b4d23f.  
  
Author: Japin Li, Richard Guo  
Discussion: https://postgr.es/m/MEYP282MB1669FC91C764E277821936D3B624A@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM  
Backpatch-through: 14  

M contrib/pg_stat_statements/pg_stat_statements.c

Reword error messages for consistency

commit   : 046c8c5c8fe26fbce3ba773d49c81e6bbdf73db1    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 28 Jun 2023 19:30:26 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 28 Jun 2023 19:30:26 +0200    

Click here for diff

M src/backend/replication/logical/applyparallelworker.c

Doc: minor wording adjustments in transaction isolation discussion.

commit   : ac1e974221cb11465c126097243d5b5050b8d041    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 28 Jun 2023 12:48:14 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 28 Jun 2023 12:48:14 -0400    

Click here for diff

Re-word for more clarity, per gripe from Anton Sidyakin.  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/mvcc.sgml

Add timeline ID to file names generated with pg_waldump --save-fullpage

commit   : b381d9637030c163c3b1f8a9d3de51dfc1b4ee58    
  
author   : Michael Paquier <[email protected]>    
date     : Wed, 28 Jun 2023 16:26:55 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Wed, 28 Jun 2023 16:26:55 +0900    

Click here for diff

Not including the timeline IDs to the file names generated by pg_waldump  
for the individual blocks saved could cause some of these files to be  
overwritten when scanning segments across multiple timelines.  Having  
this information is also as much useful as the LSNs, to be able to know  
from exactly which WAL segment a block is comes from.  
  
While on it, this fixes a few comments in the tests, where the format of  
the file was not described as matching with the reality.  
  
Reported-by: Fujii Masao  
Reviewed-by: Kyotaro Horiguchi, David Christensen  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/ref/pg_waldump.sgml
M src/bin/pg_waldump/pg_waldump.c
M src/bin/pg_waldump/t/002_save_fullpage.pl

Ignore invalid indexes when enforcing index rules in ALTER TABLE ATTACH PARTITION

commit   : fc55c7ff8d122feb48aae5889e26499ffe53c0b7    
  
author   : Michael Paquier <[email protected]>    
date     : Wed, 28 Jun 2023 15:57:31 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Wed, 28 Jun 2023 15:57:31 +0900    

Click here for diff

A portion of ALTER TABLE .. ATTACH PARTITION is to ensure that the  
partition being attached to the partitioned table has a correct set of  
indexes, so as there is a consistent index mapping between the  
partitioned table and its new-to-be partition.  However, as introduced  
in 8b08f7d, the current logic could choose an invalid index as a match,  
which is something that can exist when dealing with more than two levels  
of partitioning, like attaching a partitioned table (that has  
partitions, with an index created by CREATE INDEX ON ONLY) to another  
partitioned table.  
  
A partitioned index with indisvalid set to false is equivalent to an  
incomplete partition tree, meaning that an invalid partitioned index  
does not have indexes defined in all its partitions.  Hence, choosing an  
invalid partitioned index can create inconsistent partition index trees,  
where the parent attaching to is valid, but its partition may be  
invalid.  
  
In the report from Alexander Lakhin, this showed up as an assertion  
failure when validating an index.  Without assertions enabled, the  
partition index tree would be actually broken, as indisvalid should  
be switched to true for a partitioned index once all its partitions are  
themselves valid.  With two levels of partitioning, the top partitioned  
table used a valid index and was able to link to an invalid index stored  
on its partition, itself a partitioned table.  
  
I have studied a few options here (like the possibility to switch  
indisvalid to false for the parent), but came down to the conclusion  
that we'd better rely on a simple rule: invalid indexes had better never  
be chosen, so as the partition attached uses and creates indexes that  
the parent expects.  Some regression tests are added to provide some  
coverage.  Note that the existing coverage is not impacted.  
  
This is a problem since partitioned indexes exist, so backpatch all the  
way down to v11.  
  
Reported-by: Alexander Lakhin  
Discussion: https://postgr.es/[email protected]  
Backpatch-through: 11  

M src/backend/commands/tablecmds.c
M src/test/regress/expected/indexing.out
M src/test/regress/sql/indexing.sql

Remove dependency to query text in JumbleQuery()

commit   : 2ecbb0a49359759b46dd82df4ac3a083c36b1db4    
  
author   : Michael Paquier <[email protected]>    
date     : Wed, 28 Jun 2023 08:59:36 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Wed, 28 Jun 2023 08:59:36 +0900    

Click here for diff

Since 3db72eb, the query ID of utilities is generated using the Query  
structure, making the use of the query string in JumbleQuery()  
unnecessary.  This commit removes the argument "querytext" from  
JumbleQuery().  
  
Reported-by: Joe Conway  
Reviewed-by: Nathan Bossart  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/commands/explain.c
M src/backend/nodes/queryjumblefuncs.c
M src/backend/parser/analyze.c
M src/include/nodes/queryjumble.h

Fix comment on clearing padding.

commit   : 876d17d62fe84d706058f2458f067f0e9049a230    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 27 Jun 2023 10:11:31 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 27 Jun 2023 10:11:31 +0300    

Click here for diff

Author: Japin Li  
Discussion: https://www.postgresql.org/message-id/MEYP282MB16696317B5DA7D0D92306149B627A@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM  

M contrib/pg_stat_statements/pg_stat_statements.c

Stamp 16beta2.

commit   : 19508f4763b6e55baae788af000ee47e74d24370    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 26 Jun 2023 16:07:19 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 26 Jun 2023 16:07:19 -0400    

Click here for diff

M configure
M configure.ac
M meson.build

doc: PG 16 relnotes, update for beta 2

commit   : 228a2fab9cdee8bad434a0037e8f5e85c6f30002    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 26 Jun 2023 13:44:40 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 26 Jun 2023 13:44:40 -0400    

Click here for diff

M doc/src/sgml/release-16.sgml

Translation updates

commit   : 3f0199da5a61fd7deff52889679a1a896b41e8ee    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 26 Jun 2023 12:02:02 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 26 Jun 2023 12:02:02 +0200    

Click here for diff

Source-Git-URL: https://git.postgresql.org/git/pgtranslation/messages.git  
Source-Git-Hash: ab77975e9d2cde44da796c18af3ec1a66f0df7ae  

M src/backend/po/de.po
M src/backend/po/ja.po
M src/bin/initdb/po/de.po
M src/bin/initdb/po/es.po
M src/bin/initdb/po/ja.po
M src/bin/initdb/po/ka.po
M src/bin/scripts/po/de.po
M src/bin/scripts/po/ja.po
M src/interfaces/libpq/po/de.po
M src/interfaces/libpq/po/ja.po
M src/pl/plpython/po/ka.po

Change "..." to cstring in old input/output function comments.

commit   : b491a15f8c1468097ca181cbe3a4ce1271781ffb    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 26 Jun 2023 11:52:02 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 26 Jun 2023 11:52:02 +0300    

Click here for diff

It was not clear what the "..." meant.  
  
Author: Steve Chavez  
Discussion: https://www.postgresql.org/message-id/CAGRrpzZzeh7zC3yaVG9di%3DydJ%[email protected]  

M src/backend/utils/adt/name.c
M src/backend/utils/adt/varlena.c

Check for interrupts and stack overflow in TParserGet().

commit   : 691594acd67e68d903ea1b7575a7a9097772bbcb    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 24 Jun 2023 17:18:08 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 24 Jun 2023 17:18:08 -0400    

Click here for diff

TParserGet() recurses for some token types, meaning it's possible  
to drive it to stack overflow.  Since this is a minority behavior,  
I chose to add the check_stack_depth() call to the two places that  
recurse rather than doing it during every single call.  
  
While at it, add CHECK_FOR_INTERRUPTS(), because this can run  
unpleasantly long for long inputs.  
  
Per bug #17995 from Zuming Jiang.  This is old, so back-patch  
to all supported branches.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/tsearch/wparser_def.c

doc: rename "decades" to be more generic

commit   : 239fd118b0923c7b3e28354e13fb7cea42f729e1    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 23 Jun 2023 22:50:55 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 23 Jun 2023 22:50:55 -0400    

Click here for diff

Reported-by: Michael Paquier  
  
Discussion: https://postgr.es/m/[email protected]  
  
Backpatch-through: 11  

M doc/src/sgml/history.sgml

Error message refactoring

commit   : 3ad5f07c0fe9a734fb4e2484c7165f9280dbefa7    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 23 Jun 2023 16:36:17 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 23 Jun 2023 16:36:17 +0200    

Click here for diff

Take some untranslatable things out of the message and replace by  
format placeholders, to reduce translatable strings and reduce  
translation mistakes.  

M src/backend/replication/logical/launcher.c
M src/backend/replication/slot.c
M src/backend/storage/lmgr/lock.c
M src/backend/storage/lmgr/predicate.c

doc: Improve punctuation

commit   : b63cda34e2bbdd17be53cf1452f7238fc9385d6c    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 23 Jun 2023 14:48:38 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 23 Jun 2023 14:48:38 +0200    

Click here for diff

M doc/src/sgml/logical-replication.sgml

doc: Clean up title case use

commit   : 37a6d81c457fd507bac0a08758a5dcff5c6225f7    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 23 Jun 2023 14:14:57 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 23 Jun 2023 14:14:57 +0200    

Click here for diff

M doc/src/sgml/ref/pg_rewind.sgml
M doc/src/sgml/ref/select.sgml
M doc/src/sgml/regress.sgml

Fix incorrect error message in libpq_pipeline

commit   : f69a7f08fd01aa7d6dcd2c34dbdc4eb154a5ec12    
  
author   : Michael Paquier <[email protected]>    
date     : Fri, 23 Jun 2023 17:49:07 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Fri, 23 Jun 2023 17:49:07 +0900    

Click here for diff

One of the tests for the pipeline mode with portal description expects a  
non-NULL PQgetResult, but used an incorrect error message on failure,  
telling that PQgetResult being NULL was the expected result.  
  
Author: Jelte Fennema  
Discussion: https://postgr.es/m/CAGECzQTkShHecFF+EZrm94Lbsu2ej569T=bz+PjMbw9Aiioxuw@mail.gmail.com  
Backpatch-through: 14  

M src/test/modules/libpq_pipeline/libpq_pipeline.c

Improve privilege documentation for maintenance commands.

commit   : c2122aae636d7121d5cdb64ad1444e1df7f69257    
  
author   : Nathan Bossart <[email protected]>    
date     : Thu, 22 Jun 2023 15:48:38 -0700    
  
committer: Nathan Bossart <[email protected]>    
date     : Thu, 22 Jun 2023 15:48:38 -0700    

Click here for diff

The documentation of the required privileges for maintenance  
commands (i.e., VACUUM, ANALYZE, CLUSTER, LOCK TABLE, REFRESH  
MATERIALIZED VIEW, and REINDEX) is redundant, inaccurate, and  
difficult to read.  This commit fixes and simplifies this  
documentation by removing references to ownership, superuser, and  
the pg_maintain role.  In addition, this removes notes about  
database-wide VACUUM and ANALYZE, clarifies matters for REINDEX on  
partitioned indexes and tables, and strengthens the description of  
the pg_maintain role.  
  
Reviewed-by: Michael Paquier, Jeff Davis  
Discussion: https://postgr.es/m/20230615041044.GA736001%40nathanxps13  

M doc/src/sgml/ref/analyze.sgml
M doc/src/sgml/ref/cluster.sgml
M doc/src/sgml/ref/lock.sgml
M doc/src/sgml/ref/refresh_materialized_view.sgml
M doc/src/sgml/ref/reindex.sgml
M doc/src/sgml/ref/vacuum.sgml
M doc/src/sgml/user-manag.sgml

Fix cache lookup hazards introduced by ff9618e82a.

commit   : 4dbdb82513b65ab3a29e431f0233009c8a0fa890    
  
author   : Nathan Bossart <[email protected]>    
date     : Thu, 22 Jun 2023 15:48:20 -0700    
  
committer: Nathan Bossart <[email protected]>    
date     : Thu, 22 Jun 2023 15:48:20 -0700    

Click here for diff

ff9618e82a introduced has_partition_ancestor_privs(), which is used  
to check whether a user has MAINTAIN on any partition ancestors.  
This involves syscache lookups, and presently this function does  
not take any relation locks, so it is likely subject to the same  
kind of cache lookup failures that were fixed by 19de0ab23c.  
  
To fix this problem, this commit partially reverts ff9618e82a.  
Specifically, it removes the partition-related changes, including  
the has_partition_ancestor_privs() function mentioned above.  This  
means that MAINTAIN on a partitioned table is no longer sufficient  
to perform maintenance commands on its partitions.  This is more  
like how privileges for maintenance commands work on supported  
versions.  Privileges are checked for each partition, so a command  
that flows down to all partitions might refuse to process them  
(e.g., if the current user doesn't have MAINTAIN on the partition).  
  
In passing, adjust a few related comments and error messages, and  
add a test for the privilege checks for CLUSTER on a partitioned  
table.  
  
Reviewed-by: Michael Paquier, Jeff Davis  
Discussion: https://postgr.es/m/20230613211246.GA219055%40nathanxps13  

M doc/src/sgml/ref/analyze.sgml
M doc/src/sgml/ref/cluster.sgml
M doc/src/sgml/ref/lock.sgml
M doc/src/sgml/ref/reindex.sgml
M doc/src/sgml/ref/vacuum.sgml
M src/backend/commands/cluster.c
M src/backend/commands/indexcmds.c
M src/backend/commands/lockcmds.c
M src/backend/commands/tablecmds.c
M src/backend/commands/vacuum.c
M src/include/commands/tablecmds.h
M src/test/isolation/expected/cluster-conflict-partition.out
M src/test/isolation/specs/cluster-conflict-partition.spec
M src/test/regress/expected/cluster.out
M src/test/regress/expected/create_index.out
M src/test/regress/expected/privileges.out
M src/test/regress/expected/vacuum.out
M src/test/regress/sql/cluster.sql

Doc: Clarify the behavior of triggers/rules in a logical subscriber.

commit   : f5c446e3367527f9db1506d7c38d2f56e20950b6    
  
author   : Amit Kapila <[email protected]>    
date     : Thu, 22 Jun 2023 12:37:19 +0530    
  
committer: Amit Kapila <[email protected]>    
date     : Thu, 22 Jun 2023 12:37:19 +0530    

Click here for diff

By default, triggers and rules do not fire on a logical replication  
subscriber based on the "session_replication_role" GUC being set to  
"replica". However, the docs in the logical replication section assumed  
that the reader understood how this GUC worked. This modifies the docs to  
be more explicit and links back to the GUC itself.  
  
Author: Jonathan Katz, Peter Smith  
Reviewed-by: Vignesh C, Euler Taveira  
Backpatch-through: 11  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/logical-replication.sgml

Doc: mention that extended stats aren't used for joins

commit   : c2d35bb88eab99fd81198fa4caee004fb8997c73    
  
author   : David Rowley <[email protected]>    
date     : Thu, 22 Jun 2023 12:45:30 +1200    
  
committer: David Rowley <[email protected]>    
date     : Thu, 22 Jun 2023 12:45:30 +1200    

Click here for diff

Statistics defined by the CREATE STATISTICS command are only used to  
assist with the selectivity estimations of base relations, never for  
joins.  Here we mention this fact in the notes section of the CREATE  
STATISTICS command.  
  
Discussion: https://postgr.es/m/CAApHDvrMuVgDOrmg_EtFDZ=AOovq6EsJNnHH1ddyZ8EqL4yzMw@mail.gmail.com  
Backpatch-through: 11  

M doc/src/sgml/ref/create_statistics.sgml

nbtree VACUUM: cope with topparent inconsistencies.

commit   : 5f0762f14754597724c24cf6517fe4fe6412a6f9    
  
author   : Peter Geoghegan <[email protected]>    
date     : Wed, 21 Jun 2023 17:41:58 -0700    
  
committer: Peter Geoghegan <[email protected]>    
date     : Wed, 21 Jun 2023 17:41:58 -0700    

Click here for diff

Avoid "right sibling %u of block %u is not next child" errors when  
vacuuming a corrupt nbtree index.  Just LOG the issue and press on.  
That way VACUUM will have a decent chance of finishing off all required  
processing for the index (and for the table as a whole).  
  
This is similar to recent work from commit 5abff197, as well as work  
from commit 5b861baa (later backpatched as commit 43e409ce), which  
taught nbtree VACUUM to keep going when its "re-find" check fails.  The  
hardening added by this commit takes place directly after the "re-find"  
check, right before the critical section for the first stage of page  
deletion.  
  
Author: Peter Geoghegan <[email protected]>  
Discussion: https://postgr.es/m/CAH2-Wz=dayg0vjs4+er84TS9ami=csdzjpuiCGbEw=idhwqhzQ@mail.gmail.com  
Backpatch: 11- (all supported versions).  

M src/backend/access/nbtree/nbtpage.c

doc: update PG history as over "three decades"

commit   : 05ffc1fadbe0ce7762b209061634b5857b36e1b8    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 21 Jun 2023 19:20:07 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 21 Jun 2023 19:20:07 -0400    

Click here for diff

Reported-by: Pierre <[email protected]>  
  
Discussion: https://postgr.es/m/[email protected]  
  
Backpatch-through: 11  

M doc/src/sgml/history.sgml

ICU: do not convert locale 'C' to 'en-US-u-va-posix'.

commit   : f3a01af29b1941ca7937a45504ab10ef5f99cdff    
  
author   : Jeff Davis <[email protected]>    
date     : Wed, 21 Jun 2023 13:18:25 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Wed, 21 Jun 2023 13:18:25 -0700    

Click here for diff

Older versions of ICU canonicalize "C" to "en-US-u-va-posix"; but  
starting in ICU version 64, the "C" locale is considered  
obsolete. Postgres commit ea1db8ae70 introduced code to always  
canonicalize "C" to "en-US-u-va-posix" for consistency and  
convenience, but it was deemed too confusing.  
  
This commit removes that code, so that "C" is treated like other ICU  
locale names: canonicalization is attempted, and if it fails, the  
behavior is controlled by icu_validation_level.  
  
A similar change was previously committed as f7faa9976c, then reverted  
due to an ICU-version-dependent test failure. This commit un-reverts  
it, omitting the test because we now expect the behavior to depend on  
the version of ICU being used.  
  
Discussion: https://postgr.es/m/3a200aca-4672-4b37-fc91-5d198a323503%40eisentraut.org  
Discussion: https://postgr.es/m/[email protected]  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/utils/adt/pg_locale.c
M src/bin/initdb/initdb.c
M src/test/regress/expected/collate.icu.utf8.out
M src/test/regress/sql/collate.icu.utf8.sql

initdb: change default --locale-provider back to libc.

commit   : 2535c74b1a6190cc42e13f6b6b55d94bff4b7dd6    
  
author   : Jeff Davis <[email protected]>    
date     : Wed, 21 Jun 2023 11:10:03 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Wed, 21 Jun 2023 11:10:03 -0700    

Click here for diff

Reverts 27b62377b4.  
  
Discussion: https://postgr.es/m/[email protected]  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/ref/initdb.sgml
M src/bin/initdb/initdb.c
M src/bin/initdb/t/001_initdb.pl
M src/bin/pg_dump/t/002_pg_dump.pl
M src/bin/scripts/t/020_createdb.pl
M src/test/icu/t/010_database.pl
M src/test/regress/expected/collate.icu.utf8.out
M src/test/regress/sql/collate.icu.utf8.sql

Avoid Assert failure when processing empty statement in aborted xact.

commit   : 555b929bbe7bd2f228e804d2c5bf4a246a319358    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 21 Jun 2023 11:07:11 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 21 Jun 2023 11:07:11 -0400    

Click here for diff

exec_parse_message() wants to create a cached plan in all cases,  
including for empty input.  The empty-input path does not have  
a test for being in an aborted transaction, making it possible  
that plancache.c will fail due to trying to do database lookups  
even though there's no real work to do.  
  
One solution would be to throw an aborted-transaction error in  
this path too, but it's not entirely clear whether the lack of  
such an error was intentional or whether some clients might be  
relying on non-error behavior.  Instead, let's hack plancache.c  
so that it treats empty statements with the same logic it  
already had for transaction control commands, ensuring that it  
can soldier through even in an already-aborted transaction.  
  
Per bug #17983 from Alexander Lakhin.  Back-patch to all  
supported branches.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/utils/cache/plancache.c
M src/test/regress/expected/psql.out
M src/test/regress/sql/psql.sql

Allow and require passing files on command line of pgperltidy

commit   : 3d9fd1a8743abfe460137f45e8523e710c7cc589    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 21 Jun 2023 16:14:47 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 21 Jun 2023 16:14:47 +0200    

Click here for diff

pgperltidy as well as pgperlcritic and pgperlsyncheck now allow  
passing files and directories on the command line, like pgindent does.  
(Previously, they would always operate on the whole tree.)  
  
Also, for consistency with pgindent's new behavior (as of b16259b3c1),  
passing an argument is now required.  To get the previous default  
behavior, use "pgperltidy ." for example.  
  
Discussion: https://www.postgresql.org/message-id/flat/45aacd8a-5265-d9da-8df2-b8e2c0cf6a07%40eisentraut.org  

M src/tools/perlcheck/find_perl_files
M src/tools/perlcheck/pgperlcritic
M src/tools/perlcheck/pgperlsyncheck
M src/tools/pgindent/README
M src/tools/pgindent/pgperltidy

Disable use of archiving in 009_twophase.pl

commit   : 8cca660b0bfb495306f9abd94fb4bcde783ee8ad    
  
author   : Michael Paquier <[email protected]>    
date     : Wed, 21 Jun 2023 16:16:15 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Wed, 21 Jun 2023 16:16:15 +0900    

Click here for diff

This partially reverts 68cb5af, as using archiving to enforce the  
rename of the last partial segment of the old timeline at promotion to  
use .partial as suffix is impacting the tests when it does switchovers.  
As showed by the logs gathered by the CI in the tests that failed, a new  
standby may fail to find the WAL segment it needs to follow a promoted  
instance with its timeline jump, as it got renamed to .partial.  
  
This problem would manifest as a run timeout with 009_twophase.pl, as  
the new standby repeatedly requests a segment from the promoted primary  
that it would not find.  
  
Reported-by: Nathan Bossart  
Discussion: https://postgr.es/m/20230621043345.GA787473@nathanxps13  
Backpatch-through: 13  

M src/test/recovery/t/009_twophase.pl

Fix the errhint message and docs for drop subscription failure.

commit   : a734caa25f79b7bfa423dd97162e5ecf14d1feb5    
  
author   : Amit Kapila <[email protected]>    
date     : Wed, 21 Jun 2023 10:36:09 +0530    
  
committer: Amit Kapila <[email protected]>    
date     : Wed, 21 Jun 2023 10:36:09 +0530    

Click here for diff

The existing errhint message and docs were missing the fact that we can't  
disassociate from the slot unless the subscription is disabled.  
  
Author: Robert Sjöblom, Peter Smith  
Reviewed-by: Peter Eisentraut, Amit Kapila  
Backpatch-through: 11  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/ref/drop_subscription.sgml
M src/backend/commands/subscriptioncmds.c

Move bool parameter for vacuum_rel() to option bits.

commit   : 5b1a8799431279b5f9d56c81b0d0879415e7b45c    
  
author   : Nathan Bossart <[email protected]>    
date     : Tue, 20 Jun 2023 15:14:58 -0700    
  
committer: Nathan Bossart <[email protected]>    
date     : Tue, 20 Jun 2023 15:14:58 -0700    

Click here for diff

ff9618e82a introduced the skip_privs parameter, which is used to  
skip privilege checks when recursing to a relation's TOAST table.  
This parameter should have been added as a flag bit in  
VacuumParams->options instead.  
  
Suggested-by: Michael Paquier  
Reviewed-by: Michael Paquier, Jeff Davis  
Discussion: https://postgr.es/m/ZIj4v1CwqlDVJZfB%40paquier.xyz  

M src/backend/commands/analyze.c
M src/backend/commands/vacuum.c
M src/include/commands/vacuum.h

Fix hash join when inner hashkey expressions contain Params.

commit   : 45392626c95c6345d48c1b1b7541add0102ba59f    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 20 Jun 2023 17:47:36 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 20 Jun 2023 17:47:36 -0400    

Click here for diff

If the inner-side expressions contain PARAM_EXEC Params, we must  
re-hash whenever the values of those Params change.  The executor  
mechanism for that exists already, but we failed to invoke it because  
finalize_plan() neglected to search the Hash.hashkeys field for  
Params.  This allowed a previous scan's hash table to be re-used  
when it should not be, leading to rows missing from the join's output.  
(I believe incorrectly-included join rows are impossible however,  
since checking the real hashclauses would reject false matches.)  
  
This bug is very ancient, dating probably to d24d75ff1 of 7.4.  
Sadly, this simple fix depends on the plan representational changes  
made by 2abd7ae9b, so it will only work back to v12.  I thought  
about trying to make some kind of hack for v11, but I'm leery  
of putting code significantly different from what is used in the  
newer branches into a nearly-EOL branch.  Seeing that the bug  
escaped detection for a full twenty years, problematic cases  
must be rare; so I don't feel too awful about leaving v11 as-is.  
  
Per bug #17985 from Zuming Jiang.  Back-patch to v12.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/optimizer/plan/subselect.c
M src/test/regress/expected/join_hash.out
M src/test/regress/sql/join_hash.sql

docs: adjust tag indenting and add MERGE mention

commit   : 8a300fc3afce4a0fe8a4c55bc22b2aeec092cf23    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 20 Jun 2023 13:15:18 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 20 Jun 2023 13:15:18 -0400    

Click here for diff

Discussion: https://postgr.es/m/CAMpnoC4_WsY3gsY+ud-Z0GDbafR=K7t7cXn2gatEqFnsRNY3yQ@mail.gmail.com  
  
Author: Will Mortensen  

M doc/src/sgml/mvcc.sgml

Fix another cause of "wrong varnullingrels" planner failures.

commit   : 3af87736bf5d5c7bea086d962afc2bbf4f29279a    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 20 Jun 2023 11:09:56 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 20 Jun 2023 11:09:56 -0400    

Click here for diff

I removed the delay_upper_joins mechanism in commit b448f1c8d,  
reasoning that it was only needed when we have a single-table  
(SELECT ... WHERE) as the immediate RHS child of a left join,  
and we could get rid of that by hoisting the WHERE condition into  
the parent join's quals.  However that new code missed a case:  
we could have "foo LEFT JOIN ((SELECT ... WHERE) LEFT JOIN bar)",  
and if the two left joins can be commuted then we now have the  
problematic query shape.  We can fix this too easily enough,  
by allowing the syntactically-lower left join to pass through  
its parent qual location pointer recursively.  That lets  
prepjointree.c discard the SELECT by temporarily hoisting the  
WHERE condition into the ancestor join's qual.  
  
Per bug #17978 from Zuming Jiang.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/optimizer/prep/prepjointree.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Don't include outer join relids in lateral_relids bitmapsets.

commit   : efeb12ef0bfef0b5aa966a56bb4dbb1f936bda0c    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 20 Jun 2023 10:29:57 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 20 Jun 2023 10:29:57 -0400    

Click here for diff

This avoids an assertion failure when outer joins are rearranged  
per identity 3.  Listing only the baserels from a PlaceHolderVar's  
ph_lateral set should be enough to ensure that the required values  
are available when we need to compute the PHV --- it's what we  
did before inventing nullingrel sets, after all.  It's a bit  
unsatisfying; but with beta2 hard upon us, there's not time to  
look for an aesthetically cleaner fix.  
  
Richard Guo and Tom Lane  
  
Discussion: https://postgr.es/m/CAMbWs48Jcw-NvnxT23WiHP324wG44DvzcH1j4hc0Zn+3sR9cfg@mail.gmail.com  

M src/backend/optimizer/plan/initsplan.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Centralize fixups for mismatched nullingrels in nestloop params.

commit   : 0655c03ef9cc6154b0b209059e758863dcf4e6b0    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 20 Jun 2023 10:22:52 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 20 Jun 2023 10:22:52 -0400    

Click here for diff

It turns out that the fixes we applied in commits bfd332b3f  
and 63e4f13d2 were not nearly enough to solve the problem.  
We'd focused narrowly on subquery RTEs with lateral references,  
but lateral references can occur in several other RTE kinds  
such as function RTEs.  Putting the same hack into half a dozen  
code paths seems quite unattractive.  Hence, revert the code changes  
(but not the test cases) from those commits and instead solve it  
centrally in identify_current_nestloop_params(), as Richard proposed  
originally.  This is a bit annoying because it could mask erroneous  
nullingrels in nestloop params that are generated from non-LATERAL  
parameterized paths; but on balance I don't see a better way.  
Maybe at some future time we'll be motivated to find a more rigorous  
approach to nestloop params, but that's not happening for beta2.  
  
Richard Guo and Tom Lane  
  
Discussion: https://postgr.es/m/CAMbWs48Jcw-NvnxT23WiHP324wG44DvzcH1j4hc0Zn+3sR9cfg@mail.gmail.com  

M src/backend/optimizer/path/joinpath.c
M src/backend/optimizer/plan/setrefs.c
M src/backend/optimizer/util/paramassign.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Add b334612b8 to .git-blame-ignore-revs.

commit   : 596114164699bbe184969df374fd6a1d8a93a57c    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 20 Jun 2023 09:52:52 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 20 Jun 2023 09:52:52 -0400    

Click here for diff

M .git-blame-ignore-revs

Pre-beta2 mechanical code beautification.

commit   : b334612b8aee9f9a34378982d8938b201dfad323    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 20 Jun 2023 09:50:43 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 20 Jun 2023 09:50:43 -0400    

Click here for diff

Run pgindent and pgperltidy.  It seems we're still some ways  
away from all committers doing this automatically.  Now that  
we have a buildfarm animal that will whine about poorly-indented  
code, we'll try to keep the tree more tidy.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/executor/execUtils.c
M src/backend/libpq/hba.c
M src/backend/replication/logical/tablesync.c
M src/backend/storage/file/fd.c
M src/backend/storage/ipc/standby.c
M src/backend/storage/smgr/md.c
M src/backend/utils/adt/pgstatfuncs.c
M src/bin/initdb/t/001_initdb.pl
M src/bin/scripts/t/020_createdb.pl
M src/include/utils/backend_status.h
M src/test/subscription/t/033_run_as_table_owner.pl

test_extensions: make meson.build consistent with Makefile.

commit   : 877bf52cffe587d33556e6259f610eb932699706    
  
author   : Jeff Davis <[email protected]>    
date     : Mon, 19 Jun 2023 18:08:59 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Mon, 19 Jun 2023 18:08:59 -0700    

Click here for diff

Specify --no-locale and --encoding=UTF8 to be consistent with the  
Makefile, which specifies NO_LOCALE=1. Fixes test for some locales  
when meson is used and ICU is disabled. May have been an oversight in  
e6927270cd.  
  
Also switch argument order in unaccent/meson.build to make it  
consistent in style.  
  
Discussion: https://postgr.es/m/CABwTF4Wz41pNMJ9q3tpH=6mnvg6aopDU5Lzvers5=6=WJVekww@mail.gmail.com  
Author: Gurjeet Singh  
Author: Jeff Davis  

M contrib/unaccent/meson.build
M src/test/modules/test_extensions/meson.build

Enable archiving in recovery TAP test 009_twophase.pl

commit   : 68cb5af46cd8bb2f6fd25886da5d6045a6a42208    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 20 Jun 2023 10:25:27 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 20 Jun 2023 10:25:27 +0900    

Click here for diff

This is a follow-up of f663b00, that has been committed to v13 and v14,  
tweaking the TAP test for two-phase transactions so as it provides  
coverage for the bug that has been fixed.  This change is done in its  
own commit for clarity, as v15 and HEAD did not show the problematic  
behavior, still missed coverage for it.  
  
While on it, this adds a comment about the dependency of the last  
partial segment rename and RecoverPreparedTransactions() at the end of  
recovery, as that can be easy to miss.  
  
Author: Michael Paquier  
Reviewed-by: Kyotaro Horiguchi  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 13  

M src/backend/access/transam/xlog.c
M src/test/recovery/t/009_twophase.pl

fd.c: Retry after EINTR in more places

commit   : 0d369ac650041862ed5006885160f36d24b224a4    
  
author   : Andres Freund <[email protected]>    
date     : Mon, 19 Jun 2023 14:11:32 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Mon, 19 Jun 2023 14:11:32 -0700    

Click here for diff

Starting with 4d330a61bb1 we can use posix_fallocate() to extend  
files. Unfortunately in some situation, e.g. on tmpfs filesystems, EINTR may  
be returned. See also 4518c798b2b.  
  
To fix, add a retry path to FileFallocate(). In contrast to 4518c798b2b the  
amount we extend by is limited and the extending may happen at a high  
frequency, so disabling signals does not appear to be the correct path here.  
  
Also add retry paths to other file operations currently lacking them (around  
fdatasync(), fsync(), ftruncate(), posix_fadvise(), sync_file_range(),  
truncate()) - they are all documented or have been observed to return EINTR.  
  
Even though most of these functions used in the back branches, it does not  
seem worth the risk to backpatch - outside of the new-to-16 case of  
posix_fallocate() I am not aware of problem reports due to the lack of  
retries.  
  
Reported-by: Christoph Berg <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Backpatch: -  

M src/backend/storage/file/fd.c

pg_regress: for --no-locale, use LOCALE='C'.

commit   : 797f98036400bc70d4b331c5b1760a05aab59cfa    
  
author   : Jeff Davis <[email protected]>    
date     : Mon, 19 Jun 2023 11:51:22 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Mon, 19 Jun 2023 11:51:22 -0700    

Click here for diff

Instead of specifying LC_COLLATE='C' and LC_CTYPE='C', specify  
LOCALE='C' which will also affect ICU. This makes pg_regress  
consistent with recent changes to initdb in commit a14e75eb0b6.  
  
Fixes buildfarm failure.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/test/regress/pg_regress.c

Don't use partial unique indexes for unique proofs in the planner

commit   : 7fcd7ef2a9c372b789f95b40043edffdc611c566    
  
author   : David Rowley <[email protected]>    
date     : Mon, 19 Jun 2023 13:00:42 +1200    
  
committer: David Rowley <[email protected]>    
date     : Mon, 19 Jun 2023 13:00:42 +1200    

Click here for diff

Here we adjust relation_has_unique_index_for() so that it no longer makes  
use of partial unique indexes as uniqueness proofs.  It is incorrect to  
use these as the predicates used by check_index_predicates() to set  
predOK makes use of not only baserestrictinfo quals as proofs, but also  
qual from join conditions.  For relation_has_unique_index_for()'s case, we  
need to know the relation is unique for a given set of columns before any  
joins are evaluated, so if predOK was only set to true due to some join  
qual, then it's unsafe to use such indexes in  
relation_has_unique_index_for().  The final plan may not even make use  
of that index, which could result in reading tuples that are not as  
unique as the planner previously expected them to be.  
  
Bug: #17975  
Reported-by: Tor Erik Linnerud  
Backpatch-through: 11, all supported versions  
Discussion: https://postgr.es/m/17975-98a90c156f25c952%40postgresql.org  

M src/backend/optimizer/path/indxpath.c
M src/backend/optimizer/plan/analyzejoins.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

CREATE DATABASE: make LOCALE apply to all collation providers.

commit   : a14e75eb0b6a73821e0d66c0d407372ec8376105    
  
author   : Jeff Davis <[email protected]>    
date     : Fri, 16 Jun 2023 10:27:32 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Fri, 16 Jun 2023 10:27:32 -0700    

Click here for diff

For CREATE DATABASE, make LOCALE parameter apply regardless of the  
provider used. Also affects initdb and createdb --locale arguments.  
  
Previously, LOCALE (and --locale) only affected the database default  
collation when using the libc provider.  
  
Discussion: https://postgr.es/m/[email protected]  
Reviewed-by: Peter Eisentraut  

M doc/src/sgml/ref/create_collation.sgml
M doc/src/sgml/ref/create_database.sgml
M doc/src/sgml/ref/createdb.sgml
M doc/src/sgml/ref/initdb.sgml
M src/backend/commands/collationcmds.c
M src/backend/commands/dbcommands.c
M src/bin/initdb/initdb.c
M src/bin/initdb/t/001_initdb.pl
M src/bin/scripts/createdb.c
M src/bin/scripts/t/020_createdb.pl
M src/test/icu/t/010_database.pl
M src/test/regress/expected/collate.icu.utf8.out

libpq: Add missing gettext trigger

commit   : c0d951262c80f42b3bfe037f940e103a24da84f4    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 16 Jun 2023 10:53:22 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 16 Jun 2023 10:53:22 +0200    

Click here for diff

libpq_ngettext() was missing.  This was an ancient mistake (commit  
acd08d764a).  

M src/interfaces/libpq/nls.mk

Add missing pg_basebackup TAP test for meson.

commit   : 0225eec80bddbf69d0509851b2df2bafd62fcc30    
  
author   : Masahiko Sawada <[email protected]>    
date     : Fri, 16 Jun 2023 10:32:49 +0900    
  
committer: Masahiko Sawada <[email protected]>    
date     : Fri, 16 Jun 2023 10:32:49 +0900    

Click here for diff

011_in_place_tablespace was missing from the list of pg_basebackup  
tests to run under meson, so add it.  
  
Oversight in 363e8f9115.  
  
Discussion: https://postgr.es/m/CAD21AoDTh1A8bvNBF3LQNQg=27xTpSgvpT+4_yyEj6p4Zv8unA@mail.gmail.com  

M src/bin/pg_basebackup/meson.build

Fix typo in comment.

commit   : 160c23b5fa0243d2f743cc70c96dac44d9932645    
  
author   : Amit Langote <[email protected]>    
date     : Fri, 16 Jun 2023 10:04:22 +0900    
  
committer: Amit Langote <[email protected]>    
date     : Fri, 16 Jun 2023 10:04:22 +0900    

Click here for diff

Back-patch down to 11.  
  
Author: Sho Kato (<[email protected]>)  
Discussion: https://postgr.es/m/TYCPR01MB68499042A33BC32241193AAF9F5BA%40TYCPR01MB6849.jpnprd01.prod.outlook.com  

M src/backend/rewrite/rewriteHandler.c

When removing a left join, clean out references in EquivalenceClasses.

commit   : f4c00d138f6dea4c9d8af8ec280b7edc9b0a29e1    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 15 Jun 2023 15:24:50 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 15 Jun 2023 15:24:50 -0400    

Click here for diff

Since commit b448f1c8d, we've been able to remove left joins  
(that are otherwise removable) even when they are underneath  
other left joins, a case that was previously prevented by a  
delay_upper_joins check.  This is a clear improvement, but  
it has a surprising side-effect: it's now possible that there  
are EquivalenceClasses whose relid sets mention the removed  
baserel and/or outer join.  If we fail to clean those up,  
we may drop essential join quals due to not having any join  
level that appears to satisfy their relid sets.  
  
(It's not quite 100% clear that this was impossible before.  
But the lack of complaints since we added join removal a dozen  
years ago strongly suggests that it was impossible.)  
  
Richard Guo and Tom Lane, per bug #17976 from Zuming Jiang  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/optimizer/plan/analyzejoins.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Remove outdated reference to a removed file

commit   : 5c8c8079b0f93bb714b14e4ce9b463411cad7db4    
  
author   : Amit Langote <[email protected]>    
date     : Thu, 15 Jun 2023 18:39:45 +0900    
  
committer: Amit Langote <[email protected]>    
date     : Thu, 15 Jun 2023 18:39:45 +0900    

Click here for diff

parse_jsontable.c was removed as part of 2f2b18bd3f55, though its  
mention in src/backend/parser/README was not.  Fix that.  
  
Discussion: https://postgr.es/m/CA%2BHiwqHDzw8AP8p_dEkFr0xg458ZTf58zbivAHhK4UeNrx9Tdg%40mail.gmail.com  

M src/backend/parser/README

libpq: Fix up some error message coding

commit   : d6326ba8fe69ced797412ea9bb97b2f35588f791    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 15 Jun 2023 13:54:37 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 15 Jun 2023 13:54:37 +0200    

Click here for diff

This applies the new error message API from commit 0873b2d354 to the  
changes introduced by bbf9c282ce.  The latter was committed shortly  
after the former, so it probably didn't get the news in time.  

M src/interfaces/libpq/fe-protocol3.c

Add missing subscription TAP test for meson

commit   : ac68323a8788a881aa37671126346c08b1b08091    
  
author   : Michael Paquier <[email protected]>    
date     : Thu, 15 Jun 2023 17:27:21 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Thu, 15 Jun 2023 17:27:21 +0900    

Click here for diff

033_run_as_table_owner was missing from the list of subscription tests  
to run under meson, so add it.  
  
Oversight in 4826759.  
  
Author: Hayato Kuroda  
Discussion: https://postgr.es/m/TYAPR01MB58668F4D85A9A122A158F442F55BA@TYAPR01MB5866.jpnprd01.prod.outlook.com  

M src/test/subscription/meson.build

Replace GUC_UNIT_MEMORY|GUC_UNIT_TIME with GUC_UNIT.

commit   : a54fc892ad0a5673d75b199128b1f5fcf5e1a41d    
  
author   : Masahiko Sawada <[email protected]>    
date     : Thu, 15 Jun 2023 17:04:19 +0900    
  
committer: Masahiko Sawada <[email protected]>    
date     : Thu, 15 Jun 2023 17:04:19 +0900    

Click here for diff

We used (GUC_UNIT_MEMORY | GUC_UNIT_TIME) instead of GUC_UNIT some  
places but we already define it in guc.h. This commit replaces them  
with GUC_UNIT for better consistency with their surrounding code.  
  
Author: Japin Li  
Reviewed-by: Richard Guo, Michael Paquier, Masahiko Sawada  
Discussion: https://postgr.es/m/MEYP282MB1669EC0FED922F7A151673ACB65AA@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM  

M src/backend/utils/misc/guc.c

intarray: Prevent out-of-bound memory reads with gist__int_ops

commit   : c00fbe89dc51c13eae1ca71460bcddfc3dde5081    
  
author   : Michael Paquier <[email protected]>    
date     : Thu, 15 Jun 2023 13:45:34 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Thu, 15 Jun 2023 13:45:34 +0900    

Click here for diff

As gist__int_ops stands in intarray, it is possible to store GiST  
entries for leaf pages that can cause corruptions when decompressed.  
Leaf nodes are stored as decompressed all the time by the compression  
method, and the decompression method should map with that, retrieving  
the contents of the page without doing any decompression.  However, the  
code authorized the insertion of leaf page data with a higher number of  
array items than what can be supported, generating a NOTICE message to  
inform about this matter (199 for a 8k page, for reference).  When  
calling the decompression method, a decompression would be attempted on  
this leaf node item but the contents should be retrieved as they are.  
  
The NOTICE message generated when dealing with the compression of a leaf  
page and too many elements in the input array for gist__int_ops has been  
introduced by 08ee64e, removing the marker stored in the array to track  
if this is actually a leaf node.  However, it also missed the fact that  
the decompression path should do nothing for a leaf page.  Hence, as the  
code stand, a too-large array would be stored as uncompressed but the  
decompression path would attempt a decompression rather that retrieving  
the contents as they are.  
  
This leads to various problems.  First, even if 08ee64e tried to address  
that, it is possible to do out-of-bound chunk writes with a large input  
array, with the backend informing about that with WARNINGs.  On  
decompression, retrieving the stored leaf data would lead to incorrect  
memory reads, leading to crashes or even worse.  
  
Perhaps somebody would be interested in expanding the number of array  
items that can be handled in a leaf page for this operator in the  
future, which would require revisiting the choice done in 08ee64e, but  
based on the lack of reports about this problem since 2005 it does not  
look so.  For now, this commit prevents the insertion of data for leaf  
pages when using more array items that the code can handle on  
decompression, switching the NOTICE message to an ERROR.  If one wishes  
to use more array items, gist__intbig_ops is an optional choice.  
  
While on it, use ERRCODE_PROGRAM_LIMIT_EXCEEDED as error code when a  
limit is reached, because that's what the module is facing in such  
cases.  
  
Author: Ankit Kumar Pandey, Alexander Lakhin  
Reviewed-by: Richard Guo, Michael Paquier  
Discussion: https://postgr.es/m/[email protected]  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 11  

M contrib/intarray/_int_gist.c
M contrib/intarray/expected/_int.out
M contrib/intarray/sql/_int.sql

Fix possible crash in tablesync worker.

commit   : b5c517379a40fa1af84c0852aa3730a5875a6482    
  
author   : Amit Kapila <[email protected]>    
date     : Thu, 15 Jun 2023 08:37:48 +0530    
  
committer: Amit Kapila <[email protected]>    
date     : Thu, 15 Jun 2023 08:37:48 +0530    

Click here for diff

Commit c3afe8cf5a added a new password_required option but forgot that you  
need database access to check whether an arbitrary role ID is a superuser.  
  
Commit e7e7da2f8d fixed a similar bug in apply worker, and this patch  
fixes a similar bug in tablesync worker.  
  
Author: Hou Zhijie  
Reviewed-by: Amit Kapila  
Discussion: https://postgr.es/m/OS0PR01MB571607F5A9D723755268D36294759@OS0PR01MB5716.jpnprd01.prod.outlook.com  

M src/backend/replication/logical/tablesync.c

Make parseNodeString() C idiom compatible with Visual Studio 2015.

commit   : f9f31aa91f82df863a35354893978e1937863d7c    
  
author   : Noah Misch <[email protected]>    
date     : Wed, 14 Jun 2023 05:31:54 -0700    
  
committer: Noah Misch <[email protected]>    
date     : Wed, 14 Jun 2023 05:31:54 -0700    

Click here for diff

Between v15 and now, this function's "else if" chain grew from 252 lines  
to 592 lines, exceeding a compiler limit that manifests as "fatal error  
C1026: parser stack overflow, program too complex (compiling source file  
src/backend/nodes/readfuncs.c)".  Use "if (...)  return ...;" instead.  
  
Reviewed by Tom Lane, Peter Eisentraut and Michael Paquier.  Not all  
reviewers endorse this.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/nodes/gen_node_support.pl
M src/backend/nodes/readfuncs.c

Fix typo in comment.

commit   : 4327f6c7480fea9348ea6825a9d38a71b2ef8785    
  
author   : Masahiko Sawada <[email protected]>    
date     : Wed, 14 Jun 2023 13:28:41 +0900    
  
committer: Masahiko Sawada <[email protected]>    
date     : Wed, 14 Jun 2023 13:28:41 +0900    

Click here for diff

Introduced in 4d330a61bb1.  
  
Author: Masahiko Sawada  
Reviewed-by: Michael Paquier  
Discussion: https://postgr.es/m/CAD21AoDg8rTWJkrNJg9UTP89vS8smfib2c55DVqKrCn8zR-GYA@mail.gmail.com  

M src/backend/storage/smgr/md.c

Retain relkind too in RTE_SUBQUERY entries for views.

commit   : 0f8cfaf8921fed35f0b92d918ce95eec7b46ff05    
  
author   : Amit Langote <[email protected]>    
date     : Tue, 13 Jun 2023 12:52:47 +0900    
  
committer: Amit Langote <[email protected]>    
date     : Tue, 13 Jun 2023 12:52:47 +0900    

Click here for diff

47bb9db75 modified the ApplyRetrieveRule()'s conversion of a view's  
original RTE_RELATION entry into an RTE_SUBQUERY one to retain relid,  
rellockmode, and perminfoindex so that the executor can lock the view  
and check its permissions.  It seems better to also retain  
relkind for cross-checking that the exception of an  
RTE_SUBQUERY entry being allowed to carry relation details only  
applies to views, so do so.  
  
Bump catversion because this changes the output format of  
RTE_SUBQUERY RTEs.  
  
Suggested-by: David Steele <[email protected]>  
Reviewed-by: David Steele <[email protected]>  
Reviewed-by: Álvaro Herrera <[email protected]>  
Discussion: https://postgr.es/m/3953179e-9540-e5d1-a743-4bef368785b0%40pgmasters.net  

M src/backend/executor/execMain.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/readfuncs.c
M src/backend/rewrite/rewriteHandler.c
M src/include/catalog/catversion.h
M src/include/nodes/parsenodes.h

Fix make_etags breakage on certain platforms.

commit   : ae66716bf3ef6fa9b33904eaf15441813a150320    
  
author   : Tatsuo Ishii <[email protected]>    
date     : Wed, 14 Jun 2023 11:02:50 +0900    
  
committer: Tatsuo Ishii <[email protected]>    
date     : Wed, 14 Jun 2023 11:02:50 +0900    

Click here for diff

make_etags produced wrong format TAGS files on platforms such as Mac,  
which uses non-Exuberant ctags.  
  
Author: Masahiko Sawada  
Reviewed-by: Tatsuo Ishii  
Backpatch-through: 15  
Discussion: https://postgr.es/m/CAD21AoDmCqpS%2BU6b9Bc-b4OFx3tz%3DNv6O2KVkoVg7sHk60spjA%40mail.gmail.com  

M src/tools/make_ctags

Fix "wrong varnullingrels" for Memoize's lateral references, too.

commit   : 63e4f13d2a78124c798165814a679b0534db87a5    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 13 Jun 2023 18:01:33 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 13 Jun 2023 18:01:33 -0400    

Click here for diff

The issue fixed in commit bfd332b3f can also bite Memoize plans,  
because of the separate copies of lateral reference Vars made  
by paraminfo_get_equal_hashops.  Apply the same hacky fix there.  
  
(In passing, clean up shaky grammar in the existing comments  
for this function.)  
  
Richard Guo  
  
Discussion: https://postgr.es/m/CAMbWs4-krwk0Wbd6WdufMAupuou_Ua73ijQ4XQCr1Mb5BaVtKQ@mail.gmail.com  

M src/backend/optimizer/path/joinpath.c
M src/backend/optimizer/plan/setrefs.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

commit   : 792213f2e9f6d321d5a463f4a0fc263c2b770ac3    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 13 Jun 2023 15:58:37 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 13 Jun 2023 15:58:37 -0400    

Click here for diff

rewriteRuleAction neglected to check for SubLink nodes in the  
securityQuals of range table entries.  This could lead to failing  
to convert such a SubLink to a SubPlan, resulting in assertion  
crashes or weird errors later in planning.  
  
In passing, fix some poor coding in rewriteTargetView:  
we should not pass the source parsetree's hasSubLinks  
field to ReplaceVarsFromTargetList's outer_hasSubLinks.  
ReplaceVarsFromTargetList knows enough to ignore that  
when a Query node is passed, but it's still confusing  
and bad precedent: if we did try to update that flag  
we'd be updating a stale copy of the parsetree.  
  
Per bug #17972 from Alexander Lakhin.  This has been broken since  
we added RangeTblEntry.securityQuals (although the presented test  
case only fails back to 215b43cdc), so back-patch all the way.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/rewrite/rewriteHandler.c
M src/test/regress/expected/updatable_views.out
M src/test/regress/sql/updatable_views.sql

doc: Move list entry to proper position

commit   : b93c63d1972a28ffa3e16c2bc71fd60d82a57f73    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 13 Jun 2023 15:00:52 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 13 Jun 2023 15:00:52 +0200    

Click here for diff

M doc/src/sgml/ref/psql-ref.sgml

Report stats when replaying XLOG_RUNNING_XACTS

commit   : e3cb1a586cef746326eeabf36d103ea1136607f9    
  
author   : Andres Freund <[email protected]>    
date     : Mon, 12 Jun 2023 15:06:12 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Mon, 12 Jun 2023 15:06:12 -0700    

Click here for diff

Previously stats in the startup process would only get reported during  
shutdown of the startup process. It has been that way for a long time, but  
became a lot more noticeable with the new pg_stat_io view, which separates out  
IO done by different backend types...  
  
While replaying after every XLOG_RUNNING_XACTS isn't the prettiest approach,  
it has the advantage of being quite easy. Given that we're well past feature  
freeze...  
  
It's not a problem that we don't report stats more frequently with  
wal_level=minimal, in that case stats can't be read before the stats process  
has shut down.  
  
Besides the above, this commit also changes pgstat_report_stat() to acquire  
the timestamp with GetCurrentTimestamp() instead of  
GetCurrentTransactionStopTimestamp().  
  
Thanks to Melih Mutlu, Kyotaro Horiguchi for prototypes of other approaches to  
solving this issue.  
  
Reported-by: Fujii Masao <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/storage/ipc/standby.c
M src/backend/utils/activity/pgstat.c

Accept fractional seconds in jsonpath's datetime() method.

commit   : 7398e27224f173306e5b62977672b29f5553ee76    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 12 Jun 2023 10:54:28 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 12 Jun 2023 10:54:28 -0400    

Click here for diff

Commit 927d9abb6 purported to make datetime() accept any string  
that could be output for a datetime value by to_jsonb().  But it  
overlooked the possibility of fractional seconds being present,  
so that cases as simple as to_jsonb(now()) would defeat it.  
  
Fix by adding formats that include ".US" to the list in  
executeDateTimeMethod().  (Note that while this is nominally  
microseconds, it'll do the right thing for fractions with  
fewer than six digits.)  
  
In passing, re-order the list to restore the datatype ordering  
specified in its comment.  The violation accidentally did not  
break anything; but the next edit might be less lucky, so add  
more comments.  
  
Per report from Tim Field.  Back-patch to v13 where datetime()  
was added, like the previous patch.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/utils/adt/jsonpath_exec.c
M src/test/regress/expected/jsonb_jsonpath.out
M src/test/regress/sql/jsonb_jsonpath.sql

src/tools/msvc/clean.bat: Reconcile with PostgreSQL 16 work.

commit   : 0c524370203b85b49ca3b52c7a705b867d7c7167    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 12 Jun 2023 07:40:39 -0700    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 12 Jun 2023 07:40:39 -0700    

Click here for diff

M src/tools/msvc/clean.bat

src/tools/msvc: Move all.sym temporary file back to Debug/postgres.

commit   : 6e723f6d7b3642ef9457b8eddd27ebb616d7a7e9    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 12 Jun 2023 07:40:39 -0700    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 12 Jun 2023 07:40:39 -0700    

Click here for diff

Commit 70df2df1cc89e69e31b31b6aa0d65fd72935af38 moved it to the  
top_srcdir, where it caused "git status" noise.  

M src/tools/msvc/MSBuildProject.pm

Add win32ver data to meson-built postgres.exe.

commit   : 8c7ad6f1562ba7e8a65b21c40782091a4dd3301d    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 12 Jun 2023 07:40:38 -0700    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 12 Jun 2023 07:40:38 -0700    

Click here for diff

As in the older build systems, the resources object is not an input to  
postgres.def.  
  
Reviewed by Andres Freund.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/meson.build

Give postgres.exe the icon of other executables.

commit   : 04411cbfdb76194c483c77bdbc636e83099ae5c3    
  
author   : Noah Misch <[email protected]>    
date     : Mon, 12 Jun 2023 07:40:38 -0700    
  
committer: Noah Misch <[email protected]>    
date     : Mon, 12 Jun 2023 07:40:38 -0700    

Click here for diff

We had left it icon-free since users won't achieve much by opening it  
from Windows Explorer.  Subsequent to that decision, Task Manager  
started to show the icon.  That shifts the balance in favor of attaching  
the icon, so do so.  No back-patch, but make this late addition to v16.  
  
Reviewed by Andres Freund and Magnus Hagander.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/Makefile

Fix "wrong varnullingrels" for subquery nestloop parameters.

commit   : bfd332b3fda5c73e28c05b7ba0aac6cf053cdf00    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 12 Jun 2023 10:01:26 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 12 Jun 2023 10:01:26 -0400    

Click here for diff

If we apply outer join identity 3 when relation C is a subquery  
having lateral references to relation B, then the lateral references  
within C continue to bear the original syntactically-correct  
varnullingrels marks, but that won't match what is available from  
the outer side of the nestloop.  Compensate for that in  
process_subquery_nestloop_params().  This is a slightly hacky fix,  
but we certainly don't want to re-plan C in toto for each possible  
outer join order, so there's not a lot of better alternatives.  
  
Richard Guo and Tom Lane, per report from Markus Winand  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/optimizer/plan/setrefs.c
M src/backend/optimizer/util/paramassign.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Remove a few unused global variables and declarations.

commit   : 548d7260309008b146bd9eaa66f3c5be0a8d725a    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 12 Jun 2023 16:25:37 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 12 Jun 2023 16:25:37 +0300    

Click here for diff

- Commit 3eb77eba5a, which moved the pending ops queue from md.c to  
  sync.c, introduced a duplicate, unused 'pendingOpsCxt'  
  variable. (I'm surprised none of the compilers or static analysis  
  tools have complained about that.)  
  
- Commit c2fe139c20 moved the 'synchronize_seqscans' variable and  
  introduced an extern declaration in tableam.h, making the one in  
  guc_tables.c unnecessary.  
  
- Commit 6f0cf87872 removed the 'pgstat_temp_directory' GUC, but  
  forgot to remove the corresponding global variable.  
  
- Commit 1b4e729eaa removed the 'pg_krb_realm' GUC, and its global  
  variable, but forgot the declaration in auth.h.  
  
Spotted all these by reading the code.  

M src/backend/storage/sync/sync.c
M src/backend/utils/misc/guc_tables.c
M src/include/libpq/auth.h

Fix instability in regression test for Parallel Hash Full Join

commit   : 3e8da50244a8de69317babcfdb048172cf30f14c    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 12 Jun 2023 12:19:46 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 12 Jun 2023 12:19:46 +0900    

Click here for diff

As reported by buildfarm member conchuela, one of the regression tests  
added by 558c9d7 is having some ordering issues.  This commit adds an  
ORDER BY clause to make the output more stable for the problematic  
query.  
  
Fix suggested by Tom Lane.  The plan of the query updated still uses a  
parallel hash full join.  
  
Author: Melanie Plageman  
Discussion: https://postgr.es/m/[email protected]  

M src/test/regress/expected/join_hash.out
M src/test/regress/sql/join_hash.sql

hstore: Tighten key/value parsing check for whitespaces

commit   : d522b05c8c1c2c430b2c8be795c609f6f4f2ce44    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 12 Jun 2023 09:14:03 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 12 Jun 2023 09:14:03 +0900    

Click here for diff

isspace() can be locale-sensitive depending on the platform, causing  
hstore to consider as whitespaces characters it should not see as such.  
For example, U+0105, being decoded as 0xC4 0x85 in UTF-8, would be  
discarded from the input given.  
  
This problem is similar to 9ae2661, though it was missed that hstore  
can also manipulate non-ASCII inputs, so replace the existing isspace()  
calls with scanner_isspace().  
  
This problem exists for a long time, so backpatch all the way down.  
  
Author: Evan Jones  
Discussion: https://postgr.es/m/CA+HWA9awUW0+RV_gO9r1ABZwGoZxPztcJxPy8vMFSTbTfi4jig@mail.gmail.com  
Backpatch-through: 11  

M contrib/hstore/Makefile
A contrib/hstore/expected/hstore_utf8.out
A contrib/hstore/expected/hstore_utf8_1.out
M contrib/hstore/hstore_io.c
M contrib/hstore/meson.build
A contrib/hstore/sql/hstore_utf8.sql

nbtree: Allocate new pages in separate function.

commit   : d088ba5a5aa410d39b64f013e8433ad9eb3d17f1    
  
author   : Peter Geoghegan <[email protected]>    
date     : Sat, 10 Jun 2023 14:08:25 -0700    
  
committer: Peter Geoghegan <[email protected]>    
date     : Sat, 10 Jun 2023 14:08:25 -0700    

Click here for diff

Split nbtree's _bt_getbuf function is two: code that read locks or write  
locks existing pages remains in _bt_getbuf, while code that deals with  
allocating new pages is moved to a new, dedicated function called  
_bt_allocbuf.  This simplifies most _bt_getbuf callers, since it is no  
longer necessary for them to pass a heaprel argument.  Many of the  
changes to nbtree from commit 61b313e4 can be reverted.  This minimizes  
the divergence between HEAD/PostgreSQL 16 and earlier release branches.  
  
_bt_allocbuf replaces the previous nbtree idiom of passing P_NEW to  
_bt_getbuf.  There are only 3 affected call sites, all of which continue  
to pass a heaprel for recovery conflict purposes.  Note that nbtree's  
use of P_NEW was superficial; nbtree never actually relied on the P_NEW  
code paths in bufmgr.c, so this change is strictly mechanical.  
  
GiST already took the same approach; it has a dedicated function for  
allocating new pages called gistNewBuffer().  That factor allowed commit  
61b313e4 to make much more targeted changes to GiST.  
  
Author: Peter Geoghegan <[email protected]>  
Reviewed-By: Heikki Linnakangas <[email protected]>  
Discussion: https://postgr.es/m/CAH2-Wz=8Z9qY58bjm_7TAHgtW6RzZ5Ke62q5emdCEy9BAzwhmg@mail.gmail.com  

M contrib/amcheck/verify_nbtree.c
M src/backend/access/heap/heapam_handler.c
M src/backend/access/nbtree/nbtinsert.c
M src/backend/access/nbtree/nbtpage.c
M src/backend/access/nbtree/nbtree.c
M src/backend/access/nbtree/nbtsearch.c
M src/backend/access/nbtree/nbtsort.c
M src/backend/access/nbtree/nbtutils.c
M src/backend/optimizer/util/plancat.c
M src/backend/utils/sort/tuplesortvariants.c
M src/include/access/nbtree.h
M src/include/utils/tuplesort.h

Add another old commit to git-blame-ignore-revs.

commit   : fe879ae3a8e0735ccb12a425e1cdbcedb2f4af81    
  
author   : Peter Geoghegan <[email protected]>    
date     : Sat, 10 Jun 2023 13:55:15 -0700    
  
committer: Peter Geoghegan <[email protected]>    
date     : Sat, 10 Jun 2023 13:55:15 -0700    

Click here for diff

M .git-blame-ignore-revs

Revert "Fix search_path to a safe value during maintenance operations."

commit   : 2fcc7ee7affe2fb708d7b2727e93981216b5d2f8    
  
author   : Jeff Davis <[email protected]>    
date     : Sat, 10 Jun 2023 08:11:02 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Sat, 10 Jun 2023 08:11:02 -0700    

Click here for diff

This reverts commit 05e17373517114167d002494e004fa0aa32d1fd1.  

M contrib/amcheck/verify_nbtree.c
M src/backend/access/brin/brin.c
M src/backend/catalog/index.c
M src/backend/commands/analyze.c
M src/backend/commands/cluster.c
M src/backend/commands/indexcmds.c
M src/backend/commands/matview.c
M src/backend/commands/vacuum.c
M src/bin/scripts/t/100_vacuumdb.pl
M src/include/utils/guc.h
M src/test/modules/test_oat_hooks/expected/test_oat_hooks.out
M src/test/regress/expected/privileges.out
M src/test/regress/expected/vacuum.out
M src/test/regress/sql/privileges.sql
M src/test/regress/sql/vacuum.sql

meson: Add dependencies to perl modules to various script invocations

commit   : a1cd982098c8f6a714870ae512b4a9cdeacb9440    
  
author   : Andres Freund <[email protected]>    
date     : Fri, 9 Jun 2023 20:12:16 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Fri, 9 Jun 2023 20:12:16 -0700    

Click here for diff

Eventually it is likely worth trying to deal with this in a more expansive  
way, by generating dependency files generated within the scripts. But it's not  
entirely obvious how to do that in perl and is work more suitable for 17  
anyway.  
  
Reported-by: Dagfinn Ilmari Mannsåker <[email protected]>  
Reviewed-by: Tristan Partin <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M meson.build
M src/common/meson.build
M src/common/unicode/meson.build
M src/include/catalog/meson.build
M src/include/nodes/meson.build
M src/include/utils/meson.build
M src/interfaces/ecpg/preproc/meson.build
M src/pl/plpgsql/src/meson.build

doc: PG 16 relnotes, add author

commit   : b9e3f8005c99dece44d60cdfad5b904554f4d435    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 9 Jun 2023 21:04:28 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 9 Jun 2023 21:04:28 -0400    

Click here for diff

Reported-by: Masahiko Sawada  
  
Discussion: https://postgr.es/m/CAD21AoDP46y+1yUMikYWhCfkhSEuoXmHq2SV8_PyQoM1uWBRbg@mail.gmail.com  

M doc/src/sgml/release-16.sgml

Fix search_path to a safe value during maintenance operations.

commit   : 05e17373517114167d002494e004fa0aa32d1fd1    
  
author   : Jeff Davis <[email protected]>    
date     : Fri, 9 Jun 2023 11:20:47 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Fri, 9 Jun 2023 11:20:47 -0700    

Click here for diff

While executing maintenance operations (ANALYZE, CLUSTER, REFRESH  
MATERIALIZED VIEW, REINDEX, or VACUUM), set search_path to  
'pg_catalog, pg_temp' to prevent inconsistent behavior.  
  
Functions that are used for functional indexes, in index expressions,  
or in materialized views and depend on a different search path must be  
declared with CREATE FUNCTION ... SET search_path='...'.  
  
This change addresses a security risk introduced in commit 60684dd834,  
where a role with MAINTAIN privileges on a table may be able to  
escalate privileges to the table owner. That commit is not yet part of  
any release, so no need to backpatch.  
  
Discussion: https://postgr.es/m/e44327179e5c9015c8dda67351c04da552066017.camel%40j-davis.com  
Reviewed-by: Greg Stark  
Reviewed-by: Nathan Bossart  

M contrib/amcheck/verify_nbtree.c
M src/backend/access/brin/brin.c
M src/backend/catalog/index.c
M src/backend/commands/analyze.c
M src/backend/commands/cluster.c
M src/backend/commands/indexcmds.c
M src/backend/commands/matview.c
M src/backend/commands/vacuum.c
M src/bin/scripts/t/100_vacuumdb.pl
M src/include/utils/guc.h
M src/test/modules/test_oat_hooks/expected/test_oat_hooks.out
M src/test/regress/expected/privileges.out
M src/test/regress/expected/vacuum.out
M src/test/regress/sql/privileges.sql
M src/test/regress/sql/vacuum.sql

Fix missing word in nbtree/README.

commit   : 9aee26a491ba9b7ceff40e6192183ab7200b6bfb    
  
author   : Nathan Bossart <[email protected]>    
date     : Thu, 8 Jun 2023 21:20:24 -0700    
  
committer: Nathan Bossart <[email protected]>    
date     : Thu, 8 Jun 2023 21:20:24 -0700    

Click here for diff

Reported-by: Daniel Westermann  
Author: Gurjeet Singh  
Reviewed-by: Richard Guo  
Discussion: https://postgr.es/m/ZR0P278MB0427F0E0CE4ED140F52D1923D250A%40ZR0P278MB0427.CHEP278.PROD.OUTLOOK.COM  

M src/backend/access/nbtree/README

Refactor routine to find single log content pattern in TAP tests

commit   : 392ea0c78fdb6cb92f1af0793f6c2d48526e6fed    
  
author   : Michael Paquier <[email protected]>    
date     : Fri, 9 Jun 2023 11:56:27 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Fri, 9 Jun 2023 11:56:27 +0900    

Click here for diff

The same routine to check if a specific pattern can be found in the  
server logs was copied over four different test scripts.  This refactors  
the whole to use a single routine located in PostgreSQL::Test::Cluster,  
named log_contains, to grab the contents of the server logs and check  
for a specific pattern.  
  
On HEAD, the code previously used assumed that slurp_file() could not  
handle an undefined offset, setting it to zero, but slurp_file() does  
do an extra fseek() before retrieving the log contents only if an offset  
is defined.  In two places, the test was retrieving the full log  
contents with slurp_file() after calling substr() to apply an offset,  
ignoring that slurp_file() would be able to handle that.  
  
Backpatch all the way down to ease the introduction of new tests that  
could rely on the new routine.  
  
Author: Vignesh C  
Reviewed-by: Andrew Dunstan, Dagfinn Ilmari Mannsåker, Michael Paquier  
Discussion: https://postgr.es/m/CALDaNm0YSiLpjCmajwLfidQrFOrLNKPQir7s__PeVvh9U3uoTQ@mail.gmail.com  
Backpatch-through: 11  

M src/test/authentication/t/003_peer.pl
M src/test/perl/PostgreSQL/Test/Cluster.pm
M src/test/recovery/t/019_replslot_limit.pl
M src/test/recovery/t/033_replay_tsp_drops.pl
M src/test/recovery/t/035_standby_logical_decoding.pl

Honor run_as_owner option in tablesync worker.

commit   : a83edeaf684a70da02fa2bce8b7e3aefa3f906f5    
  
author   : Masahiko Sawada <[email protected]>    
date     : Fri, 9 Jun 2023 10:43:03 +0900    
  
committer: Masahiko Sawada <[email protected]>    
date     : Fri, 9 Jun 2023 10:43:03 +0900    

Click here for diff

Commit 482675987 introduced "run_as_owner" subscription option so that  
subscription runs with either the permissions of the subscription  
owner or the permission of the table owner. However, tablesync workers  
did not use this option for the initial data copy.  
  
With this change, tablesync workers run with appropriate permissions  
based on "run_as_owner" option.  
  
Ajin Cherian, with changes and regression tests added by me.  
  
Reported-By: Amit Kapila  
Author: Ajin Cherian, Masahiko Sawada  
Reviewed-by: Ajin Cherian, Amit Kapila  
Discussion: https://postgr.es/m/CAA4eK1L=qzRHPEn+qeMoKQGFBzqGoLBzt_ov0A89iFFiut+ppA@mail.gmail.com  

M src/backend/replication/logical/tablesync.c
M src/test/subscription/t/033_run_as_table_owner.pl

Refactor log check logic for connect_ok/fails in PostgreSQL::Test::Cluster

commit   : 26eaf82e7138890022d5d06b77eb745524542fb7    
  
author   : Michael Paquier <[email protected]>    
date     : Fri, 9 Jun 2023 09:37:21 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Fri, 9 Jun 2023 09:37:21 +0900    

Click here for diff

This commit refactors a bit the code in charge of checking for log  
patterns when connections fail or succeed, by moving the log pattern  
checks into their own routine, for clarity.  This has come up as  
something to improve while discussing the refactoring of find_in_log().  
  
Backpatch down to 14 where these routines are used, to ease the  
introduction of new tests that could rely on them.  
  
Author: Vignesh C, Michael Paquier  
Discussion: https://postgr.es/m/CALDaNm0YSiLpjCmajwLfidQrFOrLNKPQir7s__PeVvh9U3uoTQ@mail.gmail.com  
Backpatch-through: 14  

M src/test/perl/PostgreSQL/Test/Cluster.pm

Fix oversight in outer join removal.

commit   : 9a2dbc614e6e47da3c49daacec106da32eba9467    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 8 Jun 2023 17:10:04 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 8 Jun 2023 17:10:04 -0400    

Click here for diff

A placeholder that references the outer join's relid in ph_eval_at  
is logically "above" the join, and therefore we can't remove its  
PlaceHolderInfo: it might still be used somewhere in the query.  
  
This was not an issue pre-v16 because we failed to remove the join  
at all in such cases.  The new outer-join-aware-Var infrastructure  
permits deducing that it's okay to remove the join, but then we  
have to clean up correctly afterwards.  
  
Report and fix by Richard Guo  
  
Discussion: https://postgr.es/m/CAMbWs4_tuVn9EwwMcggGiZJWWstdXX_ci8FeEU17vs+4nLgw3w@mail.gmail.com  

M src/backend/optimizer/plan/analyzejoins.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Re-allow INDEX_VAR as rt_index in ChangeVarNodes().

commit   : fbf80421ead55deaafbefa808960a2695de492c9    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 8 Jun 2023 13:11:49 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 8 Jun 2023 13:11:49 -0400    

Click here for diff

Apparently some extensions are in the habit of calling  
ChangeVarNodes() with INDEX_VAR as the rt_index to replace.  
That worked before 2489d76c4, at least as long as there were  
not PlaceHolderVars in the expression; but now it fails  
because bms_is_member spits up.  Add a test to avoid that.  
  
Per report from Anton Melnikov, though this is not his  
proposed patch.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/rewrite/rewriteManip.c

Fix small overestimation of base64 encoding output length.

commit   : d98ed080bb31fd3d46281127871b7886288686d9    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 8 Jun 2023 11:24:31 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 8 Jun 2023 11:24:31 -0400    

Click here for diff

pg_base64_enc_len() and its clones overestimated the output  
length by up to 2 bytes, as a result of sloppy thinking about  
where to divide.  No callers require a precise estimate, so  
this has no consequences worse than palloc'ing a byte or two  
more than necessary.  We might as well get it right though.  
  
This bug is very ancient, dating to commit 79d78bb26 which  
added encode.c.  (The other instances were presumably copied  
from there.)  Still, it doesn't quite seem worth back-patching.  
  
Oleg Tselebrovskiy  
  
Discussion: https://postgr.es/m/[email protected]  

M contrib/pgcrypto/pgp-armor.c
M src/backend/utils/adt/encode.c
M src/common/base64.c

doc: Fix example command for ALTER FOREIGN TABLE ... OPTIONS.

commit   : 378d73ef204d0dcbeab834d52478e8cb90578ab7    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 8 Jun 2023 20:11:52 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 8 Jun 2023 20:11:52 +0900    

Click here for diff

In the documentation, previously the example command for  
ALTER FOREIGN TABLE ... OPTIONS incorrectly included both  
the option name and value with the DROP operation.  
The correct syntax for the DROP operation requires only  
the name of the option to be specified. This commit fixes  
the example by removing the option value from the DROP operation.  
  
Back-patch to all supported versions.  
  
Author: Mehmet Emin KARAKAS <[email protected]>  
Reviewed-by: Fujii Masao  
Discussion: https://postgr.es/m/CANQrdXAHzbcEYhjGoe5A42OmfvdQhHFJzyKj9gJvHuDKyOF5Ng@mail.gmail.com  

M doc/src/sgml/ref/alter_foreign_table.sgml

Don't use _BitScanForward64/_BitScanReverse64 on 32-bit MSVC builds

commit   : 53ea2b7ad050ce4ad95c89bb55197209b65886a1    
  
author   : David Rowley <[email protected]>    
date     : Thu, 8 Jun 2023 10:10:34 +1200    
  
committer: David Rowley <[email protected]>    
date     : Thu, 8 Jun 2023 10:10:34 +1200    

Click here for diff

677319746 added support for making use of MSVC's bit scanning functions.  
However, that commit failed to consider 32-bit MSVC builds where the  
64-bit versions of these functions are unavailable.  This resulted in  
compilation failures on 32-bit MSVC.  
  
Here we adjust the code so we fall back on the manual way of finding the  
bit positions for 64-bit integers when building on 32-bit MSVC.  
  
Bug: #17967  
Reported-by: Youmiu Mo  
Discussion: https://postgr.es/m/[email protected]  

M src/include/port/pg_bitutils.h

Use per-tuple context in ExecGetAllUpdatedCols

commit   : f24523672de9c37423800a74cffa7aec27146047    
  
author   : Tomas Vondra <[email protected]>    
date     : Wed, 7 Jun 2023 16:48:50 +0200    
  
committer: Tomas Vondra <[email protected]>    
date     : Wed, 7 Jun 2023 16:48:50 +0200    

Click here for diff

Commit fc22b6623b (generated columns) replaced ExecGetUpdatedCols() with  
ExecGetAllUpdatedCols() in a couple places handling UPDATE (triggers and  
lock mode). However, ExecGetUpdatedCols() did exec_rt_fetch() while  
ExecGetAllUpdatedCols() also allocates memory through bms_union()  
without paying attention to the memory context and happened to use the  
long-lived ExecutorState, leaking the memory until the end of the query.  
  
The amount of leaked memory is proportional to the number of (updated)  
attributes, types of UPDATE triggers, and the number of processed rows  
(which for UPDATE ... FROM ... may be much higher than updated rows).  
  
Fixed by switching to the per-tuple context in GetAllUpdatedColumns().  
This is fine for all in-core callers, but external callers may need to  
copy the result. But we're not aware of any such callers.  
  
Note the issue was introduced by fc22b6623b, but the macros were later  
renamed by f50e888990.  
  
Backpatch to 12, where the issue was introduced.  
  
Reported-by: Tomas Vondra  
Reviewed-by: Andres Freund, Tom Lane, Jakub Wartak  
Backpatch-through: 12  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/executor/execUtils.c

doc: Fix confusing positioning of notes in connection settings

commit   : fb5a7d84d23fa2e1f26334453948a01e8e59eee3    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 7 Jun 2023 17:54:53 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 7 Jun 2023 17:54:53 +0200    

Click here for diff

Reported-by: Jonathan S. Katz <[email protected]>  
Reviewed-by: Daniel Gustafsson <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/6f825d42-a1ce-492a-2ea7-c83e6e65fa8b%40postgresql.org  

M doc/src/sgml/config.sgml

Remove read-only server settings lc_collate and lc_ctype

commit   : b0f6c437160db640d4ea3e49398ebc3ba39d1982    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 7 Jun 2023 16:57:06 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 7 Jun 2023 16:57:06 +0200    

Click here for diff

The GUC settings lc_collate and lc_ctype are from a time when those  
locale settings were cluster-global.  When those locale settings were  
made per-database (PG 8.4), the settings were kept as read-only.  As  
of PG 15, you can use ICU as the per-database locale provider, so  
examining these settings is already less meaningful and possibly  
confusing, since you need to look into pg_database to find out what is  
really happening, and they would likely become fully obsolete in the  
future anyway.  
  
Reviewed-by: Jeff Davis <[email protected]>  
Discussion: https://www.postgresql.org/message-id/[email protected]  

M contrib/citext/expected/citext_utf8.out
M contrib/citext/expected/citext_utf8_1.out
M contrib/citext/sql/citext_utf8.sql
M doc/src/sgml/config.sgml
M src/backend/utils/init/postinit.c
M src/backend/utils/misc/guc_tables.c
M src/test/regress/expected/collate.icu.utf8.out
M src/test/regress/expected/collate.linux.utf8.out
M src/test/regress/expected/collate.windows.win1252.out
M src/test/regress/sql/collate.icu.utf8.sql
M src/test/regress/sql/collate.linux.utf8.sql
M src/test/regress/sql/collate.windows.win1252.sql

Reload configuration more frequently in apply worker.

commit   : d64e6468f489effec356ce3501c0f226ac1cfcc0    
  
author   : Amit Kapila <[email protected]>    
date     : Wed, 7 Jun 2023 09:19:17 +0530    
  
committer: Amit Kapila <[email protected]>    
date     : Wed, 7 Jun 2023 09:19:17 +0530    

Click here for diff

The apply worker was not reloading the configuration while processing  
messages if there is a continuous flow of messages from upstream. It was  
also not reloading the configuration if there is a change in the  
configuration after it has waited for the message and before receiving the  
new replication message. This can lead to failure in tests because we  
expect that after reload, the behavior of apply worker to respect the  
changed GUCs.  
  
We found this while analyzing a rare buildfarm failure.  
  
Author: Hou Zhijie  
Reviewed-by: Amit Kapila  
Discussion: https://postgr.es/m/OS0PR01MB5716AF9079CC0755CD015322947E9@OS0PR01MB5716.jpnprd01.prod.outlook.com  

M src/backend/replication/logical/worker.c

Initialize 'recordXtime' to silence compiler warning.

commit   : 95f0340c3bc745aee3aa90847efd2007e40236e9    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Tue, 6 Jun 2023 20:30:53 +0300    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Tue, 6 Jun 2023 20:30:53 +0300    

Click here for diff

In reality, recordXtime will always be set by the getRecordTimestamp  
call, but the compiler doesn't necessarily see that.  
  
Back-patch to all supported versions.  
  
Author: Tristan Partin  
Discussion: https://www.postgresql.org/message-id/CT5MN8E11U0M.1NYNCHXYUHY41@gonk  

M src/backend/access/transam/xlogrecovery.c

doc: PG 16 relnotes, fix PREPARE/EXECUTE wording

commit   : 3f1aaaa180689f2015e7f7bd01c9be6d7a993b42    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 5 Jun 2023 14:00:37 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 5 Jun 2023 14:00:37 -0400    

Click here for diff

Reported-by: Erik Rijkers  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/release-16.sgml

Remove obsolete comment

commit   : 08235203ddefde1d0bfb6a1e8bb6ff546a2c7e8c    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 5 Jun 2023 15:33:08 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 5 Jun 2023 15:33:08 +0200    

Click here for diff

OIDs are no longer system columns, since 578b229718.  

M src/include/executor/tuptable.h

Doc: unify use of timestamp with time zone vs timestamptz

commit   : 8cddea9a539cbbdd1b316255c9f404323243fd37    
  
author   : David Rowley <[email protected]>    
date     : Mon, 5 Jun 2023 17:34:27 +1200    
  
committer: David Rowley <[email protected]>    
date     : Mon, 5 Jun 2023 17:34:27 +1200    

Click here for diff

For pg_stat_all_tables, last_vacuum, last_autovacuum and co all used the  
full "timestamp with time zone" type name.  For consistency, make the  
newly added "last_seq_scan" also use the full type name instead of  
"timestamptz".  
  
Author: Noriyoshi Shinoda  
Discussion: https://postgr.es/m/DM4PR84MB17348EA11FA90A9BE896AF89EE489%40DM4PR84MB1734.NAMPRD84.PROD.OUTLOOK.COM  

M doc/src/sgml/monitoring.sgml

Doc: explain about dependency tracking for new-style SQL functions.

commit   : 0211544969b589e49c40d113822162ee3ed78bd6    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 4 Jun 2023 13:27:34 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 4 Jun 2023 13:27:34 -0400    

Click here for diff

5.14 Dependency Tracking was not updated when we added new-style  
SQL functions.  Improve that.  
  
Noted by Sami Imseih.  Back-patch to v14 where  
new-style SQL functions came in.  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/ddl.sgml

Fix pg_dump's failure to honor dependencies of SQL functions.

commit   : 01610747867ff26ca62d099e83e62d97730c40c1    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 4 Jun 2023 13:05:54 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 4 Jun 2023 13:05:54 -0400    

Click here for diff

A new-style SQL function can contain a parse-time dependency  
on a unique index, much as views and matviews can (such cases  
arise from GROUP BY and ON CONFLICT clauses, for example).  
To dump and restore such a function successfully, pg_dump must  
postpone the function until after the unique index is created,  
which will happen in the post-data part of the dump.  Therefore  
we have to remove the normal constraint that functions are  
dumped in pre-data.  Add code similar to the existing logic  
that handles this for matviews.  I added test cases for both  
as well, since code coverage tests showed that we weren't  
testing the matview logic.  
  
Per report from Sami Imseih.  Back-patch to v14 where  
new-style SQL functions came in.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dump.h
M src/bin/pg_dump/pg_dump_sort.c
M src/bin/pg_dump/t/002_pg_dump.pl

Fix misuse of pg_log_info() for details/hints.

commit   : b3f32a6c312c476beecb7864450f4f6c448cd1bc    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 4 Jun 2023 11:22:05 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 4 Jun 2023 11:22:05 -0400    

Click here for diff

Two places in pg_dump_sort.c were using pg_log_info() to add  
more details to a message printed with pg_log_warning().  
This is bad, because at default verbosity level we would  
print the warning line but not the details.  One should use  
pg_log_warning_detail() or pg_log_warning_hint() instead.  
Commit 9a374b77f got rid of most such abuses, but unaccountably  
missed these.  
  
Noted while studying a bug report from Sami Imseih.  
Back-patch to v15 where 9a374b77f came in.  (Prior versions  
don't have the missing-details misbehavior, for reasons  
I didn't bother to track down.)  
  
Discussion: https://postgr.es/m/[email protected]  

M src/bin/pg_dump/pg_dump_sort.c

doc: Add note to prevent server spoofing with SCRAM

commit   : d0f4824a54104bb831ebcd46982e6e3b337ef5fa    
  
author   : Michael Paquier <[email protected]>    
date     : Sat, 3 Jun 2023 17:44:09 -0400    
  
committer: Michael Paquier <[email protected]>    
date     : Sat, 3 Jun 2023 17:44:09 -0400    

Click here for diff

The set of recommendations added in the documentation with this commit  
helps in avoiding SCRAM exchanges with untrusted servers.  
  
Author: Jacob Champion, Jonathan Katz  
Reviewed-by: Stephen Frost, Daniel Gustafsson, Michael Paquier  
Discussion: https://postgr.es/m/CAAWbhmg5Gh0JetNbQi7z0yOsdsN9YECv8GoY-QBGBBiip9+JOw@mail.gmail.com  

M doc/src/sgml/runtime.sgml

doc: PG 16 relnotes, add psql \df+ source code change

commit   : 47b7051bc82f11f19df43544045c93549783e962    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 1 Jun 2023 19:59:46 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 1 Jun 2023 19:59:46 -0400    

Click here for diff

Reported-by: [email protected]  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/release-16.sgml

doc: add missing "the" in LATERAL sentence.

commit   : 9eb1817d5cb8e85a753ea658059495d0b75a623a    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 1 Jun 2023 10:22:16 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 1 Jun 2023 10:22:16 -0400    

Click here for diff

Backpatch-through: 11  

M doc/src/sgml/queries.sgml

doc: PG 16 relnotes, move memory item and reword OUTER item

commit   : e6a254c0d4af1f693f23b2f5fd550914c4c7e90c    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 31 May 2023 07:01:21 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 31 May 2023 07:01:21 -0400    

Click here for diff

Reported-by: David Rowley  
  
Discussion: https://postgr.es/m/CAApHDvqmqxcX2n9NwvsfnsN0be6DjmyLSjz3Jk2DaZO5OLW+pw@mail.gmail.com  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, add memory overhead reduction item

commit   : 409d24485cbee46cbfbc101ac6bde7d890f470b8    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 30 May 2023 19:32:15 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 30 May 2023 19:32:15 -0400    

Click here for diff

Reported-by: David Rowley  
  
Discussion: https://postgr.es/m/CAApHDvqnUoyrJxS4uqnKo87b3_cUjaDDte4NQag49YHu1oEOgA@mail.gmail.com  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, adjust subscription origin mention

commit   : f7c16a120cfa550214a14e3f42ce949fdd37ec40    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 30 May 2023 19:08:14 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 30 May 2023 19:08:14 -0400    

Click here for diff

Reported-by: Masahiko Sawada  
  
Discussion: https://postgr.es/m/CAD21AoC+VihMWs3-xVB3Z=8LzLbsQc52TO29o25rzfqcnJDCUQ@mail.gmail.com  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, adjust auto_explain logging item

commit   : 0bcb3ca3b95b2b94de0b337a73aef333e0346c44    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 30 May 2023 06:04:09 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 30 May 2023 06:04:09 -0400    

Click here for diff

Reported-by: Dagfinn Ilmari Mannsåker  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/release-16.sgml

doc: Add missing backend_type to pg_stat_activity

commit   : e77c6c55e8dd834667006d2b3ba5f2868c21671f    
  
author   : Daniel Gustafsson <[email protected]>    
date     : Tue, 30 May 2023 10:31:11 +0200    
  
committer: Daniel Gustafsson <[email protected]>    
date     : Tue, 30 May 2023 10:31:11 +0200    

Click here for diff

Commit 0c679464a8 added the missing backendDesc for B_STANDALONE_BACKEND  
but missed updating the list of backend types in the documentation.  Fix  
by adding it to the list.  
  
Author: Noriyoshi Shinoda <[email protected]>  
Discussion: https://postgr.es/m/DM4PR84MB1734ECEA02BCB59564E8FC03EE4A9@DM4PR84MB1734.NAMPRD84.PROD.OUTLOOK.COM  

M doc/src/sgml/monitoring.sgml

doc: PG 16 relnotes: adjust outer/full hash join parallelization

commit   : 5a64640966227eac582f2961b8f4a59cd1cca446    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 29 May 2023 14:36:27 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 29 May 2023 14:36:27 -0400    

Click here for diff

Reported-by: David Rowley  
  
Discussion: https://postgr.es/m/CAApHDvph4djrP+zjOK67VcgbB_p9Zn8QoO7Qctt4oQgUC_ejEw@mail.gmail.com  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, fix duplicate author and commit

commit   : 9e28b83ae6fabd8ae03eec7fa9533de018e9306e    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 29 May 2023 13:49:05 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 29 May 2023 13:49:05 -0400    

Click here for diff

Reported-by: Masahiko Sawada  
  
Discussion: https://postgr.es/m/CAD21AoALE_joh=H-j5sdaAfDs=BXtCy6BQKYZBTi=neU8k0VFw@mail.gmail.com  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, fix "locale" typo and windows locale text

commit   : 503b0556d96f2c8df6ed91c5a8cf11b23f37ce6d    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 27 May 2023 23:04:48 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 27 May 2023 23:04:48 -0400    

Click here for diff

Reported-by: Laurenz Albe, Álvaro Herrera  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/release-16.sgml

ICU: use uloc_getDefault() for initdb.

commit   : ec1264f01e374c48707cc7dc18928b4ace0530fb    
  
author   : Jeff Davis <[email protected]>    
date     : Fri, 26 May 2023 11:26:11 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Fri, 26 May 2023 11:26:11 -0700    

Click here for diff

Simpler, and better preserves the locale name as read from the  
environment.  
  
Author: Daniel Verite  
Discussion: https://postgr.es/m/[email protected]  

M src/bin/initdb/initdb.c

Fix joinclause removal logic to cope with cloned clauses.

commit   : 7a844c77ece1bda3b076034bc20142d4bd66db7a    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 26 May 2023 12:13:19 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 26 May 2023 12:13:19 -0400    

Click here for diff

When we're deleting a no-op LEFT JOIN from the query, we must remove  
the join's joinclauses from surviving relations' joininfo lists.  
The invention of "cloned" clauses in 2489d76c4 broke the logic for  
that; it'd fail to remove clones that include OJ relids outside the  
doomed join's min relid sets, which could happen if that join was  
previously discovered to commute with some other join.  
  
This accidentally failed to cause problems in the majority of cases,  
because we'd never decide that such a cloned clause was evaluatable at  
any surviving join.  However, Richard Guo discovered a case where that  
did happen, leading to "no relation entry for relid" errors later.  
Also, adding assertions that a non-removed clause contains no Vars from  
the doomed join exposes that there are quite a few existing regression  
test cases where the problem happens but is accidentally not exposed.  
  
The fix for this is just to include the target join's commute_above_r  
and commute_below_l sets in the relid set we test against when  
deciding whether a join clause is "pushed down" and thus not  
removable.  
  
While at it, do a little refactoring: the join's relid set can be  
computed inside remove_rel_from_query rather than in the caller.  
  
Patch by me; thanks to Richard Guo for review.  
  
Discussion: https://postgr.es/m/CAMbWs4_PHrRqTKDNnTRsxxQy6BtYCVKsgXm1_gdN2yQ=kmcO5g@mail.gmail.com  

M src/backend/optimizer/plan/analyzejoins.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Doc fixes for commit 1e16af8ab5.

commit   : f4a9422c0c37ba638adbab853b8badb98a53ce04    
  
author   : Jeff Davis <[email protected]>    
date     : Thu, 25 May 2023 17:05:50 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Thu, 25 May 2023 17:05:50 -0700    

Click here for diff

Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/charset.sgml

commit   : 5abff197cc3ec2b0a1f5a64fd34953d0318bca79    
  
author   : Peter Geoghegan <[email protected]>    
date     : Thu, 25 May 2023 15:33:00 -0700    
  
committer: Peter Geoghegan <[email protected]>    
date     : Thu, 25 May 2023 15:33:00 -0700    

Click here for diff

Avoid "right sibling's left-link doesn't match" errors when vacuuming a  
corrupt nbtree index.  Just LOG the issue and press on.  That way VACUUM  
will have a decent chance of finishing off all required processing for  
the index (and for the table as a whole).  
  
This error was seen in the field from time to time (it's more than a  
theoretical risk), so giving VACUUM the ability to press on like this  
has real value.  Nothing short of a REINDEX is expected to fix the  
underlying index corruption, so giving up (by throwing an error) risks  
making a bad situation far worse.  Anything that blocks forward progress  
by VACUUM like this might go unnoticed for a long time.  This could  
eventually lead to a wraparound/xidStopLimit outage.  
  
Note that _bt_unlink_halfdead_page() has always been able to bail on  
page deletion when the target page's left sibling page was in an  
inconsistent state.  It now does the same thing (returns false to back  
out of the second phase of deletion) when it notices sibling link  
corruption in the target page's right sibling page.  
  
This is similar to the work from commit 5b861baa (later backpatched as  
commit 43e409ce), which taught nbtree to press on with vacuuming an  
index when page deletion fails to "re-find" a downlink in the target  
page's parent page.  The "re-find" check seems to make VACUUM bail on  
page deletion more often in practice, but there is no reason to take any  
chances here.  
  
Author: Peter Geoghegan <[email protected]>  
Reviewed-By: Heikki Linnakangas <[email protected]>  
Discussion: https://postgr.es/m/CAH2-Wzko2q2kP1+UvgJyP9g0mF4hopK0NtQZcxwvMv9_ytGhkQ@mail.gmail.com  
Backpatch: 11- (all supported versions).  

M src/backend/access/nbtree/nbtpage.c
M src/backend/access/nbtree/nbtree.c

Fix filtering of "cloned" outer-join quals some more.

commit   : 991a3df227e9e8b16d7399df3961dfaae4ae677c    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 25 May 2023 10:28:33 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 25 May 2023 10:28:33 -0400    

Click here for diff

We've had multiple issues with the clause_is_computable_at logic that  
I introduced in 2489d76c4: it's been known to accept more than one  
clone of the same qual at the same plan node, and also to accept no  
clones at all.  It's looking impractical to get it 100% right on the  
basis of the currently-stored information, so fix it by introducing a  
new RestrictInfo field "incompatible_relids" that explicitly shows  
which outer joins a given clone mustn't be pushed above.  
  
In principle we could populate this field in every RestrictInfo, but  
that would cost space and there doesn't presently seem to be a need  
for it in general.  Also, while deconstruct_distribute_oj_quals can  
easily fill the field with the remaining members of the commutative  
join set that it's considering, computing it in the general case  
seems again pretty complicated.  So for now, just fill it for  
clone quals.  
  
Along the way, fix a bug that may or may not be only latent:  
equivclass.c was generating replacement clauses with is_pushed_down  
and has_clone/is_clone markings that didn't match their  
required_relids.  This led me to conclude that leaving the clone flags  
out of make_restrictinfo's purview wasn't such a great idea after all,  
so add them.  
  
Per report from Richard Guo.  
  
Discussion: https://postgr.es/m/CAMbWs48EYi_9-pSd0ORes1kTmTeAjT4Q3gu49hJtYCbSn2JyeA@mail.gmail.com  

M contrib/postgres_fdw/postgres_fdw.c
M src/backend/optimizer/README
M src/backend/optimizer/path/equivclass.c
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/util/inherit.c
M src/backend/optimizer/util/orclauses.c
M src/backend/optimizer/util/relnode.c
M src/backend/optimizer/util/restrictinfo.c
M src/include/nodes/pathnodes.h
M src/include/optimizer/restrictinfo.h
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

doc: fix typo in language tag documentation

commit   : 913b3da6aeda3f887b8796d8098d7227d32580b9    
  
author   : Daniel Gustafsson <[email protected]>    
date     : Thu, 25 May 2023 12:49:26 +0200    
  
committer: Daniel Gustafsson <[email protected]>    
date     : Thu, 25 May 2023 12:49:26 +0200    

Click here for diff

Commit 1e16af8ab5 accidentally mistyped 'language' in one place.  

M doc/src/sgml/charset.sgml

doc: Fix example query for pg_walinspect

commit   : 661bf96cd208238efb45c75e3af5ad400e5b0026    
  
author   : Daniel Gustafsson <[email protected]>    
date     : Thu, 25 May 2023 12:43:16 +0200    
  
committer: Daniel Gustafsson <[email protected]>    
date     : Thu, 25 May 2023 12:43:16 +0200    

Click here for diff

The LIMIT clause had ended up in the wrong place in the query.  
Backpatch to v15 where pg_walinspect was introduced.  
  
Reported-by: Jian He <[email protected]>  
Discussion: https://postgr.es/m/CACJufxHqXDr4NnmwmR6pEiVPAg54J0dgwMuYQzrH5BX6+NtF1g@mail.gmail.com  
Backpatch-through: 15  

M doc/src/sgml/pgwalinspect.sgml

Fix pgbench in prepared mode with an empty pipeline

commit   : 8f5e42d3346924b5d6330208d62ec1b19fdbc110    
  
author   : Alvaro Herrera <[email protected]>    
date     : Thu, 25 May 2023 12:36:18 +0200    
  
committer: Alvaro Herrera <[email protected]>    
date     : Thu, 25 May 2023 12:36:18 +0200    

Click here for diff

It crashes because it references memory that's not allocated in that  
particular case.  Fix by allocating it.  
  
Reported-by: Alexander Lakhin <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/bin/pgbench/pgbench.c
M src/bin/pgbench/t/001_pgbench_with_server.pl

Fix typo in TAP tests of vacuumdb

commit   : ecb968e7e3da69a39d3efab69fa63fe6c8d04b5f    
  
author   : Michael Paquier <[email protected]>    
date     : Thu, 25 May 2023 16:26:08 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Thu, 25 May 2023 16:26:08 +0900    

Click here for diff

Noticed while scanning the area, introduced in 582edc3.  

M src/bin/scripts/t/100_vacuumdb.pl

doc: PG 16 relnotes, add author from previous merge

commit   : 46ba86cd32dc499a5cf8fbab7d3f596f4e7852a2    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 24 May 2023 22:03:40 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 24 May 2023 22:03:40 -0400    

Click here for diff

Reported-by: John Naylor  
  
Discussion: https://postgr.es/m/CAFBsxsEMoNdg6CCMuQ-6YJ8G=AgGNMVuiTb5Di5bsoPfBb=9CA@mail.gmail.com  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, wording adjustments

commit   : 5c2c59ba0b5f723b067a6fa8bf8452d41fbb2125    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 24 May 2023 12:18:43 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 24 May 2023 12:18:43 -0400    

Click here for diff

Reported-by: Erik Rijkers  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, merge and move vector items

commit   : ad5406246bff5490fbd428c148717c5b87e52ab1    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 24 May 2023 09:54:34 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 24 May 2023 09:54:34 -0400    

Click here for diff

Reported-by: John Naylor  
  
Discussion: https://postgr.es/m/CAFBsxsEPg8L2MmGqavc8JByC=WF_Mnkhn-KKnFPkcqh0hydung@mail.gmail.com  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, update xid/subxid searches item

commit   : a817edbf6f302c376f5c0012d19a0474b6bdea88    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 24 May 2023 00:09:13 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 24 May 2023 00:09:13 -0400    

Click here for diff

Reported-by: John Naylor  
  
Discussion: https://postgr.es/m/CAFBsxsEPg8L2MmGqavc8JByC=WF_Mnkhn-KKnFPkcqh0hydung@mail.gmail.com  

M doc/src/sgml/release-16.sgml

Document deprecated createuser option.

commit   : 381d19b3ea0e7593d30a3af8df20d92bbccb775f    
  
author   : Nathan Bossart <[email protected]>    
date     : Tue, 23 May 2023 19:34:09 -0700    
  
committer: Nathan Bossart <[email protected]>    
date     : Tue, 23 May 2023 19:34:09 -0700    

Click here for diff

2dcd1578c4 left the --role option undocumented, which is  
inconsistent with other deprecated options such as pg_dump's  
--blobs and --no-blobs.  This change adds --role back to  
createuser's documentation and usage output and marks it as  
deprecated.  
  
Suggested-by: Peter Eisentraut  
Reviewed-by: Michael Paquier  
Discussion: https://postgr.es/m/0e85c9e7-4804-1cdb-5a4a-c72c328f9ad8%40enterprisedb.com  

M doc/src/sgml/ref/createuser.sgml
M src/bin/scripts/createuser.c
M src/bin/scripts/t/040_createuser.pl

Doc: update src/tools/pginclude/README.

commit   : be3f62ae6e9839b10db0052a973e5fdc5b789abc    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 23 May 2023 18:51:43 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 23 May 2023 18:51:43 -0400    

Click here for diff

Commit f62975b2a made headerscheck and cpluspluscheck a little  
smarter than this documentation gave them credit for.  Make  
their docs match current reality.  Also add a warning about the  
layer of dust that has settled on the rest of these scripts.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/tools/pginclude/README

Fix the install rule for snowball_create.sql.

commit   : 5df5bea29070b420452bdb257c3dec1cf0419fca    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 23 May 2023 11:15:57 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 23 May 2023 11:15:57 -0400    

Click here for diff

This file could be in the current (build) directory if we just  
built it.  However, when installing from a VPATH build from a  
tarball, it will exist in the source directory and gmake will  
therefore not rebuild it.  Use the $< macro to find out where  
gmake found it.  
  
Oversight in b3a0d8324, which also exposes a buildfarm testing gap:  
we test install from VPATH builds from bare source trees, but not  
from tarballs.  
  
Per report from Christoph Berg.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/snowball/Makefile

Use lower case for icu_validation_level values

commit   : 0ffbe6e59197e5e2b3bf026f594fabb8ada9bec3    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 23 May 2023 15:19:33 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 23 May 2023 15:19:33 +0200    

Click here for diff

Similar to client_min_messages etc.  

M src/backend/utils/misc/postgresql.conf.sample

Punctuation improvement in postgresql.conf.sample

commit   : dfe0169988f32e7cb9c48fad9ab3de71c6c39a55    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 23 May 2023 15:19:12 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 23 May 2023 15:19:12 +0200    

Click here for diff

M src/backend/utils/misc/postgresql.conf.sample

Add newline at end of file

commit   : f40177c904f17721c3d33a6c202b74f3f2d4874d    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 23 May 2023 15:18:06 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 23 May 2023 15:18:06 +0200    

Click here for diff

M src/test/ssl/conf/server-rsapss.config

doc: PG 16 relnotes, SIMD improvements

commit   : 5cb54fc310fb84287cbdc74533f3420490a2f63a    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 23 May 2023 00:27:01 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 23 May 2023 00:27:01 -0400    

Click here for diff

Reported-by: John Naylor  
  
Discussion: https://postgr.es/m/CAFBsxsEuAx4_nq=200u=70S5r83C2hzO-a9+c6YXTCbOFeDAfw@mail.gmail.com  

M doc/src/sgml/release-16.sgml

Stamp 16beta1.

commit   : e0b82fc8e8317881ecdd1e28bece55ea0db952da    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 22 May 2023 17:08:08 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 22 May 2023 17:08:08 -0400    

Click here for diff

M configure
M configure.ac
M meson.build

doc: PG 16 relnotes, add major features list

commit   : 60751aa50313b3498de199a3cd62e5f30e6b6091    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 22 May 2023 13:58:24 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 22 May 2023 13:58:24 -0400    

Click here for diff

Reported-by: Jonathan Katz  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/release-16.sgml

Spell the values of libpq's gssdelegation parameter as "0" and "1".

commit   : 1f9f6aa491986ed4e65851e827d021e9c784fd42    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 22 May 2023 11:50:20 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 22 May 2023 11:50:20 -0400    

Click here for diff

That's how other boolean options are handled, so do likewise.  
The previous coding with "enable" and "disable" was seemingly  
modeled on gssencmode, but that's a three-way flag.  
  
While at it, add PGGSSDELEGATION to the set of environment  
variables cleared by pg_regress and Utils.pm.  
  
Abhijit Menon-Sen, per gripe from Alvaro Herrera  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/libpq.sgml
M doc/src/sgml/release-16.sgml
M src/interfaces/libpq/fe-auth.c
M src/interfaces/libpq/fe-connect.c
M src/interfaces/libpq/fe-secure-gssapi.c
M src/interfaces/libpq/libpq-int.h
M src/test/kerberos/t/001_auth.pl
M src/test/perl/PostgreSQL/Test/Utils.pm
M src/test/regress/pg_regress.c

doc: PG 16 relnotes, improve desc. of pg_log_standby_snapshot()

commit   : 4123455a9e5463495a6e9be8423e671c874ec19f    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 22 May 2023 10:20:53 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 22 May 2023 10:20:53 -0400    

Click here for diff

M doc/src/sgml/release-16.sgml

Translation updates

commit   : 473e02f6f9ba1863c59a9e40736a633ed52c139f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 22 May 2023 12:44:31 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 22 May 2023 12:44:31 +0200    

Click here for diff

Source-Git-URL: https://git.postgresql.org/git/pgtranslation/messages.git  
Source-Git-Hash: 642d41265b1ea68ae71a66ade5c5440ba366a890  

M src/backend/po/de.po
M src/backend/po/es.po
M src/backend/po/fr.po
M src/backend/po/it.po
M src/backend/po/ja.po
M src/backend/po/ru.po
M src/backend/po/sv.po
M src/backend/po/uk.po
M src/bin/initdb/po/LINGUAS
M src/bin/initdb/po/de.po
M src/bin/initdb/po/el.po
M src/bin/initdb/po/es.po
M src/bin/initdb/po/fr.po
M src/bin/initdb/po/it.po
M src/bin/initdb/po/ja.po
A src/bin/initdb/po/ka.po
M src/bin/initdb/po/pt_BR.po
M src/bin/initdb/po/ru.po
M src/bin/initdb/po/sv.po
M src/bin/initdb/po/uk.po
M src/bin/pg_amcheck/po/LINGUAS
M src/bin/pg_amcheck/po/el.po
M src/bin/pg_amcheck/po/es.po
A src/bin/pg_amcheck/po/it.po
M src/bin/pg_amcheck/po/ja.po
A src/bin/pg_amcheck/po/ka.po
M src/bin/pg_amcheck/po/ru.po
M src/bin/pg_amcheck/po/uk.po
M src/bin/pg_archivecleanup/po/LINGUAS
M src/bin/pg_archivecleanup/po/el.po
M src/bin/pg_archivecleanup/po/es.po
A src/bin/pg_archivecleanup/po/it.po
M src/bin/pg_archivecleanup/po/ja.po
A src/bin/pg_archivecleanup/po/ka.po
A src/bin/pg_archivecleanup/po/pt_BR.po
M src/bin/pg_archivecleanup/po/ru.po
M src/bin/pg_archivecleanup/po/uk.po
M src/bin/pg_basebackup/po/LINGUAS
M src/bin/pg_basebackup/po/de.po
A src/bin/pg_basebackup/po/el.po
M src/bin/pg_basebackup/po/es.po
M src/bin/pg_basebackup/po/fr.po
M src/bin/pg_basebackup/po/it.po
M src/bin/pg_basebackup/po/ja.po
A src/bin/pg_basebackup/po/ka.po
M src/bin/pg_basebackup/po/ru.po
M src/bin/pg_basebackup/po/sv.po
M src/bin/pg_basebackup/po/uk.po
M src/bin/pg_checksums/po/LINGUAS
M src/bin/pg_checksums/po/el.po
M src/bin/pg_checksums/po/es.po
A src/bin/pg_checksums/po/it.po
M src/bin/pg_checksums/po/ja.po
A src/bin/pg_checksums/po/ka.po
A src/bin/pg_checksums/po/pt_BR.po
M src/bin/pg_checksums/po/ru.po
M src/bin/pg_checksums/po/uk.po
M src/bin/pg_config/po/LINGUAS
M src/bin/pg_config/po/de.po
M src/bin/pg_config/po/es.po
M src/bin/pg_config/po/it.po
M src/bin/pg_config/po/ja.po
A src/bin/pg_config/po/ka.po
M src/bin/pg_config/po/pt_BR.po
M src/bin/pg_config/po/ru.po
M src/bin/pg_config/po/uk.po
M src/bin/pg_controldata/po/LINGUAS
M src/bin/pg_controldata/po/el.po
M src/bin/pg_controldata/po/es.po
M src/bin/pg_controldata/po/it.po
M src/bin/pg_controldata/po/ja.po
A src/bin/pg_controldata/po/ka.po
M src/bin/pg_controldata/po/pt_BR.po
M src/bin/pg_controldata/po/ru.po
M src/bin/pg_controldata/po/uk.po
M src/bin/pg_ctl/po/LINGUAS
M src/bin/pg_ctl/po/cs.po
M src/bin/pg_ctl/po/de.po
M src/bin/pg_ctl/po/el.po
M src/bin/pg_ctl/po/es.po
M src/bin/pg_ctl/po/fr.po
M src/bin/pg_ctl/po/it.po
M src/bin/pg_ctl/po/ja.po
A src/bin/pg_ctl/po/ka.po
M src/bin/pg_ctl/po/ko.po
M src/bin/pg_ctl/po/pl.po
M src/bin/pg_ctl/po/pt_BR.po
M src/bin/pg_ctl/po/ru.po
M src/bin/pg_ctl/po/tr.po
M src/bin/pg_ctl/po/uk.po
M src/bin/pg_ctl/po/zh_CN.po
M src/bin/pg_dump/po/LINGUAS
M src/bin/pg_dump/po/de.po
M src/bin/pg_dump/po/el.po
M src/bin/pg_dump/po/es.po
M src/bin/pg_dump/po/fr.po
M src/bin/pg_dump/po/it.po
M src/bin/pg_dump/po/ja.po
A src/bin/pg_dump/po/ka.po
M src/bin/pg_dump/po/ru.po
M src/bin/pg_dump/po/sv.po
M src/bin/pg_dump/po/uk.po
M src/bin/pg_resetwal/po/LINGUAS
M src/bin/pg_resetwal/po/el.po
M src/bin/pg_resetwal/po/es.po
M src/bin/pg_resetwal/po/it.po
M src/bin/pg_resetwal/po/ja.po
A src/bin/pg_resetwal/po/ka.po
M src/bin/pg_resetwal/po/pt_BR.po
M src/bin/pg_resetwal/po/ru.po
M src/bin/pg_resetwal/po/uk.po
M src/bin/pg_rewind/po/LINGUAS
M src/bin/pg_rewind/po/de.po
M src/bin/pg_rewind/po/el.po
M src/bin/pg_rewind/po/es.po
M src/bin/pg_rewind/po/fr.po
M src/bin/pg_rewind/po/it.po
M src/bin/pg_rewind/po/ja.po
A src/bin/pg_rewind/po/ka.po
M src/bin/pg_rewind/po/ru.po
M src/bin/pg_rewind/po/sv.po
M src/bin/pg_rewind/po/uk.po
M src/bin/pg_test_fsync/po/LINGUAS
M src/bin/pg_test_fsync/po/el.po
M src/bin/pg_test_fsync/po/es.po
A src/bin/pg_test_fsync/po/it.po
M src/bin/pg_test_fsync/po/ja.po
A src/bin/pg_test_fsync/po/ka.po
A src/bin/pg_test_fsync/po/pt_BR.po
M src/bin/pg_test_fsync/po/ru.po
M src/bin/pg_test_fsync/po/uk.po
M src/bin/pg_test_timing/po/LINGUAS
M src/bin/pg_test_timing/po/es.po
A src/bin/pg_test_timing/po/it.po
M src/bin/pg_test_timing/po/ja.po
A src/bin/pg_test_timing/po/ka.po
A src/bin/pg_test_timing/po/pt_BR.po
M src/bin/pg_test_timing/po/uk.po
M src/bin/pg_upgrade/po/LINGUAS
M src/bin/pg_upgrade/po/de.po
M src/bin/pg_upgrade/po/es.po
M src/bin/pg_upgrade/po/ja.po
A src/bin/pg_upgrade/po/ka.po
M src/bin/pg_verifybackup/po/LINGUAS
M src/bin/pg_verifybackup/po/de.po
M src/bin/pg_verifybackup/po/el.po
M src/bin/pg_verifybackup/po/es.po
A src/bin/pg_verifybackup/po/it.po
M src/bin/pg_verifybackup/po/ja.po
A src/bin/pg_verifybackup/po/ka.po
M src/bin/pg_verifybackup/po/ru.po
M src/bin/pg_verifybackup/po/uk.po
M src/bin/pg_waldump/po/LINGUAS
M src/bin/pg_waldump/po/de.po
M src/bin/pg_waldump/po/el.po
M src/bin/pg_waldump/po/es.po
M src/bin/pg_waldump/po/fr.po
A src/bin/pg_waldump/po/it.po
M src/bin/pg_waldump/po/ja.po
A src/bin/pg_waldump/po/ka.po
M src/bin/pg_waldump/po/ru.po
M src/bin/pg_waldump/po/sv.po
M src/bin/psql/po/LINGUAS
M src/bin/psql/po/de.po
M src/bin/psql/po/el.po
M src/bin/psql/po/es.po
M src/bin/psql/po/fr.po
M src/bin/psql/po/it.po
M src/bin/psql/po/ja.po
A src/bin/psql/po/ka.po
M src/bin/psql/po/ru.po
M src/bin/psql/po/sv.po
M src/bin/psql/po/uk.po
M src/bin/scripts/po/LINGUAS
M src/bin/scripts/po/de.po
M src/bin/scripts/po/el.po
M src/bin/scripts/po/es.po
M src/bin/scripts/po/it.po
M src/bin/scripts/po/ja.po
A src/bin/scripts/po/ka.po
M src/bin/scripts/po/pt_BR.po
M src/bin/scripts/po/ru.po
M src/bin/scripts/po/uk.po
M src/interfaces/ecpg/ecpglib/po/LINGUAS
M src/interfaces/ecpg/ecpglib/po/es.po
M src/interfaces/ecpg/ecpglib/po/ja.po
A src/interfaces/ecpg/ecpglib/po/ka.po
M src/interfaces/ecpg/ecpglib/po/pt_BR.po
M src/interfaces/ecpg/ecpglib/po/ru.po
M src/interfaces/ecpg/ecpglib/po/uk.po
M src/interfaces/ecpg/preproc/po/LINGUAS
M src/interfaces/ecpg/preproc/po/el.po
M src/interfaces/ecpg/preproc/po/es.po
M src/interfaces/ecpg/preproc/po/it.po
M src/interfaces/ecpg/preproc/po/ja.po
A src/interfaces/ecpg/preproc/po/ka.po
M src/interfaces/ecpg/preproc/po/pt_BR.po
M src/interfaces/ecpg/preproc/po/ru.po
M src/interfaces/ecpg/preproc/po/uk.po
M src/interfaces/libpq/po/LINGUAS
M src/interfaces/libpq/po/de.po
M src/interfaces/libpq/po/es.po
M src/interfaces/libpq/po/ja.po
A src/interfaces/libpq/po/ka.po
M src/pl/plperl/po/LINGUAS
M src/pl/plperl/po/el.po
M src/pl/plperl/po/es.po
M src/pl/plperl/po/it.po
M src/pl/plperl/po/ja.po
A src/pl/plperl/po/ka.po
M src/pl/plperl/po/pt_BR.po
M src/pl/plperl/po/ru.po
M src/pl/plperl/po/sv.po
M src/pl/plperl/po/uk.po
M src/pl/plpgsql/src/po/LINGUAS
M src/pl/plpgsql/src/po/el.po
M src/pl/plpgsql/src/po/es.po
M src/pl/plpgsql/src/po/it.po
M src/pl/plpgsql/src/po/ja.po
A src/pl/plpgsql/src/po/ka.po
M src/pl/plpgsql/src/po/pt_BR.po
M src/pl/plpgsql/src/po/ru.po
M src/pl/plpgsql/src/po/sv.po
M src/pl/plpgsql/src/po/uk.po
M src/pl/plpython/po/LINGUAS
M src/pl/plpython/po/de.po
M src/pl/plpython/po/es.po
M src/pl/plpython/po/it.po
A src/pl/plpython/po/ka.po
M src/pl/plpython/po/pt_BR.po
M src/pl/plpython/po/ru.po
M src/pl/plpython/po/sv.po
M src/pl/plpython/po/uk.po
M src/pl/tcl/po/LINGUAS
M src/pl/tcl/po/el.po
M src/pl/tcl/po/es.po
M src/pl/tcl/po/it.po
M src/pl/tcl/po/ja.po
A src/pl/tcl/po/ka.po
M src/pl/tcl/po/pt_BR.po
M src/pl/tcl/po/ru.po
M src/pl/tcl/po/sv.po
M src/pl/tcl/po/uk.po

pg_dump doc: mention 'long' is valid for --compress

commit   : 4042b2e18781532d5dd6ee3cef38c4fbb0249202    
  
author   : Alvaro Herrera <[email protected]>    
date     : Mon, 22 May 2023 12:26:40 +0200    
  
committer: Alvaro Herrera <[email protected]>    
date     : Mon, 22 May 2023 12:26:40 +0200    

Click here for diff

Apparently an oversight in 2820adf7755d.  

M doc/src/sgml/ref/pg_dump.sgml

doc: PG 16 relnotes, improve description of standby log. decode

commit   : ac298d3cb56b015acd40d2e015e07a87d8aff124    
  
author   : Bruce Momjian <[email protected]>    
date     : Sun, 21 May 2023 23:39:27 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sun, 21 May 2023 23:39:27 -0400    

Click here for diff

Improve description of "Allow logical decoding on standbys".  

M doc/src/sgml/release-16.sgml

Rename some createuser options.

commit   : 2dcd1578c40153250836df62f625863056c28a81    
  
author   : Nathan Bossart <[email protected]>    
date     : Sun, 21 May 2023 20:03:56 -0700    
  
committer: Nathan Bossart <[email protected]>    
date     : Sun, 21 May 2023 20:03:56 -0700    

Click here for diff

This change renames --admin to --with-admin, --role to --member-of,  
and --member to --with-member.  Many people found the previous  
names to be confusing.  The --admin and --member options are new in  
v16, but --role has been there for a while, so that one has been  
kept (but left undocumented) for backward compatibility.  
  
Suggested-by: Peter Eisentraut  
Reviewed-by: Tom Lane, Michael Paquier  
Discussion: https://postgr.es/m/ZFvVZvQDliIWmOwg%40momjian.us  

M doc/src/sgml/ref/createuser.sgml
M src/bin/scripts/createuser.c
M src/bin/scripts/t/040_createuser.pl

doc: PG 16 relnotes, misc merged items and bootstrap detail

commit   : de7c3fd34e0fc0a3f77537e1d12efcd01d255534    
  
author   : Bruce Momjian <[email protected]>    
date     : Sun, 21 May 2023 22:52:42 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sun, 21 May 2023 22:52:42 -0400    

Click here for diff

Reported-by: Andres Freund, jian he  
  
Discussion: https://postgr.es/m/[email protected], [email protected]  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, misc. updates

commit   : c822358a256ca1f3b8b08557b9c9f0efa8d41675    
  
author   : Bruce Momjian <[email protected]>    
date     : Sun, 21 May 2023 15:57:37 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sun, 21 May 2023 15:57:37 -0400    

Click here for diff

Reported-by: Tom Lane  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/release-16.sgml

In clause_is_computable_at(), test required_relids for clone clauses.

commit   : b9c755a2f625b7dca6323804b140b016d95a0b1d    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 21 May 2023 15:25:43 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 21 May 2023 15:25:43 -0400    

Click here for diff

Use the clause's required_relids not clause_relids for testing  
whether it is computable at the current join level, if it is a  
clone clause generated by deconstruct_distribute_oj_quals().  
  
Arguably, this is more correct and we should do it for all clauses;  
that would at least remove the handwavy claim that we are doing  
it to save cycles compared to inspecting Vars individually.  
However, attempting to do that exposes that we are not being careful  
to compute an accurate value for required_relids in all cases.  
I'm unsure whether it's a good idea to attempt to do that for v16,  
or leave it as future clean-up.  In the meantime, this quick hack  
demonstrably fixes some cases, so let's squeeze it in for beta1.  
  
Patch by me, but great thanks to Richard Guo for investigation  
and testing.  The new test cases are all modeled on his examples.  
  
Discussion: https://postgr.es/m/CAMbWs4-_vwkBij4XOQ5ukxUvLgwTm0kS5_DO9CicUeKbEfKjUw@mail.gmail.com  

M src/backend/optimizer/util/restrictinfo.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Remove over-eager assertion in ExtendBufferedRelTo()

commit   : eabb22525efc40ce0d83580584094a0248ac0682    
  
author   : Andres Freund <[email protected]>    
date     : Sun, 21 May 2023 09:48:37 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Sun, 21 May 2023 09:48:37 -0700    

Click here for diff

The assertion checked that the size of the relation is not "too large" - but  
the code is explicitly dealing with the possibility of another backend  
extending the relation concurrently. In that case the new relation size could  
be bigger than what the current backend needs, wrongly triggering an assertion  
failure.  
  
Unfortunately it is hard to write a reliable and affordable regression tests  
for this, as a lot of concurrency is needed to encounter the bug.  
  
Introduced in 31966b151e6a.  
  
Reported-by: Melanie Plageman <[email protected]>  

M src/backend/storage/buffer/bufmgr.c

Optimize walsender wake up logic using condition variables

commit   : bc971f4025c378ce500d86597c34b0ef996d4d8c    
  
author   : Andres Freund <[email protected]>    
date     : Sun, 21 May 2023 09:44:55 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Sun, 21 May 2023 09:44:55 -0700    

Click here for diff

WalSndWakeup() currently loops through all the walsenders slots, with a  
spinlock acquisition and release for every iteration, to wake up waiting  
walsenders.  
  
This commonly was not a problem before e101dfac3a53c. But, to allow logical  
decoding on standbys, we need to wake up logical walsenders after every WAL  
record is applied on the standby, rather just when flushing WAL or switching  
timelines.  This causes a performance regression for workloads replaying a lot  
of WAL records.  
  
To solve this, we use condition variable (CV) to efficiently wake up  
walsenders in WalSndWakeup().  
  
Every walsender prepares to sleep on a shared memory CV. Note that it just  
prepares to sleep on the CV (i.e., adds itself to the CV's waitlist), but does  
not actually wait on the CV (IOW, it never calls ConditionVariableSleep()). It  
still uses WaitEventSetWait() for waiting, because CV infrastructure doesn't  
handle FeBe socket events currently. The processes (startup process,  
walreceiver etc.)  wanting to wake up walsenders use  
ConditionVariableBroadcast(), which in turn calls SetLatch(), helping  
walsenders come out of WaitEventSetWait().  
  
We use separate shared memory CVs for physical and logical walsenders for  
selective wake ups, see WalSndWakeup() for more details.  
  
This approach is simple and reasonably efficient. But not very elegant. But  
for 16 it seems to be a better path than a larger redesign of the CV  
mechanism.  A desirable future improvement would be to add support for CVs  
into WaitEventSetWait().  
  
This still leaves us with a small regression in very extreme workloads (due to  
the spinlock acquisition in ConditionVariableBroadcast() when there are no  
waiters) - but that seems acceptable.  
  
Reported-by: Andres Freund <[email protected]>  
Suggested-by: Andres Freund <[email protected]>  
Author: Bharath Rupireddy <[email protected]>  
Reviewed-by: "Drouvot, Bertrand" <[email protected]>  
Reviewed-by: Zhijie Hou <[email protected]>  
Discussion: https://www.postgresql.org/message-id/20230509190247.3rrplhdgem6su6cg%40awork3.anarazel.de  

M src/backend/replication/walsender.c
M src/include/replication/walsender_private.h

doc: PG 16 relnotes, add commits

commit   : 30579d23b22655e340e9806fb3425e73eed60876    
  
author   : Bruce Momjian <[email protected]>    
date     : Sun, 21 May 2023 11:55:50 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sun, 21 May 2023 11:55:50 -0400    

Click here for diff

Reported-by: Ian Lawrence Barwick  
  
Discussion: https://postgr.es/m/CAB8KJ=hLvQDb53WdigV7OBEBh5tzQ7eA=pG0ZpccoRVBUNCXYA@mail.gmail.com  

M doc/src/sgml/release-16.sgml

Doc: fix some rendering problems in the PDF docs build.

commit   : b62381d9a23b4b96259cf560e411137656201704    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 21 May 2023 11:21:19 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 21 May 2023 11:21:19 -0400    

Click here for diff

Tweak column widths in a couple of tables to avoid "contents  
... exceed the available area" warnings.  Remove usage of  
some non-Latin-1 characters.  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/charset.sgml
M doc/src/sgml/release-16.sgml

Expand some more uses of "deleg" to "delegation" or "delegated".

commit   : a2eb99a01e015a76682911ae3980762f6ee6ac8c    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 21 May 2023 10:55:18 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 21 May 2023 10:55:18 -0400    

Click here for diff

Complete the task begun in 9c0a0e2ed: we don't want to use the  
abbreviation "deleg" for GSS delegation in any user-visible places.  
(For consistency, this also changes most internal uses too.)  
  
Abhijit Menon-Sen and Tom Lane  
  
Discussion: https://postgr.es/m/[email protected]  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/option.c
M contrib/postgres_fdw/sql/postgres_fdw.sql
M doc/src/sgml/libpq.sgml
M src/backend/catalog/system_views.sql
M src/backend/foreign/foreign.c
M src/backend/utils/init/postinit.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.dat
M src/interfaces/libpq/fe-auth.c
M src/interfaces/libpq/fe-connect.c
M src/interfaces/libpq/fe-secure-gssapi.c
M src/interfaces/libpq/libpq-int.h
M src/test/kerberos/README
M src/test/kerberos/t/001_auth.pl
M src/test/regress/expected/rules.out

Fix remaining references to gss_accept_deleg.

commit   : f4001a553770b3114dd11846c6789ad6c34ef111    
  
author   : Nathan Bossart <[email protected]>    
date     : Sat, 20 May 2023 20:18:51 -0700    
  
committer: Nathan Bossart <[email protected]>    
date     : Sat, 20 May 2023 20:18:51 -0700    

Click here for diff

These were missed in 9c0a0e2ed9.  
  
Discussion: https://postgr.es/m/20230521031757.GA3835667%40nathanxps13  

M doc/src/sgml/config.sgml
M src/backend/utils/misc/postgresql.conf.sample
M src/test/kerberos/t/001_auth.pl

rename "gss_accept_deleg" to "gss_accept_delegation".

commit   : 9c0a0e2ed92a1a94ec30d36f8ea1ab12c928292b    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 20 May 2023 21:32:54 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 20 May 2023 21:32:54 -0400    

Click here for diff

This is more consistent with existing GUC spelling.  
  
Discussion: https://postgr.es/m/[email protected]  

M contrib/dblink/dblink.c
M contrib/postgres_fdw/connection.c
M doc/src/sgml/config.sgml
M doc/src/sgml/release-16.sgml
M src/backend/libpq/auth.c
M src/backend/libpq/be-secure-gssapi.c
M src/backend/utils/activity/backend_status.c
M src/backend/utils/adt/pgstatfuncs.c
M src/backend/utils/init/postinit.c
M src/backend/utils/misc/guc_tables.c
M src/include/libpq/auth.h
M src/include/libpq/libpq-be.h
M src/include/utils/backend_status.h

doc: PG 16 relnotes, misc updates

commit   : cf109ffc205063f82258e0643588491a153c3a45    
  
author   : Bruce Momjian <[email protected]>    
date     : Sat, 20 May 2023 21:03:13 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Sat, 20 May 2023 21:03:13 -0400    

Click here for diff

*  document to_reg* accepting OIDs  
*  document pg_log_standby_snapshot()  
*  document pg_input_is_valid() and pg_input_error_info()  
*  handle rename of function to pg_split_walfile_name()  
*  fix character encoding problem for Przemyslaw Sztoch  
*  remove partition section  
  
Reported-by: jian he, Tom Lane, Bertrand Drouvot  

M doc/src/sgml/release-16.sgml

Add 0245f8db3 to .git-blame-ignore-revs.

commit   : 1c006c067124403d63b6ad3eac687b4217f05691    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 17:28:04 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 17:28:04 -0400    

Click here for diff

M .git-blame-ignore-revs

Pre-beta mechanical code beautification.

commit   : 0245f8db36f375326c2bae0c3420d3c77714e72d    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 17:24:48 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 17:24:48 -0400    

Click here for diff

Run pgindent, pgperltidy, and reformat-dat-files.  
  
This set of diffs is a bit larger than typical.  We've updated to  
pg_bsd_indent 2.1.2, which properly indents variable declarations that  
have multi-line initialization expressions (the continuation lines are  
now indented one tab stop).  We've also updated to perltidy version  
20230309 and changed some of its settings, which reduces its desire to  
add whitespace to lines to make assignments etc. line up.  Going  
forward, that should make for fewer random-seeming changes to existing  
code.  
  
Discussion: https://postgr.es/m/[email protected]  

M contrib/amcheck/t/001_verify_heapam.pl
M contrib/amcheck/t/003_cic_2pc.pl
M contrib/amcheck/verify_heapam.c
M contrib/auto_explain/t/001_auto_explain.pl
M contrib/basebackup_to_shell/t/001_basic.pl
M contrib/basic_archive/basic_archive.c
M contrib/dblink/dblink.c
M contrib/intarray/bench/bench.pl
M contrib/intarray/bench/create_test.pl
M contrib/ltree/ltree_gist.c
M contrib/ltree/ltree_io.c
M contrib/ltree/ltxtquery_io.c
M contrib/pg_prewarm/t/001_basic.pl
M contrib/pg_walinspect/pg_walinspect.c
M contrib/postgres_fdw/connection.c
M contrib/postgres_fdw/postgres_fdw.c
M contrib/postgres_fdw/shippable.c
M contrib/seg/seg-validate.pl
M contrib/test_decoding/t/001_repl_stats.pl
M contrib/test_decoding/test_decoding.c
M doc/src/sgml/mk_feature_tables.pl
M src/backend/access/brin/brin.c
M src/backend/access/common/reloptions.c
M src/backend/access/gist/gist.c
M src/backend/access/gist/gistbuildbuffers.c
M src/backend/access/gist/gistget.c
M src/backend/access/gist/gistxlog.c
M src/backend/access/hash/hashfunc.c
M src/backend/access/heap/heapam.c
M src/backend/access/heap/heapam_handler.c
M src/backend/access/heap/hio.c
M src/backend/access/heap/pruneheap.c
M src/backend/access/heap/vacuumlazy.c
M src/backend/access/heap/visibilitymap.c
M src/backend/access/nbtree/nbtpage.c
M src/backend/access/rmgrdesc/dbasedesc.c
M src/backend/access/rmgrdesc/gindesc.c
M src/backend/access/spgist/spgscan.c
M src/backend/access/table/tableam.c
M src/backend/access/transam/multixact.c
M src/backend/access/transam/parallel.c
M src/backend/access/transam/xact.c
M src/backend/access/transam/xlog.c
M src/backend/access/transam/xloginsert.c
M src/backend/access/transam/xlogprefetcher.c
M src/backend/access/transam/xlogreader.c
M src/backend/access/transam/xlogrecovery.c
M src/backend/backup/basebackup.c
M src/backend/backup/basebackup_copy.c
M src/backend/catalog/Catalog.pm
M src/backend/catalog/aclchk.c
M src/backend/catalog/genbki.pl
M src/backend/catalog/indexing.c
M src/backend/catalog/namespace.c
M src/backend/catalog/pg_operator.c
M src/backend/catalog/pg_shdepend.c
M src/backend/commands/alter.c
M src/backend/commands/collationcmds.c
M src/backend/commands/dbcommands.c
M src/backend/commands/dropcmds.c
M src/backend/commands/explain.c
M src/backend/commands/functioncmds.c
M src/backend/commands/indexcmds.c
M src/backend/commands/schemacmds.c
M src/backend/commands/subscriptioncmds.c
M src/backend/commands/tablecmds.c
M src/backend/commands/tablespace.c
M src/backend/commands/typecmds.c
M src/backend/commands/user.c
M src/backend/commands/view.c
M src/backend/executor/execExpr.c
M src/backend/executor/execExprInterp.c
M src/backend/executor/execIndexing.c
M src/backend/executor/execSRF.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeHash.c
M src/backend/executor/nodeHashjoin.c
M src/backend/executor/nodeIncrementalSort.c
M src/backend/executor/nodeModifyTable.c
M src/backend/executor/nodeTableFuncscan.c
M src/backend/executor/nodeWindowAgg.c
M src/backend/executor/spi.c
M src/backend/jit/llvm/llvmjit.c
M src/backend/jit/llvm/llvmjit_deform.c
M src/backend/jit/llvm/llvmjit_expr.c
M src/backend/libpq/be-secure-gssapi.c
M src/backend/libpq/be-secure-openssl.c
M src/backend/libpq/hba.c
M src/backend/nodes/gen_node_support.pl
M src/backend/optimizer/path/costsize.c
M src/backend/optimizer/util/appendinfo.c
M src/backend/optimizer/util/relnode.c
M src/backend/parser/check_keywords.pl
M src/backend/parser/parse_expr.c
M src/backend/parser/parse_merge.c
M src/backend/parser/parse_utilcmd.c
M src/backend/partitioning/partbounds.c
M src/backend/postmaster/fork_process.c
M src/backend/regex/regc_lex.c
M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/backend/replication/logical/decode.c
M src/backend/replication/logical/logical.c
M src/backend/replication/logical/origin.c
M src/backend/replication/logical/reorderbuffer.c
M src/backend/replication/logical/snapbuild.c
M src/backend/replication/logical/tablesync.c
M src/backend/replication/logical/worker.c
M src/backend/replication/pgoutput/pgoutput.c
M src/backend/replication/syncrep.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/rewrite/rowsecurity.c
M src/backend/snowball/snowball_create.pl
M src/backend/statistics/extended_stats.c
M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/file/buffile.c
M src/backend/storage/ipc/dsm_impl.c
M src/backend/storage/lmgr/generate-lwlocknames.pl
M src/backend/storage/lmgr/lock.c
M src/backend/storage/lmgr/lwlock.c
M src/backend/storage/lmgr/predicate.c
M src/backend/storage/lmgr/proc.c
M src/backend/storage/smgr/md.c
M src/backend/tsearch/spell.c
M src/backend/utils/Gen_dummy_probes.pl
M src/backend/utils/Gen_fmgrtab.pl
M src/backend/utils/activity/pgstat.c
M src/backend/utils/activity/pgstat_shmem.c
M src/backend/utils/activity/pgstat_xact.c
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/float.c
M src/backend/utils/adt/jsonfuncs.c
M src/backend/utils/adt/jsonpath.c
M src/backend/utils/adt/jsonpath_exec.c
M src/backend/utils/adt/jsonpath_internal.h
M src/backend/utils/adt/pg_locale.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/adt/tsquery_op.c
M src/backend/utils/adt/tsvector_op.c
M src/backend/utils/adt/varchar.c
M src/backend/utils/adt/varlena.c
M src/backend/utils/adt/xid8funcs.c
M src/backend/utils/adt/xml.c
M src/backend/utils/cache/lsyscache.c
M src/backend/utils/cache/relcache.c
M src/backend/utils/cache/relmapper.c
M src/backend/utils/fmgr/fmgr.c
M src/backend/utils/generate-errcodes.pl
M src/backend/utils/init/postinit.c
M src/backend/utils/init/usercontext.c
M src/backend/utils/mb/Unicode/UCS_to_BIG5.pl
M src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl
M src/backend/utils/mb/Unicode/UCS_to_EUC_JIS_2004.pl
M src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl
M src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl
M src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl
M src/backend/utils/mb/Unicode/UCS_to_GB18030.pl
M src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl
M src/backend/utils/mb/Unicode/UCS_to_SHIFT_JIS_2004.pl
M src/backend/utils/mb/Unicode/UCS_to_SJIS.pl
M src/backend/utils/mb/Unicode/UCS_to_UHC.pl
M src/backend/utils/mb/Unicode/UCS_to_most.pl
M src/backend/utils/mb/Unicode/convutils.pm
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/guc_tables.c
M src/backend/utils/mmgr/dsa.c
M src/backend/utils/mmgr/freepage.c
M src/backend/utils/mmgr/mcxt.c
M src/backend/utils/resowner/resowner.c
M src/backend/utils/sort/tuplesort.c
M src/backend/utils/time/snapmgr.c
M src/bin/initdb/initdb.c
M src/bin/initdb/t/001_initdb.pl
M src/bin/pg_amcheck/t/002_nonesuch.pl
M src/bin/pg_amcheck/t/003_check.pl
M src/bin/pg_amcheck/t/004_verify_heapam.pl
M src/bin/pg_archivecleanup/t/010_pg_archivecleanup.pl
M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_basebackup/pg_receivewal.c
M src/bin/pg_basebackup/t/010_pg_basebackup.pl
M src/bin/pg_basebackup/t/020_pg_receivewal.pl
M src/bin/pg_basebackup/t/030_pg_recvlogical.pl
M src/bin/pg_basebackup/walmethods.c
M src/bin/pg_basebackup/walmethods.h
M src/bin/pg_checksums/t/002_actions.pl
M src/bin/pg_controldata/t/001_pg_controldata.pl
M src/bin/pg_ctl/t/001_start_stop.pl
M src/bin/pg_ctl/t/004_logrotate.pl
M src/bin/pg_dump/compress_io.c
M src/bin/pg_dump/compress_lz4.c
M src/bin/pg_dump/compress_zstd.c
M src/bin/pg_dump/compress_zstd.h
M src/bin/pg_dump/pg_backup_archiver.c
M src/bin/pg_dump/pg_backup_tar.c
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dumpall.c
M src/bin/pg_dump/t/002_pg_dump.pl
M src/bin/pg_dump/t/004_pg_dump_parallel.pl
M src/bin/pg_dump/t/010_dump_connstr.pl
M src/bin/pg_resetwal/t/002_corrupted.pl
M src/bin/pg_rewind/t/001_basic.pl
M src/bin/pg_rewind/t/006_options.pl
M src/bin/pg_rewind/t/007_standby_source.pl
M src/bin/pg_rewind/t/008_min_recovery_point.pl
M src/bin/pg_rewind/t/009_growing_files.pl
M src/bin/pg_rewind/t/RewindTest.pm
M src/bin/pg_test_fsync/pg_test_fsync.c
M src/bin/pg_upgrade/check.c
M src/bin/pg_upgrade/info.c
M src/bin/pg_upgrade/pg_upgrade.c
M src/bin/pg_upgrade/t/002_pg_upgrade.pl
M src/bin/pg_verifybackup/t/002_algorithm.pl
M src/bin/pg_verifybackup/t/003_corruption.pl
M src/bin/pg_verifybackup/t/004_options.pl
M src/bin/pg_verifybackup/t/006_encoding.pl
M src/bin/pg_verifybackup/t/007_wal.pl
M src/bin/pg_verifybackup/t/008_untar.pl
M src/bin/pg_verifybackup/t/009_extract.pl
M src/bin/pg_verifybackup/t/010_client_untar.pl
M src/bin/pg_waldump/t/002_save_fullpage.pl
M src/bin/pgbench/pgbench.c
M src/bin/pgbench/t/001_pgbench_with_server.pl
M src/bin/pgbench/t/002_pgbench_no_server.pl
M src/bin/psql/command.c
M src/bin/psql/common.c
M src/bin/psql/create_help.pl
M src/bin/psql/crosstabview.c
M src/bin/psql/describe.c
M src/bin/psql/settings.h
M src/bin/psql/t/001_basic.pl
M src/bin/psql/t/010_tab_completion.pl
M src/bin/psql/t/020_cancel.pl
M src/bin/scripts/t/020_createdb.pl
M src/bin/scripts/t/040_createuser.pl
M src/bin/scripts/t/090_reindexdb.pl
M src/bin/scripts/t/100_vacuumdb.pl
M src/bin/scripts/t/200_connstr.pl
M src/bin/scripts/vacuumdb.c
M src/common/unicode/generate-norm_test_table.pl
M src/common/unicode/generate-unicode_norm_table.pl
M src/common/unicode/generate-unicode_normprops_table.pl
M src/fe_utils/print.c
M src/include/access/amapi.h
M src/include/access/brin_tuple.h
M src/include/access/gist_private.h
M src/include/access/tableam.h
M src/include/access/xlogreader.h
M src/include/catalog/pg_aggregate.dat
M src/include/catalog/pg_auth_members.h
M src/include/catalog/pg_database.dat
M src/include/catalog/pg_proc.dat
M src/include/catalog/pg_subscription.h
M src/include/catalog/reformat_dat_file.pl
M src/include/catalog/renumber_oids.pl
M src/include/executor/hashjoin.h
M src/include/executor/tuptable.h
M src/include/fe_utils/print.h
M src/include/funcapi.h
M src/include/nodes/primnodes.h
M src/include/port/win32ntdll.h
M src/include/replication/reorderbuffer.h
M src/include/storage/bufmgr.h
M src/include/storage/lock.h
M src/include/storage/lwlock.h
M src/include/storage/predicate_internals.h
M src/include/storage/proc.h
M src/include/utils/backend_status.h
M src/include/utils/pg_locale.h
M src/include/utils/rel.h
M src/include/utils/varlena.h
M src/interfaces/ecpg/ecpglib/data.c
M src/interfaces/ecpg/ecpglib/descriptor.c
M src/interfaces/ecpg/ecpglib/execute.c
M src/interfaces/ecpg/include/pgtypes_interval.h
M src/interfaces/ecpg/pgtypeslib/dt.h
M src/interfaces/ecpg/pgtypeslib/interval.c
M src/interfaces/ecpg/pgtypeslib/timestamp.c
M src/interfaces/ecpg/preproc/check_rules.pl
M src/interfaces/ecpg/preproc/parse.pl
M src/interfaces/ecpg/preproc/type.c
M src/interfaces/libpq/fe-connect.c
M src/interfaces/libpq/fe-exec.c
M src/interfaces/libpq/fe-lobj.c
M src/interfaces/libpq/fe-misc.c
M src/interfaces/libpq/fe-print.c
M src/interfaces/libpq/fe-protocol3.c
M src/interfaces/libpq/fe-secure-common.c
M src/interfaces/libpq/fe-secure-gssapi.c
M src/interfaces/libpq/fe-secure-openssl.c
M src/interfaces/libpq/fe-secure.c
M src/interfaces/libpq/libpq-int.h
M src/interfaces/libpq/t/001_uri.pl
M src/interfaces/libpq/t/003_load_balance_host_list.pl
M src/interfaces/libpq/t/004_load_balance_dns.pl
M src/pl/plperl/plc_perlboot.pl
M src/pl/plperl/text2macro.pl
M src/port/dirmod.c
M src/test/authentication/t/001_password.pl
M src/test/authentication/t/002_saslprep.pl
M src/test/authentication/t/003_peer.pl
M src/test/authentication/t/004_file_inclusion.pl
M src/test/icu/t/010_database.pl
M src/test/kerberos/t/001_auth.pl
M src/test/ldap/LdapServer.pm
M src/test/ldap/t/001_auth.pl
M src/test/modules/commit_ts/t/002_standby.pl
M src/test/modules/commit_ts/t/003_standby_2.pl
M src/test/modules/commit_ts/t/004_restart.pl
M src/test/modules/ldap_password_func/t/001_mutated_bindpasswd.pl
M src/test/modules/libpq_pipeline/libpq_pipeline.c
M src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
M src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl
M src/test/modules/test_custom_rmgrs/t/001_basic.pl
M src/test/modules/test_custom_rmgrs/test_custom_rmgrs.c
M src/test/modules/test_ddl_deparse/test_ddl_deparse.c
M src/test/modules/test_misc/t/001_constraint_validation.pl
M src/test/modules/test_misc/t/002_tablespace.pl
M src/test/modules/test_misc/t/003_check_guc.pl
M src/test/modules/test_pg_dump/t/001_base.pl
M src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
M src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
M src/test/perl/PostgreSQL/Test/Cluster.pm
M src/test/perl/PostgreSQL/Test/RecursiveCopy.pm
M src/test/perl/PostgreSQL/Test/SimpleTee.pm
M src/test/perl/PostgreSQL/Test/Utils.pm
M src/test/perl/PostgreSQL/Version.pm
M src/test/recovery/t/001_stream_rep.pl
M src/test/recovery/t/002_archiving.pl
M src/test/recovery/t/003_recovery_targets.pl
M src/test/recovery/t/005_replay_delay.pl
M src/test/recovery/t/006_logical_decoding.pl
M src/test/recovery/t/009_twophase.pl
M src/test/recovery/t/010_logical_decoding_timelines.pl
M src/test/recovery/t/012_subtransactions.pl
M src/test/recovery/t/013_crash_restart.pl
M src/test/recovery/t/014_unlogged_reinit.pl
M src/test/recovery/t/016_min_consistency.pl
M src/test/recovery/t/017_shm.pl
M src/test/recovery/t/018_wal_optimize.pl
M src/test/recovery/t/019_replslot_limit.pl
M src/test/recovery/t/020_archive_status.pl
M src/test/recovery/t/022_crash_temp_files.pl
M src/test/recovery/t/023_pitr_prepared_xact.pl
M src/test/recovery/t/024_archive_recovery.pl
M src/test/recovery/t/025_stuck_on_old_timeline.pl
M src/test/recovery/t/027_stream_regress.pl
M src/test/recovery/t/028_pitr_timelines.pl
M src/test/recovery/t/029_stats_restart.pl
M src/test/recovery/t/031_recovery_conflict.pl
M src/test/recovery/t/032_relfilenode_reuse.pl
M src/test/recovery/t/033_replay_tsp_drops.pl
M src/test/recovery/t/034_create_database.pl
M src/test/recovery/t/035_standby_logical_decoding.pl
M src/test/regress/pg_regress.c
M src/test/ssl/t/001_ssltests.pl
M src/test/ssl/t/002_scram.pl
M src/test/ssl/t/003_sslinfo.pl
M src/test/ssl/t/SSL/Backend/OpenSSL.pm
M src/test/ssl/t/SSL/Server.pm
M src/test/subscription/t/001_rep_changes.pl
M src/test/subscription/t/005_encoding.pl
M src/test/subscription/t/012_collation.pl
M src/test/subscription/t/014_binary.pl
M src/test/subscription/t/015_stream.pl
M src/test/subscription/t/018_stream_subxact_abort.pl
M src/test/subscription/t/023_twophase_stream.pl
M src/test/subscription/t/025_rep_changes_for_schema.pl
M src/test/subscription/t/026_stats.pl
M src/test/subscription/t/027_nosuperuser.pl
M src/test/subscription/t/028_row_filter.pl
M src/test/subscription/t/030_origin.pl
M src/test/subscription/t/031_column_list.pl
M src/test/subscription/t/032_subscribe_use_index.pl
M src/test/subscription/t/033_run_as_table_owner.pl
M src/test/subscription/t/100_bugs.pl
M src/timezone/zic.c
M src/tools/PerfectHash.pm
M src/tools/check_bison_recursion.pl
M src/tools/ci/windows_build_config.pl
M src/tools/copyright.pl
M src/tools/gen_export.pl
M src/tools/gen_keywordlist.pl
M src/tools/git_changelog
M src/tools/mark_pgdllimport.pl
M src/tools/msvc/Install.pm
M src/tools/msvc/MSBuildProject.pm
M src/tools/msvc/Mkvcbuild.pm
M src/tools/msvc/Project.pm
M src/tools/msvc/Solution.pm
M src/tools/msvc/VSObjectFactory.pm
M src/tools/msvc/build.pl
M src/tools/msvc/config_default.pl
M src/tools/msvc/dummylib/Win32/Registry.pm
M src/tools/msvc/dummylib/Win32API/File.pm
M src/tools/msvc/gendef.pl
M src/tools/msvc/pgbison.pl
M src/tools/msvc/vcregress.pl
M src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl
M src/tools/pginclude/pgcheckdefines
M src/tools/pgindent/pgindent
M src/tools/pgindent/typedefs.list
M src/tools/win32tzlist.pl
M src/tutorial/funcs.c

Make agreed-on updates in perltidy options.

commit   : df6b19fbbc20d830de91d9bea68715a39635b568    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 16:43:57 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 16:43:57 -0400    

Click here for diff

Our standard version of perltidy is now 20230309.  
Add a --valign-exclusion-list setting to reduce crosstalk  
between nearby lines of Perl code.  
  
Also, update instructions for running pgindent  
(missed in b16259b3c).  
  
Discussion: https://postgr.es/m/[email protected]  

M src/tools/pgindent/README
M src/tools/pgindent/perltidyrc

Do pre-release housekeeping on catalog data.

commit   : 722541ead194635d77163bda057cc0064ff81149    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 16:36:38 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 16:36:38 -0400    

Click here for diff

Run renumber_oids.pl to move high-numbered OIDs down, as per pre-beta  
tasks specified by RELEASE_CHANGES.  For reference, the command was  
  
./renumber_oids.pl --first-mapped-oid 8000 --target-oid 6200  

M src/include/catalog/catversion.h
M src/include/catalog/pg_auth_members.h
M src/include/catalog/pg_authid.dat
M src/include/catalog/pg_proc.dat

Fix thinko in join removal.

commit   : d0f952691ff532aa0c54e9d146fac8d590596646    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 15:24:07 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 15:24:07 -0400    

Click here for diff

In commit 9df8f903e I (tgl) switched join_is_removable() from  
using the min relid sets of the join under consideration to  
using its full syntactic relid sets.  This was a mistake,  
as it allowed join removal in cases where a reference to the  
join output would survive in some syntactically-lower join  
condition.  Revert to the former coding.  
  
Richard Guo  
  
Discussion: https://postgr.es/m/CAMbWs4-EU9uBGSP7G-iTwLBhRQ=rnZKvFDhD+n+xhajokyPCKg@mail.gmail.com  

M src/backend/optimizer/plan/analyzejoins.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Fix misbehavior of EvalPlanQual checks with multiple result relations.

commit   : 70b42f2790292cc30aa07563f343f7ba6749af01    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 14:26:34 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 14:26:34 -0400    

Click here for diff

The idea of EvalPlanQual is that we replace the query's scan of the  
result relation with a single injected tuple, and see if we get a  
tuple out, thereby implying that the injected tuple still passes the  
query quals.  (In join cases, other relations in the query are still  
scanned normally.)  This logic was not updated when commit 86dc90056  
made it possible for a single DML query plan to have multiple result  
relations, when the query target relation has inheritance or partition  
children.  We replaced the output for the current result relation  
successfully, but other result relations were still scanned normally;  
thus, if any other result relation contained a tuple satisfying the  
quals, we'd think the EPQ check passed, even if it did not pass for  
the injected tuple itself.  This would lead to update or delete  
actions getting performed when they should have been skipped due to  
a conflicting concurrent update in READ COMMITTED isolation mode.  
  
Fix by blocking all sibling result relations from emitting tuples  
during an EvalPlanQual recheck.  In the back branches, the fix is  
complicated a bit by the need to not change the size of struct  
EPQState (else we'd have ABI-breaking changes in offsets in  
struct ModifyTableState).  Like the back-patches of 3f7836ff6  
and 4b3e37993, add a separately palloc'd struct to avoid that.  
The logic is the same as in HEAD otherwise.  
  
This is only a live bug back to v14 where 86dc90056 came in.  
However, I chose to back-patch the test cases further, on the  
grounds that this whole area is none too well tested.  I skipped  
doing so in v11 though because none of the test applied cleanly,  
and it didn't quite seem worth extra work for a branch with only  
six months to live.  
  
Per report from Ante Krešić (via Aleksander Alekseev)  
  
Discussion: https://postgr.es/m/CAJ7c6TMBTN3rcz4=AjYhLPD_w3FFT0Wq_C15jxCDn8U4tZnH1g@mail.gmail.com  

M src/backend/executor/execMain.c
M src/backend/executor/execScan.c
M src/backend/executor/nodeLockRows.c
M src/backend/executor/nodeModifyTable.c
M src/backend/replication/logical/worker.c
M src/include/executor/executor.h
M src/include/nodes/execnodes.h
M src/test/isolation/expected/eval-plan-qual.out
M src/test/isolation/specs/eval-plan-qual.spec

psql: Tweak xheader_width and pager_min_lines input parsing

commit   : ed7e686a031e5b9469e0813af2f513dfdd77560b    
  
author   : Alvaro Herrera <[email protected]>    
date     : Fri, 19 May 2023 20:19:28 +0200    
  
committer: Alvaro Herrera <[email protected]>    
date     : Fri, 19 May 2023 20:19:28 +0200    

Click here for diff

Don't throw away the previous value when an invalid value is proposed.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/bin/psql/command.c

Message style improvements

commit   : 8e7912e73da008862180112cc6ba4d0aa5fa955d    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 19 May 2023 18:45:29 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 19 May 2023 18:45:29 +0200    

Click here for diff

M src/backend/access/transam/xlogfuncs.c
M src/bin/pg_basebackup/bbstreamer_zstd.c
M src/bin/pg_dump/compress_lz4.c
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_upgrade/check.c
M src/bin/psql/command.c
M src/bin/psql/help.c
M src/bin/scripts/createuser.c
M src/common/compression.c
M src/common/rmtree.c
M src/interfaces/libpq/fe-connect.c

doc: PG 16 relnotes, delete reverted grant, adjust version num

commit   : e5f85744eaa5ca83ff4d27509ed094ca33ed485e    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 19 May 2023 12:29:50 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 19 May 2023 12:29:50 -0400    

Click here for diff

Reported-by: Nathan Bossart, Sehrope Sarkuni  

M doc/src/sgml/release-16.sgml

Allocate hash join files in a separate memory context

commit   : 8c4040edf456d9241816176eacb79e4d9a0034fc    
  
author   : Tomas Vondra <[email protected]>    
date     : Fri, 19 May 2023 16:31:11 +0200    
  
committer: Tomas Vondra <[email protected]>    
date     : Fri, 19 May 2023 16:31:11 +0200    

Click here for diff

Should a hash join exceed memory limit, the hashtable is split up into  
multiple batches. The number of batches is doubled each time a given  
batch is determined not to fit in memory. Each batch file is allocated  
with a block-sized buffer for buffering tuples and parallel hash join  
has additional sharedtuplestore accessor buffers.  
  
In some pathological cases requiring a lot of batches, often with skewed  
data, bad stats, or very large datasets, users can run out-of-memory  
solely from the memory overhead of all the batch files' buffers.  
  
Batch files were allocated in the ExecutorState memory context, making  
it very hard to identify when this batch explosion was the source of an  
OOM. This commit allocates the batch files in a dedicated memory  
context, making it easier to identify the cause of an OOM and work to  
avoid it.  
  
Based on initial draft by Tomas Vondra, with significant reworks and  
improvements by Jehan-Guillaume de Rorthais.  
  
Author: Jehan-Guillaume de Rorthais <[email protected]>  
Author: Tomas Vondra <[email protected]>  
Reviewed-by:  Melanie Plageman <[email protected]>  
Discussion: https://postgr.es/m/20190421114618.z3mpgmimc3rmubi4@development  
Discussion: https://postgr.es/m/20230504193006.1b5b9622%40karst#273020ff4061fc7a2fbb1ba96b281f17  

M src/backend/executor/nodeHash.c
M src/backend/executor/nodeHashjoin.c
M src/backend/utils/sort/sharedtuplestore.c
M src/include/executor/hashjoin.h
M src/include/executor/nodeHashjoin.h

Describe hash join implementation

commit   : 507615fc533b1b65bcecc6218e36436687fe8420    
  
author   : Tomas Vondra <[email protected]>    
date     : Fri, 19 May 2023 16:19:54 +0200    
  
committer: Tomas Vondra <[email protected]>    
date     : Fri, 19 May 2023 16:19:54 +0200    

Click here for diff

Add a high level description of our implementation of the hybrid hash  
join algorithm to the block comment in nodeHashjoin.c.  
  
Author: Melanie Plageman <[email protected]>  
Reviewed-by: Tomas Vondra <[email protected]>  
Reviewed-by: Jehan-Guillaume de Rorthais <[email protected]>  
Discussion: https://postgr.es/m/20230516160051.4267a800%40karst  

M src/backend/executor/nodeHashjoin.c

Avoid naming conflict between transactions.sql and namespace.sql.

commit   : b973f93b6c540f65c960bfb19af55f3d4afe4b72    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 10:57:46 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 19 May 2023 10:57:46 -0400    

Click here for diff

Commits 681d9e462 et al added a test case in namespace.sql that  
implicitly relied on there not being a table "public.abc".  
However, the concurrently-run transactions.sql test creates precisely  
such a table, so with the right timing you'd get a failure.  
Creating a table named as generically as "abc" in a common schema  
seems like bad practice, so fix this by changing the name of  
transactions.sql's table.  (Compare 2cf8c7aa4.)  
  
Marina Polyakova  
  
Discussion: https://postgr.es/m/[email protected]  

M src/test/regress/expected/transactions.out
M src/test/regress/sql/transactions.sql

Remove stray mid-sentence tabs in comments

commit   : 803b4a26ca3fdddbb6e3ce87a23bfbcc8a8669f3    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 19 May 2023 15:57:38 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 19 May 2023 15:57:38 +0200    

Click here for diff

M src/backend/executor/nodeIncrementalSort.c
M src/backend/libpq/be-secure-openssl.c
M src/backend/storage/smgr/smgr.c
M src/backend/tsearch/ts_parse.c
M src/include/common/jsonapi.h
M src/include/port/win32_port.h
M src/interfaces/ecpg/pgtypeslib/timestamp.c

doc: PG 16 relnotes, merge REINDEX and reindexdb items

commit   : 6ff33cdbabdf770ca9d6b417c0687c04b2cd4d36    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 19 May 2023 09:30:00 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 19 May 2023 09:30:00 -0400    

Click here for diff

Reported-by: Vibhor Kumar  

M doc/src/sgml/release-16.sgml

doc: PG 16 relnotes, add missing parentheses

commit   : 1a620cbae5c48dc89f7cb08602c331f5751df71a    
  
author   : Bruce Momjian <[email protected]>    
date     : Fri, 19 May 2023 08:31:11 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Fri, 19 May 2023 08:31:11 -0400    

Click here for diff

Reported-by: Hans Buschmann  

M doc/src/sgml/release-16.sgml

Move mdwriteback() to better place

commit   : 4c9deebd37ecbeb1bbf6baaf43bafc2f84b9011b    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 19 May 2023 13:42:06 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 19 May 2023 13:42:06 +0200    

Click here for diff

The previous order in the file didn't make sense and matched neither  
the header file nor the smgr API.  
  
Discussion: https://www.postgresql.org/message-id/flat/22fed8ba-01c3-2008-a256-4ea912d68fab%40enterprisedb.com  

M src/backend/storage/smgr/md.c

Reindent some comments

commit   : 0b8ace8d773257fffeaceda196ed94877c2b74df    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 19 May 2023 10:52:04 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 19 May 2023 10:52:04 +0200    

Click here for diff

Most (older) comments in md.c and smgr.c are indented with a leading  
tab on all lines, which isn't the current style and makes updating the  
comments a bit annoying.  This reindents all these lines with a single  
space, as is the normal style.  This issue exists in various shapes  
throughout the code but it's pretty consistent here, and since there  
is a patch pending to refresh some of the comments in these files, it  
seems sensible to clean this up here separately.  
  
Discussion: https://www.postgresql.org/message-id/flat/22fed8ba-01c3-2008-a256-4ea912d68fab%40enterprisedb.com  

M src/backend/storage/smgr/md.c
M src/backend/storage/smgr/smgr.c

pageinspect: Fix gist_page_items() with included columns

commit   : e7bff46e50b85c6b37723426188498dab973806c    
  
author   : Michael Paquier <[email protected]>    
date     : Fri, 19 May 2023 12:37:58 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Fri, 19 May 2023 12:37:58 +0900    

Click here for diff

Non-leaf pages of GiST indexes contain key attributes, leaf pages  
contain both key and non-key attributes, and gist_page_items() ignored  
the handling of non-key attributes.  This caused a few problems when  
using gist_page_items() on a GiST index with INCLUDE:  
- On a non-leaf page, the function would crash.  
- On a leaf page, the function would work, but miss to display all the  
values for included attributes.  
  
This commit fixes gist_page_items() to handle such cases in a more  
appropriate way, and now displays the values of key and non-key  
attributes for each item separately in a style consistent with what  
ruleutils.c would generate for the attribute list, depending on the page  
type dealt with.  In a way similar to how a record is displayed, values  
would be double-quoted for key or non-key attributes if required.  
  
ruleutils.c did not provide a routine able to control if non-key  
attributes should be displayed, so an extended() routine for index  
definitions is added to work around the leaf and non-leaf page  
differences.  
  
While on it, this commit fixes a third problem related to the amount of  
data reported for key attributes.  The code originally relied on  
BuildIndexValueDescription() (used for error reports on constraints)  
that would not print all the data stored in the index but the index  
opclass's input type, so this limited the amount of information  
available.  This switch makes gist_page_items() much cheaper as there is  
no need to run ACL checks for each item printed, which is not an issue  
anyway as superuser rights are required to execute the functions of  
pageinspect.  Opclasses whose data cannot be displayed can rely on  
gist_page_items_bytea().  
  
The documentation of this function was slightly incorrect for the  
output results generated on HEAD and v15, so adjust it on these  
branches.  
  
Author: Alexander Lakhin, Michael Paquier  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 14  

M contrib/pageinspect/expected/gist.out
M contrib/pageinspect/gistfuncs.c
M contrib/pageinspect/sql/gist.sql
M doc/src/sgml/pageinspect.sgml
M src/backend/utils/adt/ruleutils.c
M src/include/utils/ruleutils.h

doc: improve pg_walinspect and role membership items

commit   : 613a7eca9ca9f13d1f9fd8a7806bbded1836e58f    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 23:17:03 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 23:17:03 -0400    

Click here for diff

Reported-by: Peter Geoghegan  

M doc/src/sgml/release-16.sgml

doc: improve description of adding roles as members

commit   : ce3673daded3fe3a101b0c008235dcf8bfe9ffec    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 22:22:17 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 22:22:17 -0400    

Click here for diff

Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/ref/create_role.sgml
M doc/src/sgml/ref/createuser.sgml

doc: update PG 16 relnotes for pg_walinspect changes

commit   : f79ee34702d485fb30427816b95e6c944660fc23    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 21:44:22 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 21:44:22 -0400    

Click here for diff

Reported-by: Peter Geoghegan  

M doc/src/sgml/release-16.sgml

Show empty BRIN ranges in brin_page_items

commit   : 428c0cae929b7d2b26a830fbba55619c57ceba55    
  
author   : Tomas Vondra <[email protected]>    
date     : Fri, 19 May 2023 01:53:30 +0200    
  
committer: Tomas Vondra <[email protected]>    
date     : Fri, 19 May 2023 01:53:30 +0200    

Click here for diff

Commit 3581cbdcd6 added a flag to identify empty BRIN ranges. This adds  
the new flag to brin_page_items() output.  
  
This is kept as a separate commit as it should not be backpatched.  
  
Reviewed-by: Justin Pryzby, Matthias van de Meent, Alvaro Herrera  
Discussion: https://postgr.es/m/[email protected]  

M contrib/pageinspect/brinfuncs.c
M contrib/pageinspect/expected/brin.out
M contrib/pageinspect/pageinspect–1.11–1.12.sql
M doc/src/sgml/pageinspect.sgml
M src/test/modules/brin/expected/summarization-and-inprogress-insertion.out

Fix handling of empty ranges and NULLs in BRIN

commit   : 3581cbdcd64f5aceb445f60df23141d08ed50617    
  
author   : Tomas Vondra <[email protected]>    
date     : Fri, 19 May 2023 00:00:22 +0200    
  
committer: Tomas Vondra <[email protected]>    
date     : Fri, 19 May 2023 00:00:22 +0200    

Click here for diff

BRIN indexes did not properly distinguish between summaries for empty  
(no rows) and all-NULL ranges, treating them as essentially the same  
thing. Summaries were initialized with allnulls=true, and opclasses  
simply reset allnulls to false when processing the first non-NULL value.  
This however produces incorrect results if the range starts with a NULL  
value (or a sequence of NULL values), in which case we forget the range  
contains NULL values when adding the first non-NULL value.  
  
This happens because the allnulls flag is used for two separate  
purposes - to mark empty ranges (not representing any rows yet) and  
ranges containing only NULL values.  
  
Opclasses don't know which of these cases it is, and so don't know  
whether to set hasnulls=true. Setting the flag in both cases would make  
it correct, but it would also make BRIN indexes useless for queries with  
IS NULL clauses. All ranges start empty (and thus allnulls=true), so all  
ranges would end up with either allnulls=true or hasnulls=true.  
  
The severity of the issue is somewhat reduced by the fact that it only  
happens when adding values to an existing summary with allnulls=true.  
This can happen e.g. for small tables (because a summary for the first  
range exists for all BRIN indexes), or for tables with large fraction of  
NULL values in the indexed columns.  
  
Bulk summarization (e.g. during CREATE INDEX or automatic summarization)  
that processes all values at once is not affected by this issue. In this  
case the flags were updated in a slightly different way, not forgetting  
the NULL values.  
  
To identify empty ranges we use a new flag, stored in an unused bit in  
the BRIN tuple header so the on-disk format remains the same. A matching  
flag is added to BrinMemTuple, into a 3B gap after bt_placeholder.  
That means there's no risk of ABI breakage, although we don't actually  
pass the BrinMemTuple to any public API.  
  
We could also skip storing index tuples for empty summaries, but then  
we'd have to always process such ranges - even if there are no rows in  
large parts of the table (e.g. after a bulk DELETE), it would still  
require reading the pages etc. So we store them, but ignore them when  
building the bitmap.  
  
Backpatch to 11. The issue exists since BRIN indexes were introduced in  
9.5, but older releases are already EOL.  
  
Backpatch-through: 11  
Reviewed-by: Justin Pryzby, Matthias van de Meent, Alvaro Herrera  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/access/brin/brin.c
M src/backend/access/brin/brin_tuple.c
M src/include/access/brin_tuple.h
M src/test/modules/brin/expected/summarization-and-inprogress-insertion.out
M src/test/modules/brin/specs/summarization-and-inprogress-insertion.spec

doc: PG 16 relnotes, add freeze and update walinspect items

commit   : 1158c8c4e350b92ad6fecae894c8c1c777495954    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 18:53:28 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 18:53:28 -0400    

Click here for diff

Reported-by: Peter Geoghegan  

M doc/src/sgml/release-16.sgml

docs: re-order some PG 16 relnotes items

commit   : 07ef30a0282064f688a1923ba5e7c850f2ff5776    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 18:25:21 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 18:25:21 -0400    

Click here for diff

Reported-by: Jonathan Katz  

M doc/src/sgml/release-16.sgml

doc: more PG 16 relnote wording improvements

commit   : d8a81108a87bd5e8e9ca136d3195e146a58b9e4d    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 17:42:47 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 17:42:47 -0400    

Click here for diff

M doc/src/sgml/release-16.sgml

Fix handling of NULLs when merging BRIN summaries

commit   : 3ec8a3bfb5472ecf93aba416e9f384ea16d340d1    
  
author   : Tomas Vondra <[email protected]>    
date     : Thu, 18 May 2023 13:00:31 +0200    
  
committer: Tomas Vondra <[email protected]>    
date     : Thu, 18 May 2023 13:00:31 +0200    

Click here for diff

When merging BRIN summaries, union_tuples() did not correctly update the  
target hasnulls/allnulls flags. When merging all-NULL summary into a  
summary without any NULL values, the result had both flags set to false  
(instead of having hasnulls=true).  
  
This happened because the code only considered the hasnulls flags,  
ignoring the possibility the source summary has allnulls=true.  
  
Discovered while investigating issues with handling empty BRIN ranges  
and handling of NULL values, but it's a separate problem (has nothing to  
do with empty ranges).  
  
Fixed by considering both flags on the source summary, and updating the  
hasnulls flag on the target summary.  
  
Backpatch to 11. The bug exists since 9.5 (where BRIN indexes were  
introduced), but those releases are EOL already.  
  
Discussion: https://postgr.es/m/9d993d0d-e431-2196-9ccc-0554d0e60154%40enterprisedb.com  

M src/backend/access/brin/brin.c

doc: add more sections to PG 16 release notes

commit   : 0791930aaaed2678daf694fa8b06cf81cd72cd69    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 16:33:05 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 16:33:05 -0400    

Click here for diff

M doc/src/sgml/release-16.sgml

doc: first draft of the PG 16 release notes

commit   : 206a67e27fa15d75bd7b9ddf41d7e18d19bbb9db    
  
author   : Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 16:00:04 -0400    
  
committer: Bruce Momjian <[email protected]>    
date     : Thu, 18 May 2023 16:00:04 -0400    

Click here for diff

M doc/src/sgml/release-16.sgml

Fix documentation build broken by 1e16af8ab5.

commit   : c9dc480a21f2746f5a96a8f68a22e633ba69c405    
  
author   : Jeff Davis <[email protected]>    
date     : Thu, 18 May 2023 11:04:30 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Thu, 18 May 2023 11:04:30 -0700    

Click here for diff

M doc/src/sgml/charset.sgml

Doc improvements for language tags and custom ICU collations.

commit   : 1e16af8ab5d7f307b66e496eff6ec573d9fd8eb0    
  
author   : Jeff Davis <[email protected]>    
date     : Thu, 18 May 2023 10:37:55 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Thu, 18 May 2023 10:37:55 -0700    

Click here for diff

Separate the documentation for language tags themselves from the  
available collation settings which can be included in a language tag.  
  
Include tables of the available options, more details about the  
effects of each option, and additional examples.  
  
Also include an explanation of the "levels" of textual features and  
how they relate to collation.  
  
Discussion: https://postgr.es/m/[email protected]  
Reviewed-by: Jonathan S. Katz  

M doc/src/sgml/charset.sgml

Tweak API of new function clause_is_computable_at().

commit   : 8a2523ff354077180084b43a04be01f10aafdb8c    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 18 May 2023 10:39:16 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 18 May 2023 10:39:16 -0400    

Click here for diff

Pass it the RestrictInfo under consideration, not just the  
clause_relids.  This should save some trivial amount of  
code at the call sites, and it gives us more flexibility  
about what clause_is_computable_at() does.  There's no  
actual functional change here, though.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/optimizer/util/relnode.c
M src/backend/optimizer/util/restrictinfo.c
M src/include/optimizer/restrictinfo.h

ICU: check for U_STRING_NOT_TERMINATED_WARNING.

commit   : 1c634f6647c28354258d114041252475325aea32    
  
author   : Jeff Davis <[email protected]>    
date     : Wed, 17 May 2023 13:43:41 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Wed, 17 May 2023 13:43:41 -0700    

Click here for diff

Fixes memory error in cases where the length of the language name  
returned by uloc_getLanguage() is exactly ULOC_LANG_CAPACITY, in which  
case the status is set to U_STRING_NOT_TERMINATED_WARNING.  
  
Also check in call sites for other ICU functions that are expected to  
return a C string to be safe (no bug is known at these other call  
sites).  
  
Reported-by: Alexander Lakhin  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/utils/adt/pg_locale.c
M src/bin/initdb/initdb.c

Reduce icu_validation_level default to WARNING.

commit   : 6de31ce446e59a1f947c7ebe4e4bbe7ca2b842bc    
  
author   : Jeff Davis <[email protected]>    
date     : Wed, 17 May 2023 13:18:40 -0700    
  
committer: Jeff Davis <[email protected]>    
date     : Wed, 17 May 2023 13:18:40 -0700    

Click here for diff

Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/config.sgml
M src/backend/utils/adt/pg_locale.c
M src/backend/utils/misc/guc_tables.c
M src/backend/utils/misc/postgresql.conf.sample
M src/test/regress/expected/collate.icu.utf8.out
M src/test/regress/sql/collate.icu.utf8.sql

Fix error message wordings

commit   : 009bd237bf6db64ea1131df71f19a529b119fbef    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 17 May 2023 21:33:13 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 17 May 2023 21:33:13 +0200    

Click here for diff

The original patch for percentrepl.c c96de2ce17 adopted the error  
messages from basebackup_to_shell, but that uses terminology that  
doesn't really fit with the new API naming.  

M src/common/percentrepl.c

Add writeback to pg_stat_io

commit   : 093e5c57d506783a95dd8feddd9a3f2651e1aeba    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 17 May 2023 11:18:35 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 17 May 2023 11:18:35 -0700    

Click here for diff

28e626bde00 added the concept of IOOps but neglected to include writeback  
operations. ac8d53dae5 added time spent doing these I/O operations. Without  
counting writeback, checkpointer write time in the log often differed  
substantially from that in pg_stat_io. To fix this, add IOOp IOOP_WRITEBACK  
and track writeback in pg_stat_io.  
  
Bumps catversion.  
  
Author: Melanie Plageman <[email protected]>  
Reviewed-by: Kyotaro Horiguchi <[email protected]>  
Reported-by: Andres Freund <[email protected]>  
Discussion: https://postgr.es/m/20230419172326.dhgyo4wrrhulovt6%40awork3.anarazel.de  

M doc/src/sgml/monitoring.sgml
M src/backend/catalog/system_views.sql
M src/backend/storage/buffer/bufmgr.c
M src/backend/utils/activity/pgstat_io.c
M src/backend/utils/adt/pgstatfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.dat
M src/include/pgstat.h
M src/include/storage/buf_internals.h
M src/test/regress/expected/rules.out
M src/test/regress/expected/stats.out
M src/test/regress/sql/stats.sql

Update parameter name context to wb_context

commit   : 52676dc2e016df5cd842a4f6073b25ee8e681b9f    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 17 May 2023 11:17:12 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 17 May 2023 11:17:12 -0700    

Click here for diff

For clarity of review, renaming the function parameter "context" in  
ScheduleBufferTagForWriteback() and IssuePendingWritebacks() to  
"wb_context" is a separate commit. The next commit adds an "io_context"  
parameter and "wb_context" makes it more clear which is which.  
  
Author: Melanie Plageman <[email protected]>  
Discussion: https://postgr.es/m/CAAKRu_acc6iL4M3hvOTeztf_ZPpsB3Pqio5aVHgZ5q=Pi3BZKg@mail.gmail.com  

M src/backend/storage/buffer/bufmgr.c
M src/include/storage/buf_internals.h

Use BUFFER_USAGE_LIMIT to reduce needed test table size

commit   : 322875597c0c15cd85d03c8621038f4945c8caa3    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 17 May 2023 11:17:02 -0700    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 17 May 2023 11:17:02 -0700    

Click here for diff

Using the minimum BUFFER_USAGE_LIMIT value, we can make one of the pg_stat_io  
test tables smaller while still causing reuses.  
  
Author: Melanie Plageman <[email protected]>  
Discussion: https://postgr.es/m/CAAKRu_acc6iL4M3hvOTeztf_ZPpsB3Pqio5aVHgZ5q=Pi3BZKg@mail.gmail.com  

M src/test/regress/expected/stats.out
M src/test/regress/sql/stats.sql

Revert "Add USER SET parameter values for pg_db_role_setting"

commit   : b9a7a822723aebb16cbe7e5fb874e5124745b07e    
  
author   : Alexander Korotkov <[email protected]>    
date     : Wed, 17 May 2023 20:06:50 +0300    
  
committer: Alexander Korotkov <[email protected]>    
date     : Wed, 17 May 2023 20:06:50 +0300    

Click here for diff

This reverts commit 096dd80f3ccc and its fixups beecbe8e5001, afdd9f7f0e00,  
529da086ba, db93e739ac61.  
  
Catversion is bumped.  
  
Discussion: https://postgr.es/m/d46f9265-ff3c-6743-2278-6772598233c2%40pgmasters.net  

M doc/src/sgml/catalogs.sgml
M doc/src/sgml/ref/alter_database.sgml
M doc/src/sgml/ref/alter_role.sgml
M doc/src/sgml/ref/alter_user.sgml
M doc/src/sgml/ref/psql-ref.sgml
M src/backend/catalog/pg_db_role_setting.c
M src/backend/catalog/pg_proc.c
M src/backend/commands/functioncmds.c
M src/backend/parser/gram.y
M src/backend/utils/adt/arrayfuncs.c
M src/backend/utils/fmgr/fmgr.c
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/guc_funcs.c
M src/bin/pg_dump/dumputils.c
M src/bin/pg_dump/dumputils.h
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dumpall.c
M src/bin/psql/describe.c
M src/bin/psql/tab-complete.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_db_role_setting.h
M src/include/nodes/parsenodes.h
M src/include/utils/guc.h
M src/test/modules/Makefile
M src/test/modules/meson.build
D src/test/modules/test_pg_db_role_setting/.gitignore
D src/test/modules/test_pg_db_role_setting/Makefile
D src/test/modules/test_pg_db_role_setting/expected/test_pg_db_role_setting.out
D src/test/modules/test_pg_db_role_setting/meson.build
D src/test/modules/test_pg_db_role_setting/sql/test_pg_db_role_setting.sql
D src/test/modules/test_pg_db_role_setting/test_pg_db_role_setting–1.0.sql
D src/test/modules/test_pg_db_role_setting/test_pg_db_role_setting.c
D src/test/modules/test_pg_db_role_setting/test_pg_db_role_setting.control
M src/test/regress/expected/psql.out

pg_dump: Error message improvements

commit   : 58dc80acc5ebf12223be90db1a97dc0b31ca4e1f    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 17 May 2023 19:13:08 +0200    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 17 May 2023 19:13:08 +0200    

Click here for diff

Remove spurious semicolon from one error message, and print the  
offending value of a parameter reported as invalid in another.  

M src/bin/pg_dump/compress_zstd.c

pg_dump: Have _EndLO report errno after CFH->write_func() failure

commit   : 98bd4c72fd6c4f9d6a2b3b449cb89f335116ab5a    
  
author   : Alvaro Herrera <[email protected]>    
date     : Wed, 17 May 2023 18:55:51 +0200    
  
committer: Alvaro Herrera <[email protected]>    
date     : Wed, 17 May 2023 18:55:51 +0200    

Click here for diff

Other callers of that function do things this way, but this one didn't  
get the memo.  

M src/bin/pg_dump/pg_backup_directory.c

Track tlist_vinfo.varnullingrels even in non-Assert builds.

commit   : 69c430626b5eb44825a12e8bc90a59a90c4f5a03    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 17 May 2023 11:46:15 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 17 May 2023 11:46:15 -0400    

Click here for diff

Oversight in commit 867be9c07 (which should get reverted  
along with that, if we ever do revert it).  Per buildfarm.  

M src/backend/optimizer/plan/setrefs.c

Fix some issues with improper placement of outer join clauses.

commit   : 9df8f903eb6758be5a19e66cdf77e922e9329c31    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 17 May 2023 11:13:52 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 17 May 2023 11:13:52 -0400    

Click here for diff

After applying outer-join identity 3 in the forward direction,  
it was possible for the planner to mistakenly apply a qual clause  
from above the two outer joins at the now-lower join level.  
This can give the wrong answer, since a value that would get nulled  
by the now-upper join might not yet be null.  
  
To fix, when we perform such a transformation, consider that the  
now-lower join hasn't really completed the outer join it's nominally  
responsible for and thus its relid set should not include that OJ's  
relid (nor should its output Vars have that nullingrel bit set).  
Instead we add those bits when the now-upper join is performed.  
The existing rules for qual placement then suffice to prevent  
higher qual clauses from dropping below the now-upper join.  
There are a few complications from needing to consider transitive  
closures in case multiple pushdowns have happened, but all in all  
it's not a very complex patch.  
  
This is all new logic (from 2489d76c4) so no need to back-patch.  
The added test cases all have the same results as in v15.  
  
Tom Lane and Richard Guo  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/optimizer/README
M src/backend/optimizer/path/costsize.c
M src/backend/optimizer/path/equivclass.c
M src/backend/optimizer/path/indxpath.c
M src/backend/optimizer/path/joinrels.c
M src/backend/optimizer/plan/analyzejoins.c
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/util/orclauses.c
M src/backend/optimizer/util/relnode.c
M src/include/nodes/pathnodes.h
M src/include/optimizer/pathnode.h
M src/include/optimizer/paths.h
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Convert nullingrels match checks from Asserts to test-and-elog.

commit   : 867be9c0738bef591544d39985f886b7d8e99bf0    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 17 May 2023 10:50:35 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 17 May 2023 10:50:35 -0400    

Click here for diff

It seems like the code that these checks are backstopping may have  
a few bugs left in it.  Use a test-and-elog so that the tests are  
performed even in non-assert builds, and so that we get something  
more informative than "server closed the connection" on failure.  
  
Committed separately with the idea that eventually we'll revert  
this.  It might be awhile though.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/optimizer/plan/setrefs.c

Advance input pointer when LZ4 compressing data

commit   : 1a05c1d252993b0a59c58a6daf91a2df9333044f    
  
author   : Tomas Vondra <[email protected]>    
date     : Wed, 17 May 2023 16:49:31 +0200    
  
committer: Tomas Vondra <[email protected]>    
date     : Wed, 17 May 2023 16:49:31 +0200    

Click here for diff

LZ4File_write() did not advance the input pointer on subsequent invocations of  
LZ4F_compressUpdate(). As a result the generated compressed output would be a  
compressed version of the same input chunk.  
  
Tests failed to catch this error because the data would comfortably fit  
within the default buffer size, as a single chunk. Tests have been added  
to provide adequate coverage of multi-chunk compression.  
  
WriteDataToArchiveLZ4() which is also using LZ4F_compressUpdate() did  
not suffer from this omission.  
  
Author: Georgios Kokolatos <[email protected]>  
Reported-by: Michael Paquier <[email protected]>  
Discussion: https://postgr.es/m/ZFhCyn4Gm2eu60rB%40paquier.xyz  

M src/bin/pg_dump/compress_io.h
M src/bin/pg_dump/compress_lz4.c
M src/bin/pg_dump/t/002_pg_dump.pl

Null-terminate the output buffer of LZ4Stream_gets

commit   : 3c18d90f8907e53c3021fca13ad046133c480e4d    
  
author   : Tomas Vondra <[email protected]>    
date     : Wed, 17 May 2023 16:35:17 +0200    
  
committer: Tomas Vondra <[email protected]>    
date     : Wed, 17 May 2023 16:35:17 +0200    

Click here for diff

LZ4Stream_gets did not null-terminate its output buffer. The callers expected  
the buffer to be null-terminated and passed it around to functions such as  
sscanf with unintended consequences.  
  
Author: Georgios Kokolatos <[email protected]>  
Reported-by: Alexander Lakhin <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/bin/pg_dump/compress_lz4.c

Add back SQLValueFunction for SQL keywords

commit   : d8c3106bb60e4f87be595f241e173ba3c2b7aa2c    
  
author   : Michael Paquier <[email protected]>    
date     : Wed, 17 May 2023 10:19:17 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Wed, 17 May 2023 10:19:17 +0900    

Click here for diff

This is equivalent to a revert of f193883 and fb32748, with the addition  
that the declaration of the SQLValueFunction node needs to gain a couple  
of node_attr for query jumbling.  The performance impact of removing the  
function call inlining is proving to be too huge for some workloads  
where these are used.  A worst-case test case of involving only simple  
SELECT queries with a SQL keyword is proving to lead to a reduction of  
10% in TPS via pgbench and prepared queries on a high-end machine.  
  
None of the tests I ran back for this set of changes saw such a huge  
gap, but Alexander Lakhin and Andres Freund have found that this can be  
noticeable.  Keeping the older performance would mean to do more  
inlining in the executor when using COERCE_SQL_SYNTAX for a function  
expression, similarly to what SQLValueFunction does.  This requires more  
redesign work and there is little time until 16beta1 is released, so for  
now reverting the change is the best way forward, bringing back the  
previous performance.  
  
Bump catalog version.  
  
Reported-by: Alexander Lakhin  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/catalog/system_functions.sql
M src/backend/executor/execExpr.c
M src/backend/executor/execExprInterp.c
M src/backend/jit/llvm/llvmjit_expr.c
M src/backend/jit/llvm/llvmjit_types.c
M src/backend/nodes/nodeFuncs.c
M src/backend/optimizer/path/costsize.c
M src/backend/optimizer/util/clauses.c
M src/backend/parser/gram.y
M src/backend/parser/parse_expr.c
M src/backend/parser/parse_target.c
M src/backend/utils/adt/date.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/adt/timestamp.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.dat
M src/include/executor/execExpr.h
M src/include/nodes/primnodes.h
M src/include/utils/date.h
M src/include/utils/timestamp.h
M src/test/regress/expected/expressions.out
M src/test/regress/sql/expressions.sql
M src/tools/pgindent/typedefs.list

Ensure Soundex difference() function handles empty input sanely.

commit   : 1d369c9e90f311ec98b07a259cac48c404c773d5    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 16 May 2023 10:53:42 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 16 May 2023 10:53:42 -0400    

Click here for diff

fuzzystrmatch's difference() function assumes that _soundex()  
always initializes its output buffer fully.  This was not so for  
the case of a string containing no alphabetic characters, resulting  
in unstable output and Valgrind complaints.  
  
Fix by using memset() to fill the whole buffer in the early-exit  
case.  Also make some cosmetic improvements (I didn't care for the  
random switches between "instr[0]" and "*instr" notation).  
  
Report and diagnosis by Alexander Lakhin (bug #17935).  
Back-patch to all supported branches.  
  
Discussion: https://postgr.es/m/[email protected]  

M contrib/fuzzystrmatch/expected/fuzzystrmatch.out
M contrib/fuzzystrmatch/fuzzystrmatch.c
M contrib/fuzzystrmatch/sql/fuzzystrmatch.sql

libpq: Error message improvement

commit   : 27debd05dcbdfe3db487ba82568f7f9ae25ddde2    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 16 May 2023 11:50:08 +0200    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 16 May 2023 11:50:08 +0200    

Click here for diff

Move a variable name out of the translatable message, to make it  
identical to others.  

M src/interfaces/libpq/fe-connect.c

Mark internal messages as no longer translatable

commit   : c44b59fad453fd4be9656d58dd5f51a11149c961    
  
author   : Alvaro Herrera <[email protected]>    
date     : Tue, 16 May 2023 11:47:25 +0200    
  
committer: Alvaro Herrera <[email protected]>    
date     : Tue, 16 May 2023 11:47:25 +0200    

Click here for diff

The problem that these messages protect against can only occur because  
a corrupted hash spill file was written, i.e., a Postgres bug.  There's  
no reason to have them as translatable.  
  
Backpatch to 15, where these messages were changed by commit c4649cce39a4.  
  
Reviewed-by: Daniel Gustafsson <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/executor/nodeAgg.c

Fix reported runtime for single tests in pg_regress

commit   : 8cb94344c3c7130a0cd5e21e83705739f552187e    
  
author   : Daniel Gustafsson <[email protected]>    
date     : Tue, 16 May 2023 10:49:48 +0200    
  
committer: Daniel Gustafsson <[email protected]>    
date     : Tue, 16 May 2023 10:49:48 +0200    

Click here for diff

Commit 558fff0adf got the order of the parameters to test_status_failed  
mixed up which resulted in the runtime being reported as 0 ms.  Fix by  
changing the order to the correct one.  No backpatching is needed since  
this has not been shipped in a release yet.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/test/regress/pg_regress.c

doc: Fix ordering of entries in wait event table for I/O type

commit   : 44e977d7ecb915d1181007e700f2da31acb6ea4c    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 16 May 2023 16:51:44 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 16 May 2023 16:51:44 +0900    

Click here for diff

Issue spotted while reviewing a different patch touching this area.  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/monitoring.sgml

libpq: Error message improvement

commit   : c91f3560835f76bd8c9f614bebaa8c634b98b451    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 16 May 2023 08:59:34 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 16 May 2023 08:59:34 +0200    

Click here for diff

M src/interfaces/libpq/fe-auth.c
M src/test/authentication/t/001_password.pl
M src/test/authentication/t/005_sspi.pl
M src/test/kerberos/t/001_auth.pl

psql: Adjust capitalization of table heading

commit   : 489b5409e4a0fa36c951561bae8ae4394e7d623f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 16 May 2023 06:13:59 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 16 May 2023 06:13:59 +0200    

Click here for diff

for consistency with surrounding headings  

M src/bin/psql/describe.c
M src/test/regress/expected/subscription.out

doc: Fix incorrect version list for Windows SDK

commit   : 08c45ae235660844167de8730da908d351f4352d    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 15 May 2023 16:02:07 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 15 May 2023 16:02:07 +0900    

Click here for diff

References to SDK 8.1a should have been cleaned up in 495ed0e, as only  
version 10 and above are supported with Windows 10 and newer versions.  
  
Reported-by: Thomas Munro  
Discussion: https://postgr.es/m/CA+hUKG++qE9uVjQaTTD7oaC8a2T3h8K50=Eqyx9uUZvOHa__ww@mail.gmail.com  

M doc/src/sgml/install-windows.sgml

Fix incorrect TAP test ordering

commit   : 92155e15d3cfe97758552484acb1583aaf71cda6    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 15 May 2023 07:07:09 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 15 May 2023 07:07:09 +0200    

Click here for diff

Using a test function before a possible skip_all is incorrect.  If the  
skip_all is called, the test output will become incorrect and the test  
file will fail.  
  
a4f23f9b3c introduced a new test before skip_all.  After discussion,  
this doesn't really need to be a test.  Instead, we just bail out if  
the condition is not satisfied.  
  
Discussion: https://www.postgresql.org/message-id/[email protected]  

M src/bin/pg_amcheck/t/004_verify_heapam.pl

Fix whitespace inconsistencies

commit   : 1d70fb400c2c8312dac3ff19a1bb1cb5351047ce    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 15 May 2023 06:27:40 +0200    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 15 May 2023 06:27:40 +0200    

Click here for diff

M src/bin/pg_amcheck/t/004_verify_heapam.pl

Fix wal_writer_flush_after initializer value.

commit   : 63932a6d38e5dfa6df2a51a04b7314ec1e4d3de7    
  
author   : Thomas Munro <[email protected]>    
date     : Mon, 15 May 2023 10:45:19 +1200    
  
committer: Thomas Munro <[email protected]>    
date     : Mon, 15 May 2023 10:45:19 +1200    

Click here for diff

Commit a73952b7956 (new in 16) required default values in guc_table.c  
and C variable initializers to match.  This one only matched when  
XLOG_BLCKSZ == 8kB.  Fix by using the same expression in both places  
with a new DEFAULT_XXX macro, as done for other GUCs.  
  
Reviewed-by: Andres Freund <[email protected]>  
Discussion: https://postgr.es/m/CA+hUKGLNmLV=VrT==5MqnbARgx2ifRSFtdd8ofdfrdSLL3yv5A@mail.gmail.com  

M src/backend/postmaster/walwriter.c
M src/backend/utils/misc/guc_tables.c
M src/include/postmaster/walwriter.h

Rename io_direct to debug_io_direct.

commit   : 319bae9a8da66678d80d862440e54cebc7b1cc24    
  
author   : Thomas Munro <[email protected]>    
date     : Mon, 15 May 2023 10:31:14 +1200    
  
committer: Thomas Munro <[email protected]>    
date     : Mon, 15 May 2023 10:31:14 +1200    

Click here for diff

Give the new GUC introduced by d4e71df6 a name that is clearly not  
intended for mainstream use quite yet.  
  
Future proposals would drop the prefix only after adding infrastructure  
to make it efficient.  Having the switch in the tree sooner is good  
because it might lead to new discoveries about the hazards awaiting us  
on a wide range of systems, but that name was too enticing and could  
lead to cross-version confusion in future, per complaints from Noah and  
Justin.  
  
Suggested-by: Noah Misch <[email protected]>  
Reviewed-by: Noah Misch <[email protected]>  
Reviewed-by: Justin Pryzby <[email protected]> (the idea, not the patch)  
Reviewed-by: Tom Lane <[email protected]> (ditto)  
Discussion: https://postgr.es/m/20230430041106.GA2268796%40rfd.leadboat.com  

M doc/src/sgml/config.sgml
M src/backend/storage/file/fd.c
M src/backend/utils/misc/guc_tables.c
M src/test/modules/test_misc/t/004_io_direct.pl

Improve error message for pg_create_subscription.

commit   : 4d5105a684ba20bf6a98e6ae48224fe93382c040    
  
author   : Nathan Bossart <[email protected]>    
date     : Fri, 12 May 2023 13:50:46 -0700    
  
committer: Nathan Bossart <[email protected]>    
date     : Fri, 12 May 2023 13:50:46 -0700    

Click here for diff

c3afe8cf5a updated this error message, but it didn't use the new  
style established in de4d456b40.  
  
Reviewed-by: Tom Lane  
Discussion: https://postgr.es/m/20230512203721.GA2644063%40nathanxps13.home  

M src/backend/commands/subscriptioncmds.c
M src/test/regress/expected/subscription.out

Tighten usage of PSQL_WATCH_PAGER.

commit   : 51b2c08798867cb9788090704b37c4698b456240    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 12 May 2023 16:11:14 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 12 May 2023 16:11:14 -0400    

Click here for diff

Don't use PSQL_WATCH_PAGER when stdin/stdout are not a terminal.  
This corresponds to the re