PostgreSQL 15.0 (upcoming) commit log

Make int64_div_fast_to_numeric() more robust.

commit   : b2d47928908d7a99b8e39198d0e8e9e0cb2b024b    
  
author   : Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Fri, 3 Feb 2023 11:13:34 +0000    
  
committer: Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Fri, 3 Feb 2023 11:13:34 +0000    

Click here for diff

The prior coding of int64_div_fast_to_numeric() had a number of bugs  
that would cause it to fail under different circumstances, such as  
with log10val2 <= 0, or log10val2 a multiple of 4, or in the "slow"  
numeric path with log10val2 >= 10.  
  
None of those could be triggered by any of our current code, which  
only uses log10val2 = 3 or 6. However, they made it a hazard for any  
future code that might use it. Also, since this is exported by  
numeric.c, users writing their own C code might choose to use it.  
  
Therefore fix, and back-patch to v14, where it was introduced.  
  
Dean Rasheed, reviewed by Tom Lane.  
  
Discussion: https://postgr.es/m/CAEZATCW8gXgW0tgPxPgHDPhVX71%2BSWFRkhnXy%2BTfGDsKLepu2g%40mail.gmail.com  

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

doc: Fix XML formatting that psql cannot handle

commit   : 2010d8b75a6eb0f2ce90ae24cba99775c3d343e8    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 3 Feb 2023 09:04:35 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 3 Feb 2023 09:04:35 +0100    

Click here for diff

Breaking <phrase> over two lines is not handled by psql's  
create_help.pl.  (It creates faulty \help output.)  
  
Undo the formatting change introduced by  
9bdad1b5153e5d6b77a8f9c6e32286d6bafcd76d to fix this for now.  

M doc/src/sgml/ref/fetch.sgml
M doc/src/sgml/ref/move.sgml

ci: Use windows VMs instead of windows containers

commit   : 98811323c8e9a1995b828a47504b6608f0f3f59a    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Thu, 2 Feb 2023 21:31:24 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Thu, 2 Feb 2023 21:31:24 -0800    

Click here for diff

So far we have used containers for testing windows on cirrus-ci. Unfortunately  
they come with substantial overhead: First, the container images are pulled  
onto the host on-demand. Due to the large size of windows containers, that  
ends up taking nearly 4 minutes. Secondly, IO is slow, leading to CI runs  
taking long.  
  
Thus switch to windows VMs, improving windows CI times by well over 2x.  
  
Author: Nazir Bilal Yavuz <byavuz81@gmail.com>  
Discussion: https://postgr.es/m/211afb88-6df6-b74d-f1b7-84b5f21ad875@gmail.com  
Backpatch: 15-, where CI was added  

M .cirrus.yml

Reduce code duplication between heapgettup and heapgettup_pagemode

commit   : 7ae0ab0ad9704b10400a611a9af56c63304c27a5    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Fri, 3 Feb 2023 16:20:43 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Fri, 3 Feb 2023 16:20:43 +1300    

Click here for diff

The code to get the next block number was exactly the same between these  
two functions, so let's just put it into a helper function and call that  
from both locations.  
  
Author: Melanie Plageman  
Reviewed-by: Andres Freund, David Rowley  
Discussion: https://postgr.es/m/CAAKRu_bvkhka0CZQun28KTqhuUh5ZqY=_T8QEqZqOL02rpi2bw@mail.gmail.com  

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

Optimize the origin drop functionality.

commit   : 3e577ff602fe3438ac60771c4a6d027d881619b0    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Fri, 3 Feb 2023 08:29:08 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Fri, 3 Feb 2023 08:29:08 +0530    

Click here for diff

To interlock against concurrent drops, we use to hold ExclusiveLock on  
pg_replication_origin till xact commit. This blocks even concurrent drops  
of different origins by tablesync workers. So, instead, lock the specific  
origin to interlock against concurrent drops.  
  
This reduces the test time variability in src/test/subscription where  
multiple tables are being synced.  
  
Author: Vignesh C  
Reviewed-by: Hou Zhijie, Amit Kapila  
Discussion: https://postgr.es/m/1412708.1674417574@sss.pgh.pa.us  

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

ci: Upgrade macOS version from 12 to 13.

commit   : 2e9f120b657e540b36843dbb075dab196e79fbfd    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 3 Feb 2023 14:26:54 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 3 Feb 2023 14:26:54 +1300    

Click here for diff

Back-patch to 15, where in-tree CI began.  
  
Author: Justin Pryzby <pryzby@telsasoft.com>  
Discussion: https://postgr.es/m/1441145.1675300332%40sss.pgh.pa.us  

M .cirrus.yml

Add helper functions to simplify heapgettup code

commit   : 8ca6d49f634124e2f77f5c02af244c4ca4a3b1e9    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Fri, 3 Feb 2023 12:38:42 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Fri, 3 Feb 2023 12:38:42 +1300    

Click here for diff

Here we add heapgettup_start_page() and heapgettup_continue_page() to  
simplify the code in the heapgettup() function.  
  
Author: Melanie Plageman  
Reviewed-by: David Rowley  
Discussion: https://postgr.es/m/CAAKRu_bvkhka0CZQun28KTqhuUh5ZqY=_T8QEqZqOL02rpi2bw@mail.gmail.com  

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

Further refactor of heapgettup and heapgettup_pagemode

commit   : f9bc34fcb664e93d1fa3c3873527dce6f4cc495f    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Fri, 3 Feb 2023 11:48:39 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Fri, 3 Feb 2023 11:48:39 +1300    

Click here for diff

Backward and forward scans share much of the same page acquisition code.  
Here we consolidate that code to reduce some duplication.  
  
Additionally, add a new rs_coffset field to HeapScanDescData to track the  
offset of the current tuple.  The new field fits nicely into the padding  
between a bool and BlockNumber field and saves having to look at the last  
returned tuple to figure out which offset we should be looking at for the  
current tuple.  
  
Author: Melanie Plageman  
Reviewed-by: David Rowley  
Discussion: https://postgr.es/m/CAAKRu_bvkhka0CZQun28KTqhuUh5ZqY=_T8QEqZqOL02rpi2bw@mail.gmail.com  

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

Retire PG_SETMASK() macro.

commit   : cdf6518ef08ee602b94db4e5ba5887a1d7053c24    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 3 Feb 2023 10:34:56 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 3 Feb 2023 10:34:56 +1300    

Click here for diff

In the 90s we needed to deal with computers that still had the  
pre-standard signal masking APIs.  That hasn't been relevant for a very  
long time on Unix systems, and c94ae9d8 got rid of a remaining  
dependency in our Windows porting code.  PG_SETMASK didn't expose  
save/restore functionality, so we'd already started using sigprocmask()  
directly in places, creating the visual distraction of having two ways  
to spell it.  It's not part of the API that extensions are expected to  
be using (but if they are, the change will be trivial).  It seems like a  
good time to drop the old macro and just call the standard POSIX  
function.  
  
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>  
Discussion: https://postgr.es/m/CA%2BhUKG%2BKfQgrhHP2DLTohX1WwubaCBHmTzGnAEDPZ-Gug-Xskg%40mail.gmail.com  

M src/backend/access/transam/xact.c
M src/backend/postmaster/autovacuum.c
M src/backend/postmaster/bgworker.c
M src/backend/postmaster/bgwriter.c
M src/backend/postmaster/checkpointer.c
M src/backend/postmaster/pgarch.c
M src/backend/postmaster/postmaster.c
M src/backend/postmaster/startup.c
M src/backend/postmaster/syslogger.c
M src/backend/postmaster/walwriter.c
M src/backend/replication/walreceiver.c
M src/backend/tcop/postgres.c
M src/backend/utils/init/miscinit.c
M src/include/libpq/pqsignal.h

Document installing perltidy with cpanm

commit   : e0d70a91a04b942980ab06bc471d2b5b65952459    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Thu, 2 Feb 2023 08:54:38 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Thu, 2 Feb 2023 08:54:38 -0500    

Click here for diff

Installing with plain cpan failed for me recently, as the archive it  
searched has been purged of old releases. However, you can give cpanm a  
complete URL to the exact version you want to install, so document using  
that.  

M src/tools/pgindent/README

Clarify the choice of rscale in numeric_sqrt().

commit   : 0736fc1ceb0659a9f73699910ac56603336daeee    
  
author   : Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Thu, 2 Feb 2023 09:41:22 +0000    
  
committer: Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Thu, 2 Feb 2023 09:41:22 +0000    

Click here for diff

Improve the comment explaining the choice of rscale in numeric_sqrt(),  
and ensure that the code works consistently when other values of  
NBASE/DEC_DIGITS are used.  
  
Note that, in practice, we always expect DEC_DIGITS == 4, and this  
does not change the computation in that case.  
  
Joel Jacobson and Dean Rasheed  
  
Discussion: https://postgr.es/m/06712c29-98e9-43b3-98da-f234d81c6e49%40app.fastmail.com  

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

Ensure that numeric.c compiles with other NBASE values.

commit   : 9a84f2947bf9345ad6b93ba37da63633649eaea8    
  
author   : Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Thu, 2 Feb 2023 09:39:08 +0000    
  
committer: Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Thu, 2 Feb 2023 09:39:08 +0000    

Click here for diff

As noted in the comments, support for different NBASE values is really  
only of historical interest, but as long as we're keeping it, we might  
as well make sure that it compiles.  
  
Joel Jacobson  
  
Discussion: https://postgr.es/m/06712c29-98e9-43b3-98da-f234d81c6e49%40app.fastmail.com  

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

Doc: Abstract AF_UNIX sockets don't work on Windows.

commit   : 117d2604c2a59eb853e894410b94b4c453f8bd43    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Thu, 2 Feb 2023 18:13:44 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Thu, 2 Feb 2023 18:13:44 +1300    

Click here for diff

An early release of AF_UNIX in Windows apparently supported Linux-style  
"abstract" Unix sockets, but they do not seem to work in current Windows  
versions and there is no mention of any of this in the Winsock  
documentation.  Remove the mention of Windows from the documentation.  
  
Back-patch to 14, where commit c9f0624b landed.  
  
Discussion: https://postgr.es/m/CA%2BhUKGKrYbSZhrk4NGfoQGT_3LQS5pC5KNE1g0tvE_pPBZ7uew%40mail.gmail.com  

M doc/src/sgml/config.sgml

Allow the logical_replication_mode to be used on the subscriber.

commit   : 9f2213a7c575bae43a2d41abc8b60770066ca81c    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Thu, 2 Feb 2023 08:15:18 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Thu, 2 Feb 2023 08:15:18 +0530    

Click here for diff

Extend the existing developer option 'logical_replication_mode' to help  
test the parallel apply of large transactions on the subscriber.  
  
When set to 'buffered', the leader sends changes to parallel apply workers  
via a shared memory queue. When set to 'immediate', the leader serializes  
all changes to files and notifies the parallel apply workers to read and  
apply them at the end of the transaction.  
  
This helps in adding tests to cover the serialization code path in  
parallel streaming mode.  
  
Author: Hou Zhijie  
Reviewed-by: Peter Smith, Kuroda Hayato, Sawada Masahiko, Amit Kapila  
Discussion: https://postgr.es/m/CAA4eK1+wyN6zpaHUkCLorEWNx75MG0xhMwcFhvjqm2KURZEAGw@mail.gmail.com  

M doc/src/sgml/config.sgml
M src/backend/replication/logical/applyparallelworker.c
M src/backend/utils/misc/guc_tables.c
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

Refactor heapam.c adding heapgettup_initial_block function

commit   : fb1a59de0c52609653166aafc6ce8679a9cfe54b    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Thu, 2 Feb 2023 14:17:15 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Thu, 2 Feb 2023 14:17:15 +1300    

Click here for diff

Here we adjust heapgettup() and heapgettup_pagemode() to move the code  
that fetches the first block number to scan out into a helper function.  
This removes some code duplication.  
  
Author: Melanie Plageman  
Reviewed-by: David Rowley  
Discussion: https://postgr.es/m/CAAKRu_bvkhka0CZQun28KTqhuUh5ZqY=_T8QEqZqOL02rpi2bw@mail.gmail.com  

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

meson: Fix typo in pkgconfig generation

commit   : 253432f42661fdd67d235252949e2838aa6421fd    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Wed, 1 Feb 2023 18:14:01 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Wed, 1 Feb 2023 18:14:01 +0100    

Click here for diff

Reviewed-by: Andres Freund <andres@anarazel.de>  
Discussion: https://www.postgresql.org/message-id/flat/07b37c70-349a-8fcd-bcc9-6c3ce0f6c2a4%40enterprisedb.com  

M src/interfaces/ecpg/ecpglib/meson.build

Simplify main waiting loop of the archiver process

commit   : 38cc08546459a9052b6ed43cdb28973288db38c6    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Wed, 1 Feb 2023 15:46:04 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Wed, 1 Feb 2023 15:46:04 +0900    

Click here for diff

As coded, the timeout given to WaitLatch() was always equal to  
PGARCH_AUTOWAKE_INTERVAL, as time() was called two times repeatedly.  
This simplification could have been done in d75288f.  
  
While on it, this adjusts a comment in pgarch.c to describe the archiver  
in a more neutral way.  
  
Author: Sravan Kumar, Nathan Bossart  
Reviewed-by: Kyotaro Horiguchi  
Discussion: https://postgr.es/m/CA+=NbjjqYE9-Lnw7H7DAiS5jebmoMikwZQb_sBP7kgBCn9q6Hg@mail.gmail.com  

M src/backend/postmaster/pgarch.c

commit   : fbed4bc59e362e13fb0d0e0b08c995c18c7e4d5a    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Tue, 31 Jan 2023 17:36:39 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Tue, 31 Jan 2023 17:36:39 -0800    

Click here for diff

Thanks to Robins to find the issue and Nathan for promptly writing a test case  
to prevent future problems like this.  
  
Reported-by: Nathan Bossart <nathandbossart@gmail.com>  
Reported-by: Robins Tharakan <tharakan@gmail.com>  
Author: Nathan Bossart <nathandbossart@gmail.com>  
Discussion: https://postgr.es/m/20230130193008.GA2740781@nathanxps13  

M contrib/dblink/dblink.c
M contrib/dblink/expected/dblink.out
M contrib/dblink/sql/dblink.sql

Try to fix pg_upgrade test on Windows, again.

commit   : c2891175052772b603da6d0ae634e42b63b7f274    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Wed, 1 Feb 2023 14:29:51 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Wed, 1 Feb 2023 14:29:51 +1300    

Click here for diff

Further to commit 54e72b66e, if rmtree() fails while cleaning up in  
pg_upgrade, try again.  This gives our Windows unlink() wrapper a chance  
to reach its wait-for-the-other-process-to-go-away logic, if the first  
go around initiated the unlink of a file that a concurrently exiting  
program still has open.  
  
Discussion: https://postgr.es/m/CA%2BhUKGKCVy2%3Do%3Dd8c2Va6a_3Rpf_KkhUitkWCZ3hzuO2VwLMXA%40mail.gmail.com  

M src/bin/pg_upgrade/util.c

Update time zone data files to tzdata release 2022g.

commit   : 758f44bc3a365bed6b82db098bebc26ef441ba42    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 31 Jan 2023 17:36:55 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 31 Jan 2023 17:36:55 -0500    

Click here for diff

DST law changes in Greenland and Mexico.  Notably, a new timezone  
America/Ciudad_Juarez has been split off from America/Ojinaga.  
  
Historical corrections for northern Canada, Colombia, and Singapore.  

M src/timezone/data/tzdata.zi

Remove dead NoMovementScanDirection code

commit   : e9aaf06328c7f962f8586618981e9763d31402a3    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Wed, 1 Feb 2023 10:52:41 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Wed, 1 Feb 2023 10:52:41 +1300    

Click here for diff

Here remove some dead code from heapgettup() and heapgettup_pagemode()  
which was trying to support NoMovementScanDirection scans.  This code can  
never be reached as standard_ExecutorRun() never calls ExecutePlan with  
NoMovementScanDirection.  
  
Additionally, plans which were scanning an unordered index would use  
NoMovementScanDirection rather than ForwardScanDirection.  There was no  
real need for this, so here we adjust this so we use ForwardScanDirection  
for unordered index scans.  A comment in pathnodes.h claimed that  
NoMovementScanDirection was used for PathKey reasons, but if that was  
true, it no longer is, per code in build_index_paths().  
  
This does change the non-text format of the EXPLAIN output so that  
unordered index scans now have a "Forward" scan direction rather than  
"NoMovement".  The text format of EXPLAIN has not changed.  
  
Author: Melanie Plageman  
Reviewed-by: Tom Lane, David Rowley  
Discussion: https://postgr.es/m/CAAKRu_bvkhka0CZQun28KTqhuUh5ZqY=_T8QEqZqOL02rpi2bw@mail.gmail.com  

M src/backend/access/heap/heapam.c
M src/backend/commands/explain.c
M src/backend/executor/nodeIndexonlyscan.c
M src/backend/executor/nodeIndexscan.c
M src/backend/optimizer/path/indxpath.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/util/pathnode.c
M src/include/access/sdir.h
M src/include/access/tableam.h
M src/include/nodes/pathnodes.h

Doc: clarify use of NULL to drop comments and security labels.

commit   : 856ca51a23b56df6aab3ee9bffc66334b79be355    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 31 Jan 2023 14:32:24 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 31 Jan 2023 14:32:24 -0500    

Click here for diff

This was only mentioned in the description of the text/label, which  
are marked as being in quotes in the synopsis, which can cause  
confusion (as witnessed on IRC).  
  
Also separate the literal and NULL cases in the parameter list, per  
suggestion from Tom Lane.  
  
Also add an example of dropping a security label.  
  
Dagfinn Ilmari Mannsåker, with some tweaks by me  
  
Discussion: https://postgr.es/m/87sffqk4zp.fsf@wibble.ilmari.org  

M doc/src/sgml/ref/comment.sgml
M doc/src/sgml/ref/security_label.sgml

Remove over-optimistic Assert.

commit   : eae0e20deffb0a73f7cb0e94746f94a1347e71b1    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 31 Jan 2023 11:57:47 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 31 Jan 2023 11:57:47 -0500    

Click here for diff

In commit 2489d76c4, I'd thought it'd be safe to assert that a  
PlaceHolderVar appearing in a scan-level expression has empty  
nullingrels.  However this is not so, as when we determine that a  
join relation is certainly empty we'll put its targetlist into a  
Result-with-constant-false-qual node, and nothing is done to adjust  
the nullingrels of the Vars or PHVs therein.  (Arguably, a Result  
used in this way isn't really a scan-level node, but it certainly  
isn't an upper node either ...)  
  
It's not clear this is worth any close analysis, so let's just  
take out the faulty Assert.  
  
Per report from Robins Tharakan.  I added a test case based on  
his example, just in case somebody tries to tighten this up.  
  
Discussion: https://postgr.es/m/CAEP4nAz7Enq3+DEthGG7j27DpuwSRZnW0Nh6jtNh75yErQ_nbA@mail.gmail.com  

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

Generate code for query jumbling through gen_node_support.pl

commit   : 3db72ebcbe20debc6552500ee9ccb4b2007f12f8    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Tue, 31 Jan 2023 15:24:05 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Tue, 31 Jan 2023 15:24:05 +0900    

Click here for diff

This commit changes the query jumbling code in queryjumblefuncs.c to be  
generated automatically based on the information of the nodes in the  
headers of src/include/nodes/ by using gen_node_support.pl.  This  
approach offers many advantages:  
- Support for query jumbling for all the utility statements, based on the  
state of their parsed Nodes and not only their query string.  This will  
greatly ease the switch to normalize the information of some DDLs, like  
SET or CALL for example (this is left unchanged and should be part of a  
separate discussion).  With this feature, the number of entries stored  
for utilities in pg_stat_statements is reduced (for example now  
"CHECKPOINT" and "checkpoint" mean the same thing with the same query  
ID).  
- Documentation of query jumbling directly in the structure definition  
of the nodes.  Since this code has been introduced in pg_stat_statements  
and then moved to code, the reasons behind the choices of what should be  
included in the jumble are rather sparse.  Note that some explanation is  
added for the most relevant parts, as a start.  
- Overall code reduction and more consistency with the other parts  
generating read, write and copy depending on the nodes.  
  
The query jumbling is controlled by a couple of new node attributes,  
documented in nodes/nodes.h:  
- custom_query_jumble, to mark a Node as having a custom  
implementation.  
- no_query_jumble, to ignore entirely a Node.  
- query_jumble_ignore, to ignore a field in a Node.  
- query_jumble_location, to mark a location in a Node, for  
normalization.  This can apply only to int fields, with "location" in  
their name (only Const as of this commit).  
  
There should be no compatibility impact on pg_stat_statements, as the  
new code applies the jumbling to the same fields for each node (its  
regression tests have no modification, for one).  
  
Some benchmark of the query jumbling between HEAD and this commit for  
SELECT and DMLs has proved that this new code does not cause a  
performance regression, with computation times close for both methods.  
For utility queries, the new method is slower than the previous method  
of calculating a hash of the query string, though we are talking about  
extra ns-level changes based on what I measured, which is unnoticeable  
even for OLTP workloads as a query ID is calculated once per query  
post-parse analysis.  
  
Author: Michael Paquier  
Reviewed-by: Peter Eisentraut  
Discussion: https://postgr.es/m/Y5BHOUhX3zTH/ig6@paquier.xyz  

M contrib/pg_stat_statements/expected/pg_stat_statements.out
M contrib/pg_stat_statements/sql/pg_stat_statements.sql
M src/backend/nodes/README
M src/backend/nodes/gen_node_support.pl
M src/backend/nodes/meson.build
M src/backend/nodes/queryjumblefuncs.c
M src/include/nodes/bitmapset.h
M src/include/nodes/nodes.h
M src/include/nodes/parsenodes.h
M src/include/nodes/primnodes.h

Remove recovery test 011_crash_recovery.pl

commit   : 8c1cd726c5d997d5d170505ec15a2dc1dfe81d6a    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Tue, 31 Jan 2023 12:46:56 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Tue, 31 Jan 2023 12:46:56 +0900    

Click here for diff

This test has been added as of 857ee8e that has introduced the SQL  
function txid_status(), with the purpose of checking that a transaction  
ID still in-progress during a crash is correctly marked as aborted after  
recovery finishes.  
  
This test is unstable, and some configuration scenarios may that easier  
to reproduce (wal_level=minimal, wal_compression=on) because the WAL  
holding the information about the in-progress transaction ID may not  
have made it to disk yet, hence a post-crash recovery may cause the same  
XID to be reused, triggering a test failure.  
  
We have discussed a few approaches, like making this function force a  
WAL flush to make it reliable across crashes, but we don't want to pay a  
performance penalty in some scenarios, as well.  The test could have  
been tweaked to enforce a checkpoint but that actually breaks the  
promise of the test to rely on a stable result of txid_status() after  
a crash.  
  
This issue has been reported a few times across the past years, with an  
original report from Kyotaro Horiguchi.  The buildfarm machines tanager,  
hachi and gokiburi enable wal_compression, and fail on this test  
periodically.  
  
Discussion: https://postgr.es/m/3163112.1674762209@sss.pgh.pa.us  
Discussion: https://postgr.es/m/20210305.115011.558061052471425531.horikyota.ntt@gmail.com  
Backpatch-through: 11  

M src/test/recovery/meson.build
D src/test/recovery/t/011_crash_recovery.pl

Refactor rmtree() to use get_dirent_type().

commit   : 54e72b66ed1a55c2fa558bc60d534bdc61dbb62f    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Tue, 31 Jan 2023 13:07:44 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Tue, 31 Jan 2023 13:07:44 +1300    

Click here for diff

Switch to get_dirent_type() instead of lstat() while traversing a  
directory tree, to see if that fixes the intermittent ENOTEMPTY failures  
seen in recent pg_upgrade tests, on Windows CI.  While refactoring, also  
use AllocateDir() instead of opendir() in the backend, which knows how  
to handle descriptor pressure.  
  
Our CI system currently uses Windows Server 2019, a version known not to  
have POSIX unlink semantics enabled by default yet, unlike typical  
Windows 10 and 11 systems.  That might explain why we see this flapping  
on CI but (apparently) not in the build farm, though the frequency is  
quite low.  
  
The theory is that some directory entry must be in state  
STATUS_DELETE_PENDING, which lstat() would report as ENOENT, though  
unfortunately we don't know exactly why yet.  With this change, rmtree()  
will not skip them, and try to unlink (again).  Our unlink() wrapper  
should either wait a short time for them to go away when some other  
process closes the handle, or log a message to tell us the path of the  
problem file if not, so we can dig further.  
  
Discussion: https://postgr.es/m/20220919213217.ptqfdlcc5idk5xup%40awork3.anarazel.de  

M src/common/rmtree.c

Invent "join domains" to replace the below_outer_join hack.

commit   : 3bef56e11650a33f70adeb6dd442bc2b48bb9b72    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 30 Jan 2023 13:50:25 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 30 Jan 2023 13:50:25 -0500    

Click here for diff

EquivalenceClasses are now understood as applying within a "join  
domain", which is a set of inner-joined relations (possibly underneath  
an outer join).  We no longer need to treat an EC from below an outer  
join as a second-class citizen.  
  
I have hopes of eventually being able to treat outer-join clauses via  
EquivalenceClasses, by means of only applying deductions within the  
EC's join domain.  There are still problems in the way of that, though,  
so for now the reconsider_outer_join_clause logic is still here.  
  
I haven't been able to get rid of RestrictInfo.is_pushed_down either,  
but I wonder if that could be recast using JoinDomains.  
  
I had to hack one test case in postgres_fdw.sql to make it still test  
what it was meant to, because postgres_fdw is inconsistent about  
how it deals with quals containing non-shippable expressions; see  
https://postgr.es/m/1691374.1671659838@sss.pgh.pa.us.  That should  
be improved, but I don't think it's within the scope of this patch  
series.  
  
Patch by me; thanks to Richard Guo for review.  
  
Discussion: https://postgr.es/m/830269.1656693747@sss.pgh.pa.us  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/sql/postgres_fdw.sql
M src/backend/nodes/outfuncs.c
M src/backend/optimizer/path/equivclass.c
M src/backend/optimizer/path/joinpath.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/prep/prepjointree.c
M src/include/nodes/pathnodes.h
M src/include/optimizer/paths.h
M src/include/optimizer/planmain.h

Do assorted mop-up in the planner.

commit   : b448f1c8d83f8b65e2f0080c556ee21a7076da25    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 30 Jan 2023 13:44:36 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 30 Jan 2023 13:44:36 -0500    

Click here for diff

Remove RestrictInfo.nullable_relids, along with a good deal of  
infrastructure that calculated it.  One use-case for it was in  
join_clause_is_movable_to, but we can now replace that usage with  
a check to see if the clause's relids include any outer join  
that can null the target relation.  The other use-case was in  
join_clause_is_movable_into, but that test can just be dropped  
entirely now that the clause's relids include outer joins.  
Furthermore, join_clause_is_movable_into should now be  
accurate enough that it will accept anything returned by  
generate_join_implied_equalities, so we can restore the Assert  
that was diked out in commit 95f4e59c3.  
  
Remove the outerjoin_delayed mechanism.  We needed this before to  
prevent quals from getting evaluated below outer joins that should  
null some of their vars.  Now that we consider varnullingrels while  
placing quals, that's taken care of automatically, so throw the  
whole thing away.  
  
Teach remove_useless_result_rtes to also remove useless FromExprs.  
Having done that, the delay_upper_joins flag serves no purpose any  
more and we can remove it, largely reverting 11086f2f2.  
  
Use constant TRUE for "dummy" clauses when throwing back outer joins.  
This improves on a hack I introduced in commit 6a6522529.  If we  
have a left-join clause l.x = r.y, and a WHERE clause l.x = constant,  
we generate r.y = constant and then don't really have a need for the  
join clause.  But we must throw the join clause back anyway after  
marking it redundant, so that the join search heuristics won't think  
this is a clauseless join and avoid it.  That was a kluge introduced  
under time pressure, and after looking at it I thought of a better  
way: let's just introduce constant-TRUE "join clauses" instead,  
and get rid of them at the end.  This improves the generated plans for  
such cases by not having to test a redundant join clause.  We can also  
get rid of the ugly hack used to mark such clauses as redundant for  
selectivity estimation.  
  
Patch by me; thanks to Richard Guo for review.  
  
Discussion: https://postgr.es/m/830269.1656693747@sss.pgh.pa.us  

M contrib/postgres_fdw/postgres_fdw.c
M src/backend/optimizer/path/allpaths.c
M src/backend/optimizer/path/clausesel.c
M src/backend/optimizer/path/costsize.c
M src/backend/optimizer/path/equivclass.c
M src/backend/optimizer/path/joinrels.c
M src/backend/optimizer/path/pathkeys.c
M src/backend/optimizer/plan/analyzejoins.c
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/prep/prepjointree.c
M src/backend/optimizer/util/appendinfo.c
M src/backend/optimizer/util/inherit.c
M src/backend/optimizer/util/orclauses.c
M src/backend/optimizer/util/placeholder.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/paths.h
M src/include/optimizer/placeholder.h
M src/include/optimizer/planmain.h
M src/include/optimizer/restrictinfo.h
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Make Vars be outer-join-aware.

commit   : 2489d76c4906f4461a364ca8ad7e0751ead8aa0d    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 30 Jan 2023 13:16:20 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 30 Jan 2023 13:16:20 -0500    

Click here for diff

Traditionally we used the same Var struct to represent the value  
of a table column everywhere in parse and plan trees.  This choice  
predates our support for SQL outer joins, and it's really a pretty  
bad idea with outer joins, because the Var's value can depend on  
where it is in the tree: it might go to NULL above an outer join.  
So expression nodes that are equal() per equalfuncs.c might not  
represent the same value, which is a huge correctness hazard for  
the planner.  
  
To improve this, decorate Var nodes with a bitmapset showing  
which outer joins (identified by RTE indexes) may have nulled  
them at the point in the parse tree where the Var appears.  
This allows us to trust that equal() Vars represent the same value.  
A certain amount of klugery is still needed to cope with cases  
where we re-order two outer joins, but it's possible to make it  
work without sacrificing that core principle.  PlaceHolderVars  
receive similar decoration for the same reason.  
  
In the planner, we include these outer join bitmapsets into the relids  
that an expression is considered to depend on, and in consequence also  
add outer-join relids to the relids of join RelOptInfos.  This allows  
us to correctly perceive whether an expression can be calculated above  
or below a particular outer join.  
  
This change affects FDWs that want to plan foreign joins.  They *must*  
follow suit when labeling foreign joins in order to match with the  
core planner, but for many purposes (if postgres_fdw is any guide)  
they'd prefer to consider only base relations within the join.  
To support both requirements, redefine ForeignScan.fs_relids as  
base+OJ relids, and add a new field fs_base_relids that's set up by  
the core planner.  
  
Large though it is, this commit just does the minimum necessary to  
install the new mechanisms and get check-world passing again.  
Follow-up patches will perform some cleanup.  (The README additions  
and comments mention some stuff that will appear in the follow-up.)  
  
Patch by me; thanks to Richard Guo for review.  
  
Discussion: https://postgr.es/m/830269.1656693747@sss.pgh.pa.us  

M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/postgres_fdw.c
M doc/src/sgml/fdwhandler.sgml
M src/backend/commands/explain.c
M src/backend/executor/execScan.c
M src/backend/nodes/makefuncs.c
M src/backend/nodes/nodeFuncs.c
M src/backend/nodes/queryjumblefuncs.c
M src/backend/optimizer/README
M src/backend/optimizer/geqo/geqo_eval.c
M src/backend/optimizer/path/allpaths.c
M src/backend/optimizer/path/clausesel.c
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/joinpath.c
M src/backend/optimizer/path/joinrels.c
M src/backend/optimizer/path/tidpath.c
M src/backend/optimizer/plan/analyzejoins.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/plan/setrefs.c
M src/backend/optimizer/prep/prepjointree.c
M src/backend/optimizer/util/appendinfo.c
M src/backend/optimizer/util/clauses.c
M src/backend/optimizer/util/joininfo.c
M src/backend/optimizer/util/orclauses.c
M src/backend/optimizer/util/pathnode.c
M src/backend/optimizer/util/placeholder.c
M src/backend/optimizer/util/relnode.c
M src/backend/optimizer/util/restrictinfo.c
M src/backend/optimizer/util/var.c
M src/backend/parser/analyze.c
M src/backend/parser/parse_agg.c
M src/backend/parser/parse_clause.c
M src/backend/parser/parse_coerce.c
M src/backend/parser/parse_expr.c
M src/backend/parser/parse_relation.c
M src/backend/parser/parse_target.c
M src/backend/rewrite/rewriteManip.c
M src/backend/utils/adt/selfuncs.c
M src/include/catalog/catversion.h
M src/include/nodes/parsenodes.h
M src/include/nodes/pathnodes.h
M src/include/nodes/plannodes.h
M src/include/nodes/primnodes.h
M src/include/optimizer/optimizer.h
M src/include/optimizer/pathnode.h
M src/include/optimizer/placeholder.h
M src/include/optimizer/prep.h
M src/include/optimizer/restrictinfo.h
M src/include/parser/parse_node.h
M src/include/parser/parse_relation.h
M src/include/rewrite/rewriteManip.h
M src/test/regress/expected/aggregates.out
M src/test/regress/expected/join.out
M src/test/regress/expected/partition_join.out
M src/test/regress/sql/aggregates.sql
M src/test/regress/sql/join.sql

Doc: clarify behavior of boolean options in replication commands.

commit   : ec7e053a98f39a9e3c7e6d35f0d2e83933882399    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 30 Jan 2023 11:59:37 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 30 Jan 2023 11:59:37 -0500    

Click here for diff

defGetBoolean() allows the "value" part of "option = value"  
syntax to be omitted, in which case it's taken as "true".  
This is acknowledged in our syntax summaries for relevant commands,  
but we don't seem to have documented the actual behavior anywhere.  
Do so for CREATE/ALTER PUBLICATION/SUBSCRIPTION.  Use generic  
boilerplate text for this, with the idea that we can copy-and-paste  
it into other relevant reference pages, whenever someone gets  
around to that.  
  
Peter Smith, edited a bit by me  
  
Discussion: https://postgr.es/m/CAHut+PvwjZfdGt2R8HTXgSZft=jZKymrS8KUg31pS7zqaaWKKw@mail.gmail.com  

M doc/src/sgml/ref/alter_subscription.sgml
M doc/src/sgml/ref/create_publication.sgml
M doc/src/sgml/ref/create_subscription.sgml

Ensure that MERGE recomputes GENERATED expressions properly.

commit   : fe9e658f4d7fbc12d2b6a74c4ee90c73e53d68ef    
  
author   : Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Mon, 30 Jan 2023 10:04:57 +0000    
  
committer: Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Mon, 30 Jan 2023 10:04:57 +0000    

Click here for diff

This fixes a bug that, under some circumstances, would cause MERGE to  
fail to properly recompute expressions for GENERATED STORED columns.  
  
Formerly, ExecInitModifyTable() did not call ExecInitStoredGenerated()  
for a MERGE command, which meant that the generated expressions  
information was not computed until later, when the first merge action  
was executed. However, if the first merge action to execute was an  
UPDATE, then ExecInitStoredGenerated() could decide to skip some some  
generated columns, if the columns on which they depended were not  
updated, which was a problem if the MERGE also contained an INSERT  
action, for which no generated columns should be skipped.  
  
So fix by having ExecInitModifyTable() call ExecInitStoredGenerated()  
for MERGE, and assume that it isn't safe to skip any generated columns  
in a MERGE. Possibly that could be relaxed, by allowing some generated  
columns to be skipped for a MERGE without an INSERT action, but it's  
not clear that it's worth the effort.  
  
Noticed while investigating bug #17759. Back-patch to v15, where MERGE  
was added.  
  
Dean Rasheed, reviewed by Tom Lane.  
  
Discussion:  
  https://postgr.es/m/17759-e76d9bece1b5421c%40postgresql.org  
  https://postgr.es/m/CAEZATCXb_ezoMCcL0tzKwRGA1x0oeE%3DawTaysRfTPq%2B3wNJn8g%40mail.gmail.com  

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

Rename GUC logical_decoding_mode to logical_replication_mode.

commit   : 1e8b61735cfb1a4feb72cb9ea83db690fedbfef1    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Mon, 30 Jan 2023 08:02:08 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Mon, 30 Jan 2023 08:02:08 +0530    

Click here for diff

Rename the developer option 'logical_decoding_mode' to the more flexible  
name 'logical_replication_mode' because doing so will make it easier to  
extend this option in the future to help test other areas of logical  
replication.  
  
Currently, it is used on the publisher side to allow streaming or  
serializing each change in logical decoding. In the upcoming patch, we are  
planning to use it on the subscriber. On the subscriber, it will allow  
serializing the changes to file and notifies the parallel apply workers to  
read and apply them at the end of the transaction.  
  
We discussed exposing this parameter as a subscription option but  
it did not seem advisable since it is primarily used for testing/debugging  
and there is no other such parameter. We also discussed having separate  
GUCs for publisher and subscriber but for current testing/debugging  
requirements, one GUC is sufficient.  
  
Author: Hou Zhijie  
Reviewed-by: Peter Smith, Kuroda Hayato, Sawada Masahiko, Amit Kapila  
Discussion: https://postgr.es/m/CAD21AoAy2c=Mx=FTCs+EwUsf2kQL5MmU3N18X84k0EmCXntK4g@mail.gmail.com  
Discussion: https://postgr.es/m/CAA4eK1+wyN6zpaHUkCLorEWNx75MG0xhMwcFhvjqm2KURZEAGw@mail.gmail.com  

M doc/src/sgml/config.sgml
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/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
M src/tools/pgindent/typedefs.list

Remove unneeded volatile qualifiers from postmaster.c.

commit   : 8d2c1913ed3df9384973399deeb75fc1e55943fe    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Sat, 28 Jan 2023 14:57:31 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Sat, 28 Jan 2023 14:57:31 +1300    

Click here for diff

Several flags were marked volatile and in some cases used sig_atomic_t  
because they were accessed from signal handlers.  After commit 7389aad6,  
we can just use unqualified bool.  
  
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>  
Reviewed-by: Andres Freund <andres@anarazel.de>  
Discussion: https://postgr.es/m/CA%2BhUKGLMoeZNZY6gYdLUQmuoW_a8bKyLvtuZkd_zHcGVOfDzBA%40mail.gmail.com  

M src/backend/postmaster/postmaster.c

Minor GUC code refactoring.

commit   : e4e89eb5bbfdae30349b38344e9c604411174f6b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 27 Jan 2023 12:13:41 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 27 Jan 2023 12:13:41 -0500    

Click here for diff

Split out "ConfigOptionIsVisible" to perform the privilege  
check for GUC_SUPERUSER_ONLY GUCs (which these days can also  
be read by pg_read_all_settings role members), and move the  
should-we-show-it checks from GetConfigOptionValues to its  
sole caller.  
  
This commit also removes get_explain_guc_options's check of  
GUC_NO_SHOW_ALL, which seems to have got cargo-culted in there.  
While there's no obvious use-case for marking a GUC both  
GUC_EXPLAIN and GUC_NO_SHOW_ALL, if it were set up that way  
one would expect EXPLAIN to show it --- if that's not what  
you want, then don't set GUC_EXPLAIN.  
  
In passing, simplify the loop logic in show_all_settings.  
  
Nitin Jadhav, Bharath Rupireddy, Tom Lane  
  
Discussion: https://postgr.es/m/CAMm1aWYgfekpRK-Jz5=pM_bV+Om=ktGq1vxTZ_dr1Z6MV-qokA@mail.gmail.com  

M src/backend/utils/misc/guc.c
M src/backend/utils/misc/guc_funcs.c
M src/include/utils/guc_tables.h

Allow multiple --excludes options in pgindent

commit   : a1c4cd6f2c8857fbb78d043a0b3c7d397e48ef2e    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Fri, 27 Jan 2023 09:38:59 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Fri, 27 Jan 2023 09:38:59 -0500    

Click here for diff

This includes a unification of the logic used to find the excludes file  
and the typedefs file.  
  
Also, remove the dangerous and deprecated feature where the first  
non-option argument was taken as a typdefs file if it wasn't a .c or .h  
file, remove some extraneous blank lines, and improve the documentation  
somewhat.  

M src/tools/pgindent/pgindent
M src/tools/pgindent/pgindent.man

meson: Fix installation path computation

commit   : 8f6858064b1442f9ad057d289b0e4f018a2ad8aa    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 27 Jan 2023 10:49:17 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 27 Jan 2023 10:49:17 +0100    

Click here for diff

We have the long-standing logic to append "postgresql" to some  
installation paths if it does not already contain "pgsql" or  
"postgres".  The existing meson implementation of that only considered  
the subdirectory under the prefix, not the prefix itself.  Fix that,  
so that it now works the same way as the implementation in  
Makefile.global.  
  
Reviewed-by: Andres Freund <andres@anarazel.de>  
Discussion: https://www.postgresql.org/message-id/a6a6de12-f705-2b33-2fd9-9743277deb08@enterprisedb.com  

M meson.build

doc: Adjust a few more references to "postmaster"

commit   : 17e72ec45d313b98bd90b95bc71b4cc77c2c89c3    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 27 Jan 2023 08:42:08 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 27 Jan 2023 08:42:08 +0100    

Click here for diff

Reported-by: Karl O. Pinc <kop@karlpinc.com>  
Discussion: https://www.postgresql.org/message-id/flat/ece84b69-8f94-8b88-925f-64207cb3a2f0@enterprisedb.com  

M doc/src/sgml/runtime.sgml

Teach planner about more monotonic window functions

commit   : 456fa635a909ee36f73ca84d340521bd730f265f    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Fri, 27 Jan 2023 16:08:41 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Fri, 27 Jan 2023 16:08:41 +1300    

Click here for diff

9d9c02ccd introduced runConditions for window functions to allow  
monotonic window function evaluation to be made more efficient when the  
window function value went beyond some value that it would never go back  
from due to its monotonic nature.  That commit added prosupport functions  
to inform the planner that row_number(), rank(), dense_rank() and some  
forms of count(*) were monotonic.  Here we add support for ntile(),  
cume_dist() and percent_rank().  
  
Reviewed-by: Melanie Plageman  
Discussion: https://postgr.es/m/CAApHDvqR+VqB8s+xR-24bzJbU8xyFrBszJ17qKgECf7cWxLCaA@mail.gmail.com  

M src/backend/utils/adt/windowfuncs.c
M src/test/regress/expected/window.out
M src/test/regress/sql/window.sql

Fix behavior with pg_restore -l and compressed dumps

commit   : 783d8abc3b63267194ca21b679caf8d152b93358    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Fri, 27 Jan 2023 10:19:50 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Fri, 27 Jan 2023 10:19:50 +0900    

Click here for diff

pg_restore -l has always been able to read the TOC data of a dump even  
if its binary has no support for compression, for both compressed and  
uncompressed dumps.  5e73a60 has introduced a backward-incompatible  
behavior by switching a warning to a hard error in the code path reading  
the header data of a dump, preventing the TOC items to be listed even if  
pg_restore -l, with no support for compression, is used on a compressed  
dump.  Most modern systems should have support for zlib, but it can be  
also possible that somebody relies on the past behavior when copying  
over a dump where binaries are not built with zlib support (most likely  
some WIN32 flavors these days, though most environments should provide  
that).  
  
There is no easy way to have a regression test for this pattern, as it  
requires a mix of dump/restore commands with different compilation  
options, with and without compression.  One possibility I see here would  
be to have a command-line option that enforces a non-compression check  
for a build that supports compression, but that does not seem worth the  
cost, either.  
  
Reported-by: Justin Pryzby  
Author: Georgios Kokolatos  
Discussion: https://postgr.es/m/20230125180020.GF22427@telsasoft.com  

M src/bin/pg_dump/pg_backup_archiver.c

Improve TimestampDifferenceMilliseconds to cope with overflow sanely.

commit   : 3a28d78089289794fda86cdbd275fc4756c6c6aa    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 26 Jan 2023 17:09:12 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 26 Jan 2023 17:09:12 -0500    

Click here for diff

We'd like to use TimestampDifferenceMilliseconds with the stop_time  
possibly being TIMESTAMP_INFINITY, but up to now it's disclaimed  
responsibility for overflow cases.  Define it to clamp its output to  
the range [0, INT_MAX], handling overflow correctly.  (INT_MAX rather  
than LONG_MAX seems appropriate, because the function is already  
described as being intended for calculating wait times for WaitLatch  
et al, and that infrastructure only handles waits up to INT_MAX.  
Also, this choice gets rid of cross-platform behavioral differences.)  
  
Having done that, we can replace some ad-hoc code in walreceiver.c  
with a simple call to TimestampDifferenceMilliseconds.  
  
While at it, fix some buglets in existing callers of  
TimestampDifferenceMilliseconds: basebackup_copy.c had not read the  
memo about TimestampDifferenceMilliseconds never returning a negative  
value, and postmaster.c had not read the memo about Min() and Max()  
being macros with multiple-evaluation hazards.  Neither of these  
quite seem worth back-patching.  
  
Patch by me; thanks to Nathan Bossart for review.  
  
Discussion: https://postgr.es/m/3126727.1674759248@sss.pgh.pa.us  

M src/backend/backup/basebackup_copy.c
M src/backend/postmaster/postmaster.c
M src/backend/replication/walreceiver.c
M src/backend/utils/adt/timestamp.c

Code review for commit 05a7be935.

commit   : 24ff700f6aee2e8b915399e03934c6fe9b593d3f    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 26 Jan 2023 12:51:00 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 26 Jan 2023 12:51:00 -0500    

Click here for diff

Avoid having walreceiver code know explicitly about the precision  
and underlying datatype of TimestampTz.  (There is still one  
calculation that knows that, which should be replaced with use of  
TimestampDifferenceMilliseconds; but we need to figure out what to do  
about overflow cases first.)  
  
In support of this, provide a TimestampTzPlusSeconds macro, as well  
as TIMESTAMP_INFINITY and TIMESTAMP_MINUS_INFINITY macros.  (We could  
have used the existing DT_NOEND and DT_NOBEGIN symbols, but I judged  
those too opaque and confusing.)  
  
Move GetCurrentTimestamp calls so that it's more obvious that we  
are not using stale values of "now" anyplace.  This doesn't result  
in net more calls, and might indeed make for net fewer.  
  
Avoid having a dummy value in the WalRcvWakeupReason enum, so that  
we can hope for the compiler to catch overlooked switch cases.  
  
Nathan Bossart and Tom Lane  
  
Discussion: https://postgr.es/m/20230125235004.GA1327755@nathanxps13  

M src/backend/replication/walreceiver.c
M src/include/datatype/timestamp.h
M src/include/utils/timestamp.h

Doc: use less-awkward phrasing.

commit   : e35bb9f1582d3c2885de65a60d6b296877c7ed0e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 26 Jan 2023 11:34:17 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 26 Jan 2023 11:34:17 -0500    

Click here for diff

Improve wording in note about tools required to build  
from the source repository.  
  
Laurenz Albe, per gripe from Riivo Kolka  
  
Discussion: https://postgr.es/m/167463493588.2667301.13267758265445155872@wrigleys.postgresql.org  

M doc/src/sgml/sourcerepo.sgml

DROP ROLE regress_role_limited_admin at end of test

commit   : 14fb38626f3ff0f96144cd7535ce5feaba3a18a0    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Thu, 26 Jan 2023 08:14:41 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Thu, 26 Jan 2023 08:14:41 -0500    

Click here for diff

This is required by project policy, and I overlooked the need for  
it (again) by accident.  
  
Reported by Álvaro Herrara.  
  
Discussion: http://postgr.es/m/20230126114659.x3yuypot7p6zj73c@alvherre.pgsql  

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

commit   : 37e267335068059ac9bd4ec5d06b493afb4b73e8    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 26 Jan 2023 11:33:01 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 26 Jan 2023 11:33:01 +0100    

Click here for diff

This has long been deprecated.  Some of the build systems didn't even  
install it.  
  
Also remove man page.  
  
Reviewed-by: Karl O. Pinc <kop@karlpinc.com>  
Discussion: https://www.postgresql.org/message-id/flat/ece84b69-8f94-8b88-925f-64207cb3a2f0@enterprisedb.com  

M doc/src/sgml/ref/allfiles.sgml
D doc/src/sgml/ref/postmaster.sgml
M doc/src/sgml/reference.sgml
M src/backend/Makefile

Remove gratuitous references to postmaster program

commit   : 81266442fbcb19ec184134f0a256207f05026520    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 26 Jan 2023 10:48:32 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 26 Jan 2023 10:48:32 +0100    

Click here for diff

"postgres" has long been officially preferred over "postmaster" as the  
name of the program to invoke to run the server.  Some example scripts  
and code comments still used the latter.  Change those.  
  
Discussion: https://www.postgresql.org/message-id/flat/ece84b69-8f94-8b88-925f-64207cb3a2f0@enterprisedb.com  

M contrib/start-scripts/freebsd
M contrib/start-scripts/linux
M src/port/path.c

Revert "Add eager and lazy freezing strategies to VACUUM."

commit   : 6c6b4972664491de408670354fdbccc7c83a1c89    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 25 Jan 2023 22:22:27 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 25 Jan 2023 22:22:27 -0800    

Click here for diff

This reverts commit 4d417992613949af35530b4e8e83670c4e67e1b2.  Broad  
concerns about regressions caused by eager freezing strategy have been  
raised.  Whether or not these concerns can be worked through in any time  
frame is far from certain.  
  
Discussion: https://postgr.es/m/20230126004347.gepcmyenk2csxrri@awork3.anarazel.de  

M doc/src/sgml/config.sgml
M doc/src/sgml/maintenance.sgml
M doc/src/sgml/ref/create_table.sgml
M src/backend/access/common/reloptions.c
M src/backend/access/heap/heapam.c
M src/backend/access/heap/vacuumlazy.c
M src/backend/commands/vacuum.c
M src/backend/postmaster/autovacuum.c
M src/backend/utils/misc/guc_tables.c
M src/backend/utils/misc/postgresql.conf.sample
M src/include/commands/vacuum.h
M src/include/utils/rel.h

Clarify documentation for CLUSTER on partitioned tables.

commit   : 8b5f36bb6c16c030561d83b74b8c3270dbf48b68    
  
author   : Jeff Davis <jdavis@postgresql.org>    
date     : Wed, 25 Jan 2023 20:23:32 -0800    
  
committer: Jeff Davis <jdavis@postgresql.org>    
date     : Wed, 25 Jan 2023 20:23:32 -0800    

Click here for diff

Author: Nathan Bossart  
Discussion: https://postgr.es/m/20230114224000.GA2505377@nathanxps13  

M doc/src/sgml/ref/cluster.sgml

Make auto_explain print the query identifier in verbose mode

commit   : 9d2d9728b8d546434aade4f9667a59666588edd6    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Thu, 26 Jan 2023 12:23:16 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Thu, 26 Jan 2023 12:23:16 +0900    

Click here for diff

When auto_explain.log_verbose is on, auto_explain should print in the  
logs plans equivalent to the EXPLAIN (VERBOSE).  However, when  
compute_query_id is on, query identifiers were not showing up, being  
only handled by EXPLAIN (VERBOSE).  This brings auto_explain on par with  
EXPLAIN regarding that.  Note that like EXPLAIN, auto_explain does not  
show the query identifier when compute_query_id=regress.  
  
The change is done so as the choice of printing the query identifier is  
done in ExplainPrintPlan() rather than in ExplainOnePlan(), to avoid a  
duplication of the logic dealing with the query ID.  auto_explain is the  
only in-core caller of ExplainPrintPlan().  
  
While looking at the area, I have noticed that more consolidation  
between EXPLAIN and auto_explain would be in order for the logging of  
the plan duration and the buffer usage.  This refactoring is left as a  
future change.  
  
Author: Atsushi Torikoshi  
Reviewed-by: Justin Pryzby, Julien Rouhaud  
Discussion: https://postgr.es/m/1ea21936981f161bccfce05765c03bee@oss.nttdata.com  

M contrib/auto_explain/t/001_auto_explain.pl
M src/backend/commands/explain.c

Fix rare sharedtuplestore.c corruption.

commit   : ffcf6f4cfca5a4ce2ac7ff7e8fa17541a5a9caea    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Thu, 26 Jan 2023 14:50:07 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Thu, 26 Jan 2023 14:50:07 +1300    

Click here for diff

If the final chunk of an oversized tuple being written out to disk was  
exactly 32760 bytes, it would be corrupted due to a fencepost bug.  
  
Bug #17619.  Back-patch to 11 where the code arrived.  
  
While testing that (see test module in archives), I (tmunro) noticed  
that the per-participant page counter was not initialized to zero as it  
should have been; that wasn't a live bug when it was written since DSM  
memory was originally always zeroed, but since 14  
min_dynamic_shared_memory might be configured and it supplies non-zeroed  
memory, so that is also fixed here.  
  
Author: Dmitry Astapov <dastapov@gmail.com>  
Discussion: https://postgr.es/m/17619-0de62ceda812b8b5%40postgresql.org  

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

Revert "Rename contrib module basic_archive to basic_wal_module"

commit   : 9aeff092c05820d6a9252d7a3f8db86f71f2205f    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Thu, 26 Jan 2023 09:13:39 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Thu, 26 Jan 2023 09:13:39 +0900    

Click here for diff

This reverts commit 0ad3c60, as per feedback from Tom Lane, Robert Haas  
and Andres Freund.  The new name used for the module had little  
support.  
  
This moves back to basic_archive as module name, and we will likely use  
that as template for recovery modules, as well.  
  
Discussion: https://postgr.es/m/CA+TgmoYG5uGOp7DGFT5gzC1kKFWGjkLSj_wOQxGhfMcvVEiKGA@mail.gmail.com  

M contrib/Makefile
R100 contrib/basic_wal_module/.gitignore contrib/basic_archive/.gitignore
R055 contrib/basic_wal_module/Makefile contrib/basic_archive/Makefile
R093 contrib/basic_wal_module/basic_wal_module.c contrib/basic_archive/basic_archive.c
A contrib/basic_archive/basic_archive.conf
R100 contrib/basic_wal_module/expected/basic_wal_module.out contrib/basic_archive/expected/basic_archive.out
A contrib/basic_archive/meson.build
R100 contrib/basic_wal_module/sql/basic_wal_module.sql contrib/basic_archive/sql/basic_archive.sql
D contrib/basic_wal_module/basic_wal_module.conf
D contrib/basic_wal_module/meson.build
M contrib/meson.build
D doc/src/sgml/appendix-obsolete-basic-archive.sgml
M doc/src/sgml/appendix-obsolete.sgml
M doc/src/sgml/archive-modules.sgml
R064 doc/src/sgml/basic-wal-module.sgml doc/src/sgml/basic-archive.sgml
M doc/src/sgml/contrib.sgml
M doc/src/sgml/filelist.sgml

Doc: update VACUUM VERBOSE freezing tip.

commit   : 1a8e72bff781e869e5b5dc76fa18e3ae08181656    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 25 Jan 2023 14:31:41 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 25 Jan 2023 14:31:41 -0800    

Click here for diff

VACUUM VERBOSE/autovacuuming logging have reported on the number of  
pages frozen by VACUUM since commit d977ffd9 added that capability.  
This information is directly related to relfrozenxid advancement, so  
update an older tip from the documentation about how relfrozenxid is  
reported on by the same instrumentation code.  Now the tip directly  
mentions newly frozen pages, too.  

M doc/src/sgml/maintenance.sgml

Add eager and lazy freezing strategies to VACUUM.

commit   : 4d417992613949af35530b4e8e83670c4e67e1b2    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 25 Jan 2023 14:15:38 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 25 Jan 2023 14:15:38 -0800    

Click here for diff

Eager freezing strategy avoids large build-ups of all-visible pages.  It  
makes VACUUM trigger page-level freezing whenever doing so will enable  
the page to become all-frozen in the visibility map.  This is useful for  
tables that experience continual growth, particularly strict append-only  
tables such as pgbench's history table.  Eager freezing significantly  
improves performance stability by spreading out the cost of freezing  
over time, rather than doing most freezing during aggressive VACUUMs.  
It complements the insert autovacuum mechanism added by commit b07642db.  
  
VACUUM determines its freezing strategy based on the value of the new  
vacuum_freeze_strategy_threshold GUC (or reloption) with logged tables.  
Tables that exceed the size threshold use the eager freezing strategy.  
Unlogged tables and temp tables always use eager freezing strategy,  
since the added cost is negligible there.  Non-permanent relations won't  
incur any extra overhead in WAL written (for the obvious reason), nor in  
pages dirtied (since any extra freezing will only take place on pages  
whose PD_ALL_VISIBLE bit needed to be set either way).  
  
VACUUM uses lazy freezing strategy for logged tables that fall under the  
GUC size threshold.  Page-level freezing triggers based on the criteria  
established in commit 1de58df4, which added basic page-level freezing.  
  
Eager freezing is strictly more aggressive than lazy freezing.  Settings  
like vacuum_freeze_min_age still get applied in just the same way in  
every VACUUM, independent of the strategy in use.  The only mechanical  
difference between eager and lazy freezing strategies is that only the  
former applies its own additional criteria to trigger freezing pages.  
Note that even lazy freezing strategy will trigger freezing whenever a  
page happens to have required that an FPI be written during pruning,  
provided that the page will thereby become all-frozen in the visibility  
map afterwards (due to the FPI optimization from commit 1de58df4).  
  
The vacuum_freeze_strategy_threshold default setting is 4GB.  This is a  
relatively low setting that prioritizes performance stability.  It will  
be reviewed at the end of the Postgres 16 beta period.  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Reviewed-By: Jeff Davis <pgsql@j-davis.com>  
Reviewed-By: Andres Freund <andres@anarazel.de>  
Reviewed-By: Matthias van de Meent <boekewurm+postgres@gmail.com>  
Discussion: https://postgr.es/m/CAH2-WzkFok_6EAHuK39GaW4FjEFQsY=3J0AAd6FXk93u-Xq3Fg@mail.gmail.com  

M doc/src/sgml/config.sgml
M doc/src/sgml/maintenance.sgml
M doc/src/sgml/ref/create_table.sgml
M src/backend/access/common/reloptions.c
M src/backend/access/heap/heapam.c
M src/backend/access/heap/vacuumlazy.c
M src/backend/commands/vacuum.c
M src/backend/postmaster/autovacuum.c
M src/backend/utils/misc/guc_tables.c
M src/backend/utils/misc/postgresql.conf.sample
M src/include/commands/vacuum.h
M src/include/utils/rel.h

plpython: Stop undefining _POSIX_C_SOURCE, _XOPEN_SOURCE

commit   : 642e8821d713d75f142ef4eda14e490ba0fb810b    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Wed, 25 Jan 2023 09:59:26 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Wed, 25 Jan 2023 09:59:26 -0800    

Click here for diff

We undefined them to avoid warnings about macro redefinitions. But we haven't  
fully followed the necessary include order, since at least 147c2482542, in  
2011.  Recently the combination of the include order rules not being followed  
and undefining _POSIX_C_SOURCE started to cause a compile failure, starting  
with 03023a2664f. Undefining _POSIX_C_SOURCE hides clock_gettime(), which is  
referenced in an inline function as of 03023a2664f, whereas it was a macro  
before.  
  
After seeing some evidence that undefining _POSIX_C_SOURCE et al isn't  
required, I tried to build postgres with plpython on most of our supported  
platforms (except DragonFlyBSD and Illumos, but similar systems were tested),  
with/without the #undefines. No compiler warning / behavioral difference.  
  
The oldest supported python version, 3.2, defines _POSIX_C_SOURCE to 200112L  
ad _XOPEN_SOURCE to 600, whereas newer versions of python use 200809L/700  
respectively. As _POSIX_C_SOURCE/_XOPEN_SOURCE will default to the newer  
operating system on most platforms, it's possible that when using python 3.2  
new warnings would be emitted - but that seems acceptable.  
  
It's possible that this approach won't work on some older platforms. But  
getting rid of most of the include-order complexity seems promising, and it's  
an easily revertible patch if we end up having to go another way.  
  
Discussion: https://postgr.es/m/20230124165814.2njc7gnvubn2amh6@awork3.anarazel.de  

M src/pl/plpython/plpython.h

plpython: Avoid the need to redefine *printf macros

commit   : 23c12329a755ad9c70135463d3f067241daf1dcc    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Wed, 25 Jan 2023 09:59:26 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Wed, 25 Jan 2023 09:59:26 -0800    

Click here for diff

Until now we undefined and then redefined a lot of *printf macros due to  
worries about conflicts with Python.h macro definitions. Current Python.h  
doesn't define any *printf macros, and older versions just defined snprintf,  
vsnprintf, guarded by #if defined(MS_WIN32) && !defined(HAVE_SNPRINTF).  
  
Thus we can replace the undefine/define section with a single  
 #define HAVE_SNPRINTF 1  
  
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>  
Discussion: https://postgr.es/m/20230124165814.2njc7gnvubn2amh6@awork3.anarazel.de  

M src/pl/plpython/plpython.h

Avoid type cheats for invalid dsa_handles and dshash_table_handles.

commit   : 3b4ac33254e1291f0b3c94f1cb770137c418ce2e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 25 Jan 2023 11:48:38 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 25 Jan 2023 11:48:38 -0500    

Click here for diff

Invent separate macros for "invalid" values of these types, so that  
we needn't embed knowledge of their representations into calling code.  
These are all zeroes anyway ATM, so this is not fixing any live bug,  
but it makes the code cleaner and more future-proof.  
  
I (tgl) also chose to move DSM_HANDLE_INVALID into dsm_impl.h,  
since it seems like it should live beside the typedef for dsm_handle.  
  
Hou Zhijie, Nathan Bossart, Kyotaro Horiguchi, Tom Lane  
  
Discussion: https://postgr.es/m/OS0PR01MB5716860B1454C34E5B179B6694C99@OS0PR01MB5716.jpnprd01.prod.outlook.com  

M src/backend/replication/logical/launcher.c
M src/backend/storage/ipc/dsm.c
M src/backend/utils/mmgr/dsa.c
M src/include/lib/dshash.h
M src/include/storage/dsm.h
M src/include/storage/dsm_impl.h
M src/include/utils/dsa.h

doc: Fix network_ops -> inet_ops in SpGiST operator class list

commit   : d7c4830abb1867ca4fb83add2a5fac558f778b6a    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Wed, 25 Jan 2023 20:00:36 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Wed, 25 Jan 2023 20:00:36 +0900    

Click here for diff

network_ops is an opclass family of SpGiST, and the opclass able to  
work on the inet type is named inet_ops.  
  
Oversight in 7a1cd52, that reworked the design of the table listing all  
the operators available.  
  
Reported-by: Laurence Parry  
Reviewed-by: Tom Lane, David G. Johnston  
Discussion: https://postgr.es/m/167458110639.2667300.14741268666497110766@wrigleys.postgresql.org  
Backpatch-through: 14  

M doc/src/sgml/spgist.sgml

Rename contrib module basic_archive to basic_wal_module

commit   : 0ad3c60caf5f77edfefaf8850fbba5ea4fe28640    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Wed, 25 Jan 2023 14:36:51 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Wed, 25 Jan 2023 14:36:51 +0900    

Click here for diff

This rename is in preparation for the introduction of recovery modules,  
where basic_wal_module will be used as a base template for the set of  
callbacks introduced.  The former name did not really reflect all that.  
  
Author: Nathan Bossart  
Discussion: https://postgr.es/m/20221227192449.GA3672473@nathanxps13  

M contrib/Makefile
D contrib/basic_archive/basic_archive.conf
D contrib/basic_archive/meson.build
R100 contrib/basic_archive/.gitignore contrib/basic_wal_module/.gitignore
R055 contrib/basic_archive/Makefile contrib/basic_wal_module/Makefile
R093 contrib/basic_archive/basic_archive.c contrib/basic_wal_module/basic_wal_module.c
A contrib/basic_wal_module/basic_wal_module.conf
R100 contrib/basic_archive/expected/basic_archive.out contrib/basic_wal_module/expected/basic_wal_module.out
A contrib/basic_wal_module/meson.build
R100 contrib/basic_archive/sql/basic_archive.sql contrib/basic_wal_module/sql/basic_wal_module.sql
M contrib/meson.build
A doc/src/sgml/appendix-obsolete-basic-archive.sgml
M doc/src/sgml/appendix-obsolete.sgml
M doc/src/sgml/archive-modules.sgml
R064 doc/src/sgml/basic-archive.sgml doc/src/sgml/basic-wal-module.sgml
M doc/src/sgml/contrib.sgml
M doc/src/sgml/filelist.sgml

Process pending postmaster work before connections.

commit   : 239b1753421ccbd52f4f628a9265c3034d38b80f    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Wed, 25 Jan 2023 14:28:01 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Wed, 25 Jan 2023 14:28:01 +1300    

Click here for diff

Modify the new event loop code from commit 7389aad6 so that it checks  
for work requested by signal handlers even if it doesn't see a latch  
event yet.  
  
This gives priority to shutdown and reload requests where the latch will  
be reported later in the event array, or in a later call to  
WaitEventSetWait(), due to scheduling details.  In particular, this  
guarantees that a SIGHUP-then-connect sequence (as seen in  
authentication tests) causes the postmaster to process the reload before  
accepting the connection.  If the WaitEventSetWait() call saw the socket  
as ready, and the reload signal was generated before the connection,  
then the latest time the signal handler should be able to run is after  
poll/epoll_wait/kevent returns but before we check the  
pending_pm_reload_request flag.  
  
While here, also shift the handling of child exit below reload requests,  
per Tom Lane's observation that that might start new processes, so we  
should make sure we pick up new settings first.  
  
This probably explains the one-off failure of build farm animal  
malleefowl.  
  
Reported-by: Hou Zhijie <houzj.fnst@fujitsu.com>  
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>  
Discussion: https://postgr.es/m/OS0PR01MB57163D3BF2AB42ECAA94E5C394C29%40OS0PR01MB5716.jpnprd01.prod.outlook.com  

M src/backend/postmaster/postmaster.c

Update more obsolete multixact.c comments.

commit   : 8f8f11593258d04e9a58365865f7daf123e24bb1    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Tue, 24 Jan 2023 15:15:33 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Tue, 24 Jan 2023 15:15:33 -0800    

Click here for diff

Update some remaining comments in multixact.c that still described SLRU  
truncation as happening in the checkpointer, rather than during VACUUM.  
  
Follow-up to commit 5212d447.  
  
Shi yu, with tweaks by me.  
  
Author: Shi yu <shiy.fnst@fujitsu.com>  
Discussion: https://postgr.es/m/OSZPR01MB631066BF246F8F74E83222FCFDC69@OSZPR01MB6310.jpnprd01.prod.outlook.com  

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

Improve exclude pattern file processing in pgindent

commit   : 1249371632db9d97786edfb3d58c3e89e75b9519    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Tue, 24 Jan 2023 16:04:21 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Tue, 24 Jan 2023 16:04:21 -0500    

Click here for diff

This makes two small changes that will improve pgindent's usefulness in  
a git hook. First, it looks for the exclude file relative to the current  
directory. And second, it applies the filters to filenames given on the  
command line as well as those found in a directory sweep.  
  
It might prove necessary to make further efforts to find the exclude  
file, and even to allow multiple exclude files, but for now this should  
be enough for most purposes.  
  
Reviewed by Jelte Fennema  

M src/tools/pgindent/pgindent

Adjust interaction of CREATEROLE with role properties.

commit   : f1358ca52dd7b8cedd29c6f2f8c163914f03ea2e    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Tue, 24 Jan 2023 10:57:09 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Tue, 24 Jan 2023 10:57:09 -0500    

Click here for diff

Previously, a CREATEROLE user without SUPERUSER could not alter  
REPLICATION users in any way, and could not set the BYPASSRLS  
attribute. However, they could manipulate the CREATEDB property  
even if they themselves did not possess it.  
  
With this change, a CREATEROLE user without SUPERUSER can set or  
clear the REPLICATION, BYPASSRLS, or CREATEDB property on a new  
role or a role that they have rights to manage if and only if  
that property is set for their own role.  
  
This implements the standard idea that you can't give permissions  
you don't have (but you can give the ones you do have). We might  
in the future want to provide more powerful ways to constrain  
what a CREATEROLE user can do - for example, to limit whether  
CONNECTION LIMIT can be set or the values to which it can be set -  
but that is left as future work.  
  
Patch by me, reviewed by Nathan Bossart, Tushar Ahuja, and Neha  
Sharma.  
  
Discussion: http://postgr.es/m/CA+TgmobX=LHg_J5aT=0pi9gJy=JdtrUVGAu0zhr-i5v5nNbJDg@mail.gmail.com  

M doc/src/sgml/ref/alter_role.sgml
M doc/src/sgml/ref/create_role.sgml
M src/backend/commands/dbcommands.c
M src/backend/commands/user.c
M src/include/commands/dbcommands.h
M src/test/regress/expected/create_role.out
M src/test/regress/sql/create_role.sql

Fix the Drop Database hang.

commit   : 6c6d6ba3ee2c160b53f727cf8e612014b316d6e4    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Tue, 24 Jan 2023 09:25:36 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Tue, 24 Jan 2023 09:25:36 +0530    

Click here for diff

The drop database command waits for the logical replication sync worker to  
accept ProcSignalBarrier and the worker's slot creation waits for the drop  
database to finish which leads to a deadlock. This happens because the  
tablesync worker holds interrupts while creating a slot.  
  
We prevent cancel/die interrupts while creating a slot in the table sync  
worker because it is possible that before the server finishes this  
command, a concurrent drop subscription happens which would complete  
without removing this slot and that leads to the slot existing until the  
end of walsender. However, the slot will eventually get dropped at the  
walsender exit time, so there is no danger of the dangling slot.  
  
This patch reallows cancel/die interrupts while creating a slot and  
modifies the test to wait for slots to become zero to prevent finding an  
ephemeral slot.  
  
The reported hang doesn't happen in PG14 as the drop database starts to  
wait for ProcSignalBarrier with PG15 (commits 4eb2176318 and e2f65f4255)  
but it is good to backpatch this till PG14 as it is not a good idea to  
prevent interrupts during a network call that could block indefinitely.  
  
Reported-by: Lakshmi Narayanan Sreethar  
Diagnosed-by: Andres Freund  
Author: Hou Zhijie  
Reviewed-by: Vignesh C, Amit Kapila  
Backpatch-through: 14, where it was introduced in commit 6b67d72b60  
Discussion: https://postgr.es/m/CA+kvmZELXQ4ZD3U=XCXuG3KvFgkuPoN1QrEj8c-rMRodrLOnsg@mail.gmail.com  

M src/backend/replication/logical/tablesync.c
M src/test/subscription/t/004_sync.pl

libpqwalreceiver: Convert to libpq-be-fe-helpers.h

commit   : 728f86fec65537eade8d9e751961782ddb527934    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Mon, 23 Jan 2023 19:25:23 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Mon, 23 Jan 2023 19:25:23 -0800    

Click here for diff

In contrast to the changes to dblink and postgres_fdw, this does not fix a  
bug, as libpqwalreceiver did already process interrupts.  
  
Besides reducing code duplication, the conversion leads to libpqwalreceiver  
now using reserving file descriptors for libpq connections. While not strictly  
required for the use in walreceiver, we are also using libpqwalreceiver for  
logical replication, where it does seem more important.  
  
Even if we eventually decide to backpatch the prior commits, there'd be no  
need to backpatch this commit, due to not fixing an active bug.  
  
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>  
Discussion: https://postgr.es/m/20220925232237.p6uskba2dw6fnwj2@awork3.anarazel.de  

M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c

commit   : e4602483e95bebd4da31e4ea95dc5c7f715c1e4f    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Mon, 23 Jan 2023 19:25:23 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Mon, 23 Jan 2023 19:25:23 -0800    

Click here for diff

Until now dblink and postgres_fdw did not process interrupts during connection  
establishment. Besides preventing query cancellations etc, this can lead to  
undetected deadlocks, as global barriers are not processed.  
  
These aforementioned undetected deadlocks are the reason for the spate of CI  
test failures in the FreeBSD 'test_running' step.  
  
Fix the bug by using the helper from libpq-be-fe-helpers.h, introduced in a  
prior commit. Besides fixing the bug, this also removes duplicated code  
around reserving file descriptors.  
  
As the change is relatively large and there are no field reports of the  
problem, don't backpatch for now.  
  
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>  
Discussion: https://postgr.es/m/20220925232237.p6uskba2dw6fnwj2@awork3.anarazel.de  
Backpatch:  

M contrib/dblink/dblink.c
M contrib/postgres_fdw/connection.c

Add helper library for use of libpq inside the server environment

commit   : 28a591711d505f1f64c4f2eff5873ca2de0abede    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Mon, 23 Jan 2023 19:25:23 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Mon, 23 Jan 2023 19:25:23 -0800    

Click here for diff

Currently dblink and postgres_fdw don't process interrupts during connection  
establishment. Besides preventing query cancellations etc, this can lead to  
undetected deadlocks, as global barriers are not processed.  
  
Libpqwalreceiver in contrast, processes interrupts during connection  
establishment. The required code is not trivial, so duplicating it into  
additional places does not seem like a good option.  
  
These aforementioned undetected deadlocks are the reason for the spate of CI  
test failures in the FreeBSD 'test_running' step.  
  
For now the helper library is just a header, as it needs to be linked into  
each extension using libpq, and it seems too small to be worth adding a  
dedicated static library for.  
  
The conversion to the helper are done in subsequent commits.  
  
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>  
Discussion: https://postgr.es/m/20220925232237.p6uskba2dw6fnwj2@awork3.anarazel.de  

A src/include/libpq/libpq-be-fe-helpers.h

Fix error handling in libpqrcv_connect()

commit   : bc54ef4ec25a3c642f1706a49f979b7750a2817e    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Mon, 23 Jan 2023 18:04:02 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Mon, 23 Jan 2023 18:04:02 -0800    

Click here for diff

When libpqrcv_connect (also known as walrcv_connect()) failed, it leaked the  
libpq connection. In most paths that's fairly harmless, as the calling process  
will exit soon after. But e.g. CREATE SUBSCRIPTION could lead to a somewhat  
longer lived leak.  
  
Fix by releasing resources, including the libpq connection, on error.  
  
Add a test exercising the error code path. To make it reliable and safe, the  
test tries to connect to port=-1, which happens to fail during connection  
establishment, rather than during connection string parsing.  
  
Reviewed-by: Noah Misch <noah@leadboat.com>  
Discussion: https://postgr.es/m/20230121011237.q52apbvlarfv6jm6@awork3.anarazel.de  
Backpatch: 11-  

M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/test/regress/expected/subscription.out
M src/test/regress/sql/subscription.sql

Use OFFSET 0 instead of ORDER BY to stop subquery pullup

commit   : 9567686ec834e50ab10ae872a8394c9a9e590b0d    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Tue, 24 Jan 2023 13:49:10 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Tue, 24 Jan 2023 13:49:10 +1300    

Click here for diff

b762fed64 recently changed this test to prevent subquery pullup to allow  
us to test Memoize with lateral_vars.  As pointed out by Tom Lane, OFFSET  
0 is our standard way of preventing subquery pullups, so do it that way  
instead.  
  
Discussion: https://postgr.es/m/2144818.1674517061@sss.pgh.pa.us  
Backpatch-through: 14, same as b762fed64  

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

Fix LATERAL join test in test memoize.sql

commit   : b762fed6481e722a022ac2bea02151e080c31fa6    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Tue, 24 Jan 2023 12:30:30 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Tue, 24 Jan 2023 12:30:30 +1300    

Click here for diff

The test in question was meant to be testing Memoize to ensure it worked  
correctly when the inner side of the join contained lateral vars, however,  
nothing in the lateral subquery stopped it from being pulled up into the  
main query, so the planner did that, and that meant no more lateral vars.  
  
Here we add a simple ORDER BY to stop the planner from being able to  
pullup the lateral subquery.  
  
Author: Richard Guo  
Discussion: https://postgr.es/m/CAMbWs4_LHJaN4L-tXpKMiPFnsCJWU1P8Xh59o0W7AA6UN99=cQ@mail.gmail.com  
Backpatch-through: 14, where Memoize was added.  

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

Fix XLogPageRead() comment

commit   : 8dd43894b1f5c0148dd36308fc607bfcc909e5bd    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 23 Jan 2023 21:46:30 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 23 Jan 2023 21:46:30 +0100    

Click here for diff

7fcbf6a and 2ff6555 changed the function signature of XLogPageRead()  
but did not update the comment.  
  
XLogReaderRoutine contains up to date information about the API, so no  
need to repeat all that at XLogPageRead(), but fix the mentions of the  
no longer existing function arguments.  

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

Add non-decimal integer support to type numeric.

commit   : 6dfacbf72b53b775e8442a7fd2fca7c24b139773    
  
author   : Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Mon, 23 Jan 2023 19:21:22 +0000    
  
committer: Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Mon, 23 Jan 2023 19:21:22 +0000    

Click here for diff

This enhances the numeric type input function, adding support for  
hexadecimal, octal, and binary integers of any size, up to the limits  
of the numeric type.  
  
Since 6fcda9aba8, such non-decimal integers have been accepted by the  
parser as integer literals and passed through to numeric_in(). This  
commit gives numeric_in() the ability to handle them.  
  
While at it, simplify the handling of NaN and infinities, reducing the  
number of calls to pg_strncasecmp(), and arrange for pg_strncasecmp()  
to not be called at all for regular numbers. This gives a significant  
performance improvement for decimal inputs, more than offsetting the  
small performance hit of checking for non-decimal input.  
  
Discussion: https://postgr.es/m/CAEZATCV8XShnmT9HZy25C%2Bo78CVOFmUN5EM9FRAZ5xvYTggPMg%40mail.gmail.com  

M src/backend/utils/adt/numeric.c
M src/test/regress/expected/numeric.out
M src/test/regress/expected/numerology.out
M src/test/regress/sql/numeric.sql

Fix pgindent --show-diff option.

commit   : 62e1e28bf76910ffe47ddbc5c1fade41e1a65dac    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 23 Jan 2023 13:50:49 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 23 Jan 2023 13:50:49 -0500    

Click here for diff

At least on my machine, the initial coding of this didn't actually  
work, because interpolation of "$post_fh->filename" doesn't act  
as intended.  
  
I threw in some double quotes too, just in case anybody tries  
to run this in a path containing spaces.  

M src/tools/pgindent/pgindent

Remove special outfuncs/readfuncs handling of RangeVar.catalogname.

commit   : 3cece34be842178a3c5697a58e03fb4a5d576378    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 23 Jan 2023 13:33:19 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 23 Jan 2023 13:33:19 -0500    

Click here for diff

Historically we skipped writing/reading this field, but that no  
longer works under WRITE_READ_PARSE_PLAN_TREES since we expanded  
the coverage of that option to include utility commands (787102b56).  
Remove the special case and just treat this field normally.  
  
Bump catversion out of an abundance of caution --- I do not think  
we currently ever store RangeVar nodes in the catalogs, but  
perhaps I'm wrong.  
  
Per report from Pavel Stehule.  
  
Discussion: https://postgr.es/m/CAFj8pRAYvYu-qU7-NieqRRyaQZk-yr3UjtHQ2LR62PS9M1dZMA@mail.gmail.com  

M src/include/catalog/catversion.h
M src/include/nodes/primnodes.h

Add a test using ldapbindpasswd in pg_hba.conf

commit   : a9dc7f9419e4f6cac419e195618dceac74846c83    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 23 Jan 2023 08:40:18 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 23 Jan 2023 08:40:18 -0500    

Click here for diff

This feature has not been covered in tests up to now.  
  
John Naylor and Andrew Dunstan  
  
Discussion: https://postgr.es/m/06005bfb-0fd7-9d08-e0e5-440f277b73b4@dunslane.net  

M src/test/ldap/meson.build
A src/test/ldap/t/002_bindpasswd.pl

Restructure Ldap TAP test

commit   : ee4613d2b7327512477bcf8967e28a93fd01807d    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 23 Jan 2023 08:31:37 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 23 Jan 2023 08:31:37 -0500    

Click here for diff

The code for detecting the Ldap installation and setting up a test  
server is broken out into a reusable module that can be used  for  
additional tests to be added in later patches.  
  
Discussion: https://postgr.es/m/06005bfb-0fd7-9d08-e0e5-440f277b73b4@dunslane.net  

A src/test/ldap/LdapServer.pm
M src/test/ldap/t/001_auth.pl

Add non-destructive modes to pgindent

commit   : b90f0b57474eac3980be8146f2e45f73a05c994f    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 23 Jan 2023 07:00:06 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 23 Jan 2023 07:00:06 -0500    

Click here for diff

This adds two modes of running pgindent, neither of which results in  
any changes being made to the source code. The --show-diff option shows  
what changes would have been made, and the --silent-diff option just  
exits with a status of 2 if any changes would be made. The second of  
these is intended for scripting use in places such as git hooks.  
  
Along the way some code cleanup is done, and a --help option is also  
added.  
  
Reviewed by Tom Lane  
  
Discussion: https://postgr.es/m/c9c9fa6d-6de6-48c2-4f8b-0fbeef026439@dunslane.net  

M src/tools/pgindent/pgindent
M src/tools/pgindent/pgindent.man

Optimise numeric division for 3 and 4 base-NBASE digit divisors.

commit   : 0aa38db56bf459d04ed58c22f7c689c0ae14e977    
  
author   : Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Mon, 23 Jan 2023 11:56:00 +0000    
  
committer: Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Mon, 23 Jan 2023 11:56:00 +0000    

Click here for diff

On platforms with 128-bit integer support, introduce a new function  
div_var_int64(), along the same lines as div_var_int() added in  
d1b307eef2 for divisors with 1 or 2 base-NBASE digits, and use it to  
speed up div_var() and div_var_fast() in a similar way when the  
divisor has 3 or 4 base-NBASE digits.  
  
This gives significant performance gains for divisors with 9-16  
decimal digits.  
  
Joel Jacobson.  
  
Discussion:  
  https://postgr.es/m/b7a5893d-af18-4c0b-8918-96de5f1bbf39%40app.fastmail.com  
  https://postgr.es/m/CAEZATCXGm%3DDyTq%3DFrcOqC0gPMVveKUYTaD5KRRoajrUTiWxVMw%40mail.gmail.com  

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

Run pgindent on heapam.c

commit   : 009dbdea02d74c72db2d1a57d5299f94f91fa975    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Mon, 23 Jan 2023 23:08:38 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Mon, 23 Jan 2023 23:08:38 +1300    

Click here for diff

An upcoming patch by Melanie Plageman does some refactoring work in this  
area.  Run pgindent on that file now before making any changes so that  
it's easier to maintain/evolve each of the individual patches doing the  
refactor work.  Additionally, add a few new required typedefs to the list  
to make it easier to do future pgindent runs on this file during the  
refactor work.  
  
Discussion: https://postgr.es/m/CAAKRu_YSOnhKsDyFcqJsKtBSrd32DP-jjXmv7hL0BPD-z0TGXQ@mail.gmail.com  

M src/backend/access/heap/heapam.c
M src/tools/pgindent/typedefs.list

Fix and clarify function comment on LogicalTapeSetCreate.

commit   : 236f1ea84c4ca6a29d790fac4b48eba12a74443c    
  
author   : Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 23 Jan 2023 11:56:43 +0200    
  
committer: Heikki Linnakangas <heikki.linnakangas@iki.fi>    
date     : Mon, 23 Jan 2023 11:56:43 +0200    

Click here for diff

Commit c4649cce39 removed the "shared" and "ntapes" arguments, but the  
comment still talked about "shared". It also talked about "a shared  
file handle", which was technically correct because even before commit  
c4649cce39, the "shared file handle" referred to the "fileset"  
argument, not "shared". But it was very confusing. Improve the  
comment.  
  
Also add a comment on what the "preallocate" argument does.  
  
Backpatch to v15, just to make backpatching other patches easier in  
the future.  
  
Discussion: https://www.postgresql.org/message-id/af989685-91d5-aad4-8f60-1d066b5ec309@enterprisedb.com  
Reviewed-by: Peter Eisentraut  

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

Harden new parallel string_agg/array_agg regression test

commit   : 67c5b8840fcad07eeecd9af517b9b1ff09a3cf8e    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Mon, 23 Jan 2023 21:31:46 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Mon, 23 Jan 2023 21:31:46 +1300    

Click here for diff

Per buildfarm member mandrill, it seems that  
max_parallel_workers_per_gather may not always be set to the default value  
of 2 when the new test added in 16fd03e95 is executed.  Here let's just  
explicitly set that to 2 so that the planner never opts to use more than  
that many parallel workers.  

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

pg_walinspect: Add pg_get_wal_fpi_info()

commit   : c31cf1c03d01ce86f20bef8c980fe56a257b3b4b    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Mon, 23 Jan 2023 13:55:18 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Mon, 23 Jan 2023 13:55:18 +0900    

Click here for diff

This function is able to extract the full page images from a range of  
records, specified as of input arguments start_lsn and end_lsn.  Like  
the other functions of this module, an error is returned if using LSNs  
that do not reflect real system values.  All the FPIs stored in a single  
record are extracted.  
  
The module's version is bumped to 1.1.  
  
Author: Bharath Rupireddy  
Reviewed-by: Bertrand Drouvot  
Discussion: https://postgr.es/m/CALj2ACVCcvzd7WiWvD=6_7NBvVB_r6G0EGSxL4F8vosAi6Se4g@mail.gmail.com  

M contrib/pg_walinspect/Makefile
M contrib/pg_walinspect/expected/pg_walinspect.out
M contrib/pg_walinspect/meson.build
A contrib/pg_walinspect/pg_walinspect–1.0–1.1.sql
M contrib/pg_walinspect/pg_walinspect.c
M contrib/pg_walinspect/pg_walinspect.control
M contrib/pg_walinspect/sql/pg_walinspect.sql
M doc/src/sgml/pgwalinspect.sgml

Allow parallel aggregate on string_agg and array_agg

commit   : 16fd03e956540d1b47b743f6a84f37c54ac93dd4    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Mon, 23 Jan 2023 17:35:01 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Mon, 23 Jan 2023 17:35:01 +1300    

Click here for diff

This adds combine, serial and deserial functions for the array_agg() and  
string_agg() aggregate functions, thus allowing these aggregates to  
partake in partial aggregations.  This allows both parallel aggregation to  
take place when these aggregates are present and also allows additional  
partition-wise aggregation plan shapes to include plans that require  
additional aggregation once the partially aggregated results from the  
partitions have been combined.  
  
Author: David Rowley  
Reviewed-by: Andres Freund, Tomas Vondra, Stephen Frost, Tom Lane  
Discussion: https://postgr.es/m/CAKJS1f9sx_6GTcvd6TMuZnNtCh0VhBzhX6FZqw17TgVFH-ga_A@mail.gmail.com  

M doc/src/sgml/func.sgml
M src/backend/optimizer/prep/prepagg.c
M src/backend/parser/parse_agg.c
M src/backend/utils/adt/array_userfuncs.c
M src/backend/utils/adt/arrayfuncs.c
M src/backend/utils/adt/varlena.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_aggregate.dat
M src/include/catalog/pg_proc.dat
M src/include/parser/parse_agg.h
M src/include/utils/array.h
M src/test/regress/expected/aggregates.out
M src/test/regress/sql/aggregates.sql

Track logrep apply workers' last start times to avoid useless waits.

commit   : 5a3a95385bd5a8f1a4fd50545b7efe9338581899    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 22 Jan 2023 14:08:46 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 22 Jan 2023 14:08:46 -0500    

Click here for diff

Enforce wal_retrieve_retry_interval on a per-subscription basis,  
rather than globally, and arrange to skip that delay in case of  
an intentional worker exit.  This probably makes little difference  
in the field, where apply workers wouldn't be restarted often;  
but it has a significant impact on the runtime of our logical  
replication regression tests (even though those tests use  
artificially-small wal_retrieve_retry_interval settings already).  
  
Nathan Bossart, with mostly-cosmetic editorialization by me  
  
Discussion: https://postgr.es/m/20221122004119.GA132961@nathanxps13  

M doc/src/sgml/config.sgml
M doc/src/sgml/monitoring.sgml
M src/backend/commands/subscriptioncmds.c
M src/backend/replication/logical/launcher.c
M src/backend/replication/logical/tablesync.c
M src/backend/replication/logical/worker.c
M src/backend/storage/lmgr/lwlock.c
M src/include/replication/logicallauncher.h
M src/include/storage/lwlock.h

Allow REPLICA IDENTITY to be set on an index that's not (yet) valid.

commit   : c9f7f926484d69e2806e35343af7e472fadfede7    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 21 Jan 2023 13:10:29 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 21 Jan 2023 13:10:29 -0500    

Click here for diff

The motivation for this change is that when pg_dump dumps a  
partitioned index that's marked REPLICA IDENTITY, it generates a  
command sequence that applies REPLICA IDENTITY before the partitioned  
index has been marked valid, causing restore to fail.  We could  
perhaps change pg_dump to not do it like that, but that would be  
difficult and would not fix existing dump files with the problem.  
There seems to be very little reason for the backend to disallow  
this anyway --- the code ignores indisreplident when the index  
isn't valid --- so instead let's fix it by allowing the case.  
  
Commit 9511fb37a previously expressed a concern that allowing  
indisreplident to be set on invalid indexes might allow us to  
wind up in a situation where a table could have indisreplident  
set on multiple indexes.  I'm not sure I follow that concern  
exactly, but in any case the only way that could happen is because  
relation_mark_replica_identity is too trusting about the existing set  
of markings being valid.  Let's just rip out its early-exit code path  
(which sure looks like premature optimization anyway; what are we  
doing expending code to make redundant ALTER TABLE ... REPLICA  
IDENTITY commands marginally faster and not-redundant ones marginally  
slower?) and fix it to positively guarantee that no more than one  
index is marked indisreplident.  
  
The pg_dump failure can be demonstrated in all supported branches,  
so back-patch all the way.  I chose to back-patch 9511fb37a as well,  
just to keep indisreplident handling the same in all branches.  
  
Per bug #17756 from Sergey Belyashov.  
  
Discussion: https://postgr.es/m/17756-dd50e8e0c8dd4a40@postgresql.org  

M src/backend/catalog/index.c
M src/backend/commands/tablecmds.c
M src/test/regress/expected/replica_identity.out
M src/test/regress/sql/replica_identity.sql

Reject CancelRequestPacket having unexpected length.

commit   : e52daaabf8f1bf8096b0c105e2f719d9c68be3fa    
  
author   : Noah Misch <noah@leadboat.com>    
date     : Sat, 21 Jan 2023 06:08:00 -0800    
  
committer: Noah Misch <noah@leadboat.com>    
date     : Sat, 21 Jan 2023 06:08:00 -0800    

Click here for diff

When the length was too short, the server read outside the allocation.  
That yielded the same log noise as sending the correct length with  
(backendPID,cancelAuthCode) matching nothing.  Change to a message about  
the unexpected length.  Given the attacker's lack of control over the  
memory layout and the general lack of diversity in memory layouts at the  
code in question, we doubt a would-be attacker could cause a segfault.  
Hence, while the report arrived via security@postgresql.org, this is not  
a vulnerability.  Back-patch to v11 (all supported versions).  
  
Andrey Borodin, reviewed by Tom Lane.  Reported by Andrey Borodin.  

M src/backend/postmaster/postmaster.c

instr_time: Represent time as an int64 on all platforms

commit   : 03023a2664f8950ad522385ff75ce004bc932a7c    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Fri, 20 Jan 2023 21:16:47 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Fri, 20 Jan 2023 21:16:47 -0800    

Click here for diff

Until now we used struct timespec for instr_time on all platforms but  
windows. Using struct timespec causes a fair bit of memory (struct timeval is  
16 bytes) and runtime overhead (much more complicated additions). Instead we  
can convert the time to nanoseconds in INSTR_TIME_SET_CURRENT(), making the  
remaining operations cheaper.  
  
Representing time as int64 nanoseconds provides sufficient range, ~292 years  
relative to a starting point (depending on clock source, relative to the unix  
epoch or the system's boot time). That'd not be sufficient for calendar time  
stored on disk, but is plenty for runtime interval time measurement.  
  
On windows instr_time already is represented as cycles. It might make sense to  
represent time as cycles on other platforms as well, as using cycle  
acquisition instructions like rdtsc directly can reduce the overhead of time  
acquisition substantially. This could be done in a fairly localized manner as  
the code stands after this commit.  
  
Because the windows and non-windows paths are now more similar, use a common  
set of macros. To make that possible, most of the use of LARGE_INTEGER had to  
be removed, which looks nicer anyway.  
  
To avoid users of the API relying on the integer representation, we wrap the  
64bit integer inside struct struct instr_time.  
  
Author: Andres Freund <andres@anarazel.de>  
Author: Lukas Fittl <lukas@fittl.com>  
Author: David Geier <geidav.pg@gmail.com>  
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>  
Discussion: https://postgr.es/m/20230113195547.k4nlrmawpijqwlsa@awork3.anarazel.de  

M src/include/portability/instr_time.h

Zero initialize uses of instr_time about to trigger compiler warnings

commit   : 25b2aba0c3a501e2af9579f1b629f155544935db    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Fri, 20 Jan 2023 21:16:47 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Fri, 20 Jan 2023 21:16:47 -0800    

Click here for diff

These are all not necessary from a correctness POV. However, in the near  
future instr_time will be simplified to an int64, at which point gcc would  
otherwise start to warn about the changed places.  
  
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>  
Discussion: https://postgr.es/m/20230116023639.rn36vf6ajqmfciua@awork3.anarazel.de  

M src/backend/access/transam/xlog.c
M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/file/buffile.c
M src/backend/storage/ipc/latch.c
M src/bin/psql/common.c

Rework format of comments in headers for nodes

commit   : 5d29d525ffe028fdf6b2d3ff7502243e56c6c79a    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Sat, 21 Jan 2023 12:17:02 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Sat, 21 Jan 2023 12:17:02 +0900    

Click here for diff

This is similar to 835d476, except that this one is to add node  
attributes related to query jumbling and avoid long lines in the headers  
and in the node structures changed by this commit.  
  
Reviewed-by: Peter Eisentraut  
Discussion: https://postgr.es/m/Y5BHOUhX3zTH/ig6@paquier.xyz  

M src/include/nodes/parsenodes.h
M src/include/nodes/primnodes.h

Move queryjumble.c code to src/backend/nodes/

commit   : 8eba3e3f020843a7641121e778e161b58ec2e490    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Sat, 21 Jan 2023 11:48:37 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Sat, 21 Jan 2023 11:48:37 +0900    

Click here for diff

This will ease a follow-up move that will generate automatically this  
code.  The C file is renamed, for consistency with the node-related  
files whose code are generated by gen_node_support.pl:  
- queryjumble.c -> queryjumblefuncs.c  
- utils/queryjumble.h -> nodes/queryjumble.h  
  
Per a suggestion from Peter Eisentraut.  
  
Reviewed-by: Peter Eisentraut  
Discussion: https://postgr.es/m/Y5BHOUhX3zTH/ig6@paquier.xyz  

M contrib/pg_stat_statements/pg_stat_statements.c
M src/backend/nodes/Makefile
M src/backend/nodes/meson.build
R099 src/backend/utils/misc/queryjumble.c src/backend/nodes/queryjumblefuncs.c
M src/backend/parser/analyze.c
M src/backend/postmaster/postmaster.c
M src/backend/utils/misc/Makefile
M src/backend/utils/misc/guc_tables.c
M src/backend/utils/misc/meson.build
R098 src/include/utils/queryjumble.h src/include/nodes/queryjumble.h
M src/include/parser/analyze.h

Bump catversion for 6e2775e4d4e47775f0d933e4a93c148024a3bc63.

commit   : 557890920dd03b5a7839e81deeb6099bd43f3b29    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Fri, 20 Jan 2023 16:37:26 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Fri, 20 Jan 2023 16:37:26 -0500    

Click here for diff

It creates a new predefined role.  

M src/include/catalog/catversion.h

Add new GUC reserved_connections.

commit   : 6e2775e4d4e47775f0d933e4a93c148024a3bc63    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Fri, 20 Jan 2023 15:36:36 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Fri, 20 Jan 2023 15:36:36 -0500    

Click here for diff

This provides a way to reserve connection slots for non-superusers.  
The slots reserved via the new GUC are available only to users who  
have the new predefined role pg_use_reserved_connections.  
superuser_reserved_connections remains as a final reserve in case  
reserved_connections has been exhausted.  
  
Patch by Nathan Bossart. Reviewed by Tushar Ahuja and by me.  
  
Discussion: http://postgr.es/m/20230119194601.GA4105788@nathanxps13  

M doc/src/sgml/config.sgml
M doc/src/sgml/user-manag.sgml
M src/backend/postmaster/postmaster.c
M src/backend/storage/lmgr/proc.c
M src/backend/utils/init/postinit.c
M src/backend/utils/misc/guc_tables.c
M src/backend/utils/misc/postgresql.conf.sample
M src/include/catalog/pg_authid.dat
M src/include/postmaster/postmaster.h
M src/include/storage/proc.h

Rename ReservedBackends variable to SuperuserReservedConnections.

commit   : fe00fec1f5d78a5cfe46ac72dc284ed4cc477be1    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Fri, 20 Jan 2023 15:32:08 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Fri, 20 Jan 2023 15:32:08 -0500    

Click here for diff

This is in preparation for adding a new reserved_connections GUC,  
but aligning the GUC name with the variable name is also a good  
idea on general principle.  
  
Patch by Nathan Bossart. Reviewed by Tushar Ahuja and by me.  
  
Discussion: http://postgr.es/m/20230119194601.GA4105788@nathanxps13  

M src/backend/postmaster/postmaster.c
M src/backend/utils/init/postinit.c
M src/backend/utils/misc/guc_tables.c
M src/include/postmaster/postmaster.h

Update docs and error message for superuser_reserved_connections.

commit   : 6c1d5ba4867828b387799a291cea9aaee2a8e3fc    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Fri, 20 Jan 2023 15:23:04 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Fri, 20 Jan 2023 15:23:04 -0500    

Click here for diff

Commit ea92368cd1da1e290f9ab8efb7f60cb7598fc310 made max_wal_senders  
a separate pool of backends from max_connections, but the documentation  
and error message for superuser_reserved_connections weren't updated  
at the time, and as a result are somewhat misleading. Update.  
  
This is arguably a back-patchable bug fix, but because it seems quite  
minor, no back-patch.  
  
Patch by Nathan Bossart. Reviewed by Tushar Ahuja and by me.  
  
Discussion: http://postgr.es/m/20230119194601.GA4105788@nathanxps13  

M doc/src/sgml/config.sgml
M src/backend/utils/init/postinit.c

Describe each contrib module in its SGML section title

commit   : e86c8b728f3c905e5993211f6fd1d107d5a4614f    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 20 Jan 2023 20:01:59 +0100    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 20 Jan 2023 20:01:59 +0100    

Click here for diff

The original titles only had the module name, which is not very useful  
when scanning the list.  By adding a very brief description to each  
title, the table of contents becomes friendlier.  
  
Also amend the introduction in the "additional modules" appendix, using  
the word "Extension" more extensively.  Nowadays, almost all contrib  
modules are extensions, so this is also helpful.  
  
Author: Karl O. Pinc <kop@karlpinc.com>  
Reviewed-by: Brar Piening <brar@gmx.de>  
Discussion: https://postgr.es/m/20230102180015.372995a9@slate.karlpinc.com  

M doc/src/sgml/adminpack.sgml
M doc/src/sgml/amcheck.sgml
M doc/src/sgml/auth-delay.sgml
M doc/src/sgml/auto-explain.sgml
M doc/src/sgml/basebackup-to-shell.sgml
M doc/src/sgml/basic-archive.sgml
M doc/src/sgml/bloom.sgml
M doc/src/sgml/btree-gin.sgml
M doc/src/sgml/btree-gist.sgml
M doc/src/sgml/citext.sgml
M doc/src/sgml/contrib-spi.sgml
M doc/src/sgml/contrib.sgml
M doc/src/sgml/cube.sgml
M doc/src/sgml/dblink.sgml
M doc/src/sgml/dict-int.sgml
M doc/src/sgml/dict-xsyn.sgml
M doc/src/sgml/earthdistance.sgml
M doc/src/sgml/file-fdw.sgml
M doc/src/sgml/fuzzystrmatch.sgml
M doc/src/sgml/hstore.sgml
M doc/src/sgml/intagg.sgml
M doc/src/sgml/intarray.sgml
M doc/src/sgml/isn.sgml
M doc/src/sgml/lo.sgml
M doc/src/sgml/ltree.sgml
M doc/src/sgml/oldsnapshot.sgml
M doc/src/sgml/pageinspect.sgml
M doc/src/sgml/passwordcheck.sgml
M doc/src/sgml/pgbuffercache.sgml
M doc/src/sgml/pgcrypto.sgml
M doc/src/sgml/pgfreespacemap.sgml
M doc/src/sgml/pgprewarm.sgml
M doc/src/sgml/pgrowlocks.sgml
M doc/src/sgml/pgstatstatements.sgml
M doc/src/sgml/pgstattuple.sgml
M doc/src/sgml/pgsurgery.sgml
M doc/src/sgml/pgtrgm.sgml
M doc/src/sgml/pgvisibility.sgml
M doc/src/sgml/pgwalinspect.sgml
M doc/src/sgml/postgres-fdw.sgml
M doc/src/sgml/seg.sgml
M doc/src/sgml/sepgsql.sgml
M doc/src/sgml/sslinfo.sgml
M doc/src/sgml/tablefunc.sgml
M doc/src/sgml/tcn.sgml
M doc/src/sgml/test-decoding.sgml
M doc/src/sgml/tsm-system-rows.sgml
M doc/src/sgml/tsm-system-time.sgml
M doc/src/sgml/unaccent.sgml
M doc/src/sgml/uuid-ossp.sgml
M doc/src/sgml/xml2.sgml

Remove SHM_QUEUE

commit   : d137cb52cb7fd44a3f24f3c750fbf7924a4e9532    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Thu, 19 Jan 2023 18:50:01 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Thu, 19 Jan 2023 18:50:01 -0800    

Click here for diff

Prior patches got rid of all the uses of SHM_QUEUE. ilist.h style lists are  
more widely used and have an easier to use interface. As there are no users  
left, remove SHM_QUEUE.  
  
Reviewed-by: Thomas Munro <thomas.munro@gmail.com> (in an older version)  
Discussion: https://postgr.es/m/20221120055930.t6kl3tyivzhlrzu2@awork3.anarazel.de  
Discussion: https://postgr.es/m/20200211042229.msv23badgqljrdg2@alap3.anarazel.de  

M src/backend/storage/ipc/Makefile
M src/backend/storage/ipc/meson.build
D src/backend/storage/ipc/shmqueue.c
M src/include/storage/shmem.h
M src/tools/pgindent/typedefs.list

Use dlists instead of SHM_QUEUE for predicate locking

commit   : 9600371764583c80f3d94957e3d16daa2661154b    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Thu, 19 Jan 2023 18:50:01 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Thu, 19 Jan 2023 18:50:01 -0800    

Click here for diff

Part of a series to remove SHM_QUEUE. ilist.h style lists are more widely used  
and have an easier to use interface.  
  
Reviewed-by: Thomas Munro <thomas.munro@gmail.com> (in an older version)  
Discussion: https://postgr.es/m/20221120055930.t6kl3tyivzhlrzu2@awork3.anarazel.de  
Discussion: https://postgr.es/m/20200211042229.msv23badgqljrdg2@alap3.anarazel.de  

M src/backend/storage/lmgr/predicate.c
M src/include/storage/predicate_internals.h

Improve the description of Output Plugin Callbacks.

commit   : 7670add9f43aeb291603c7052a2610675e1924f7    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Fri, 20 Jan 2023 08:12:19 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Fri, 20 Jan 2023 08:12:19 +0530    

Click here for diff

We were inconsistently specifying the required and optional marking for  
plugin callbacks. Additionally, this patch improves the description for  
stream_prepare callback.  
  
Author: Wang wei  
Reviewed-by: Amit Kapila  
Discussion: https://postgr.es/m/OS3PR01MB627553DAFD39ECDADD08DC909EFC9@OS3PR01MB6275.jpnprd01.prod.outlook.com  

M doc/src/sgml/logicaldecoding.sgml

Support the same patterns for pg-user in pg_ident.conf as in pg_hba.conf

commit   : efb6f4a4f9b627b9447f5cd8e955d43a7066c30c    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Fri, 20 Jan 2023 11:21:55 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Fri, 20 Jan 2023 11:21:55 +0900    

Click here for diff

While pg_hba.conf has support for non-literal username matches, and  
this commit extends the capabilities that are supported for the  
PostgreSQL user listed in an ident entry part of pg_ident.conf, with  
support for:  
1. The "all" keyword, where all the requested users are allowed.  
2. Membership checks using the + prefix.  
3. Using a regex to match against multiple roles.  
  
1. is a feature that has been requested by Jelte Fennema, 2. something  
that has been mentioned independently by Andrew Dunstan, and 3. is  
something I came up with while discussing how to extend the first one,  
whose implementation is facilitated by 8fea868.  
  
This allows matching certain system users against many different  
postgres users with a single line in pg_ident.conf.  Without this, one  
would need one line for each of the postgres users that a system user  
can log in as, which can be cumbersome to maintain.  
  
Tests are added to the TAP test of peer authentication to provide  
coverage for all that.  
  
Note that this introduces a set of backward-incompatible changes to be  
able to detect the new patterns, for the following cases:  
- A role named "all".  
- A role prefixed with '+' characters, which is something that would not  
have worked in HBA entries anyway.  
- A role prefixed by a slash character, similarly to 8fea868.  
Any of these can be still be handled by using quotes in the Postgres  
role defined in an ident entry.  
  
A huge advantage of this change is that the code applies the same checks  
for the Postgres roles in HBA and ident entries, via the common routine  
check_role().  
  
**This compatibility change should be mentioned in the release notes.**  
  
Author: Jelte Fennema  
Discussion: https://postgr.es/m/DBBPR83MB0507FEC2E8965012990A80D0F7FC9@DBBPR83MB0507.EURPRD83.prod.outlook.com  

M doc/src/sgml/client-auth.sgml
M src/backend/libpq/hba.c
M src/test/authentication/t/003_peer.pl

Avoid harmless warning from pg_dump --if-exists mode.

commit   : 74739d1d3ff6b408895a5908657ffb0648df3d70    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 19 Jan 2023 19:32:46 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 19 Jan 2023 19:32:46 -0500    

Click here for diff

If the public schema has a non-default owner (perhaps due to  
dropping and recreating it) then use of pg_dump's "--if-exists"  
option results in a warning message:  
  
warning: could not find where to insert IF EXISTS in statement "-- *not* dropping schema, since initdb creates it"  
  
This is harmless since the dump output is the same either way,  
but nonetheless it's undesirable.  It's the fault of commit  
a7a7be1f2, which created situations where a TOC entry's "defn"  
or "dropStmt" fields could be just comments.  Although that  
commit fixed up the kluges in pg_backup_archiver.c that munge defn  
strings, it missed doing so for the one that munges dropStmts.  
  
Per bug# 17753 from Justin Zhang.  
  
Discussion: https://postgr.es/m/17753-9c8773631747ee1c@postgresql.org  

M src/bin/pg_dump/pg_backup_archiver.c

Use appendStringInfoSpaces in more places

commit   : 9f1ca6ce6596f1f77adc323769f2f8303ddad14f    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Fri, 20 Jan 2023 13:07:24 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Fri, 20 Jan 2023 13:07:24 +1300    

Click here for diff

This adjusts a few places which were appending a string constant  
containing spaces onto a StringInfo.  We have appendStringInfoSpaces for  
that job, so let's use that instead.  
  
For the change to jsonb.c's add_indent() function, appendStringInfoString  
was being called inside a loop to append 4 spaces on each loop.  This  
meant that enlargeStringInfo would get called once per loop.  Here it  
should be much more efficient to get rid of the loop and just calculate  
the number of spaces with "level * 4" and just append all the spaces in  
one go.  
  
Here we additionally adjust the appendStringInfoSpaces function so it  
makes use of memset rather than a while loop to apply the required spaces  
to the StringInfo.  One of the problems with the while loop was that it  
was incrementing one variable and decrementing another variable once per  
loop.  That's more work than what's required to get the job done.  We may  
as well use memset for this rather than trying to optimize the existing  
loop.  Some testing has shown memset is faster even for very small sizes.  
  
Discussion: https://postgr.es/m/CAApHDvp_rKkvwudBKgBHniNRg67bzXVjyvVKfX0G2zS967K43A@mail.gmail.com  

M src/backend/commands/explain.c
M src/backend/utils/adt/jsonb.c
M src/common/stringinfo.c

Improve comment about GetWALAvailability's WALAVAIL_REMOVED code.

commit   : 1ca604c2018456f2da357d944e0f03c3efaeb00d    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 19 Jan 2023 18:41:08 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 19 Jan 2023 18:41:08 -0500    

Click here for diff

Sirisha Chamarthi and Kyotaro Horiguchi  
  
Discussion: https://postgr.es/m/CAKrAKeXt-=bgm=d+EDmcC9kWoikp8kbVb3LH0K3K+AGGsykpHQ@mail.gmail.com  

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

Fix ts_headline() to handle ORs and phrase queries more honestly.

commit   : 5a617d75d3b31414f378dd764a11db1a08fa79bb    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 19 Jan 2023 16:21:44 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 19 Jan 2023 16:21:44 -0500    

Click here for diff

This patch largely reverts what I did in commits c9b0c678d and  
78e73e875.  The maximum cover length limit that I added in 78e73e875  
(to band-aid over c9b0c678d's performance issues) creates too many  
user-visible behavior discrepancies, as complained of for example in  
bug #17691.  The real problem with hlCover() is not what I thought  
at the time, but more that it seems to have been designed with only  
AND tsquery semantics in mind.  It doesn't work quite right for OR,  
and even less so for NOT or phrase queries.  However, we can improve  
that situation by building a variant of TS_execute() that returns a  
list of match locations.  We already get an ExecPhraseData struct  
representing match locations for the primitive case of a simple match,  
as well as one for a phrase match; we just need to add some logic to  
combine these for AND and OR operators.  The result is a list of  
ExecPhraseDatas, which hlCover can regard as having simple AND  
semantics, so that its old algorithm works correctly.  
  
There's still a lot not to like about ts_headline's behavior, but  
I think the remaining issues have to do with the heuristics used  
in mark_hl_words and mark_hl_fragments (which, likewise, were not  
revisited when phrase search was added).  Improving those is a task  
for another day.  
  
Patch by me; thanks to Alvaro Herrera for review.  
  
Discussion: https://postgr.es/m/840.1669405935@sss.pgh.pa.us  

M src/backend/tsearch/wparser_def.c
M src/backend/utils/adt/tsvector_op.c
M src/include/tsearch/ts_utils.h
M src/test/regress/expected/tsearch.out
M src/test/regress/sql/tsearch.sql

Log the correct ending timestamp in recovery_target_xid mode.

commit   : 44e9e34266efd42901bf7b12552f2033972d70b7    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 19 Jan 2023 12:23:20 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 19 Jan 2023 12:23:20 -0500    

Click here for diff

When ending recovery based on recovery_target_xid matching with  
recovery_target_inclusive = off, we printed an incorrect timestamp  
(always 2000-01-01) in the "recovery stopping before ... transaction"  
log message.  This is a consequence of sloppy refactoring in  
c945af80c: the code to fetch recordXtime out of the commit/abort  
record used to be executed unconditionally, but it was changed  
to get called only in the RECOVERY_TARGET_TIME case.  We need only  
flip the order of operations to restore the intended behavior.  
  
Per report from Torsten Förtsch.  Back-patch to all supported  
branches.  
  
Discussion: https://postgr.es/m/CAKkG4_kUevPqbmyOfLajx7opAQk6Cvwkvx0HRcFjSPfRPTXanA@mail.gmail.com  

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

Remove some dead code in selfuncs.c

commit   : 438e6b7240905c8055f9e221187f2ac818876169    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 19 Jan 2023 12:54:15 +0100    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Thu, 19 Jan 2023 12:54:15 +0100    

Click here for diff

RelOptInfo.userid is the same for all relations in a given inheritance  
tree, so the code in examine_variable() and example_simple_variable()  
that repeats the ACL checks on the root parent rel instead of a given  
leaf child relations need not recompute userid too.  
  
Author: Amit Langote <amitlangote09@gmail.com>  
Reported-by: Justin Pryzby <pryzby@telsasoft.com>  
Discussion: https://postgr.es/m/20221210201753.GA27893@telsasoft.com  

M src/backend/optimizer/util/relnode.c
M src/backend/utils/adt/selfuncs.c

Constify proclist.h

commit   : 48880840f18cb75fcaecc77b5e7816b92c27157b    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 19 Jan 2023 09:45:34 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 19 Jan 2023 09:45:34 +0100    

Click here for diff

This is a follow-up to c8ad4d81.  
  
Author: Aleksander Alekseev  
Discussion: https://www.postgresql.org/message-id/flat/CAJ7c6TM084Ai_8%3DfZaWtULJBLtT1bgzL%3Dk9vHMYom3eyZsekAA%40mail.gmail.com  

M src/include/storage/proclist.h

doc: Fix some issues in logical replication section

commit   : 4f74f5641d53559ec44e74d5bf552e167fdd5d20    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Thu, 19 Jan 2023 14:00:23 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Thu, 19 Jan 2023 14:00:23 +0900    

Click here for diff

wal_retrieve_retry_interval was mentioned under an incorrect name, and  
wal_sender_timeout was not listed as affecting WAL senders in logical  
replication mode.  
  
Author: Takamichi Osumi  
Discussion: https://postgr.es/m/TYCPR01MB8373D65E6B0A769ED12EADCBEDC79@TYCPR01MB8373.jpnprd01.prod.outlook.com  

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

Add missing assign hook for GUC checkpoint_completion_target

commit   : 7e8a80d1fefd1e96992652ed5a628c437971c82e    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Thu, 19 Jan 2023 13:13:05 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Thu, 19 Jan 2023 13:13:05 +0900    

Click here for diff

This is wrong since 88e9823, that has switched the WAL sizing  
configuration from checkpoint_segments to min_wal_size and  
max_wal_size.  This missed the recalculation of the internal value of  
the internal "CheckPointSegments", that works as a mapping of the old  
GUC checkpoint_segments, on reload, for example, and it controls the  
timing of checkpoints depending on the volume of WAL generated.  
  
Most users tend to leave checkpoint_completion_target at 0.9 to smooth  
the I/O workload, which is why I guess this has gone unnoticed for so  
long, still it can be useful to tweak and reload the value dynamically  
in some cases to control the timing of checkpoints.  
  
Author: Bharath Rupireddy  
Discussion: https://postgr.es/m/CALj2ACXgPPAm28mruojSBno+F_=9cTOOxHAywu_dfZPeBdybQw@mail.gmail.com  
Backpatch-through: 11  

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

Fix failure with perlcritic in psql's create_help.pl

commit   : 6ba6306256a37524bbbc76402e69ef3d32d355fd    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Thu, 19 Jan 2023 10:01:53 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Thu, 19 Jan 2023 10:01:53 +0900    

Click here for diff

No buildfarm members have reported that yet, but a recently-refreshed  
Debian host did.  
  
Reviewed-by: Andrew Dunstan  
Discussion: https://postgr.es/m/Y8ey5z4Nav62g4/K@paquier.xyz  
Backpatch-through: 11  

M src/bin/psql/create_help.pl

Fix AdjustUpgrade.pm's view conversion list for --with-lz4.

commit   : a3b65fb28238fe7f4a1ae9685d39ff0c11bdb9d3    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 18 Jan 2023 16:51:40 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 18 Jan 2023 16:51:40 -0500    

Click here for diff

Turns out the compression.sql test creates a view that needs  
to be adjusted in the wake of 47bb9db75 --- except that without  
--with-lz4, it fails to create the view at all, so I'd not  
noticed this in testing.  
  
Per buildfarm member crake.  

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

Update expected/collate.windows.win1252.out for 47bb9db75.

commit   : 5ea2234670e58000c7ffde38df3bea91972bc2df    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 18 Jan 2023 15:27:29 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 18 Jan 2023 15:27:29 -0500    

Click here for diff

This delta in expected output wasn't spotted in any previous  
testing of the patch.  Reported by Andres Freund.  
  
Discussion: https://postgr.es/m/20230118195855.7yjc4mminmv7iyy5@awork3.anarazel.de  

M src/test/regress/expected/collate.windows.win1252.out

Use dlists instead of SHM_QUEUE for syncrep queue

commit   : 12605414a7d63ccbe36de2b530847bdfc9cf7447    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Wed, 18 Jan 2023 12:15:05 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Wed, 18 Jan 2023 12:15:05 -0800    

Click here for diff

Part of a series to remove SHM_QUEUE. ilist.h style lists are more widely used  
and have an easier to use interface.  
  
Reviewed-by: Thomas Munro <thomas.munro@gmail.com> (in an older version)  
Discussion: https://postgr.es/m/20221120055930.t6kl3tyivzhlrzu2@awork3.anarazel.de  
Discussion: https://postgr.es/m/20200211042229.msv23badgqljrdg2@alap3.anarazel.de  

M src/backend/replication/syncrep.c
M src/backend/replication/walsender.c
M src/backend/storage/lmgr/proc.c
M src/include/replication/walsender_private.h
M src/include/storage/proc.h

Use dlist/dclist instead of PROC_QUEUE / SHM_QUEUE for heavyweight locks

commit   : 5764f611e10b126e09e37fdffbe884c44643a6ce    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Wed, 18 Jan 2023 11:41:14 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Wed, 18 Jan 2023 11:41:14 -0800    

Click here for diff

Part of a series to remove SHM_QUEUE. ilist.h style lists are more widely used  
and have an easier to use interface.  
  
As PROC_QUEUE is now unused, remove it.  
  
Reviewed-by: Thomas Munro <thomas.munro@gmail.com> (in an older version)  
Discussion: https://postgr.es/m/20221120055930.t6kl3tyivzhlrzu2@awork3.anarazel.de  
Discussion: https://postgr.es/m/20200211042229.msv23badgqljrdg2@alap3.anarazel.de  

M src/backend/access/transam/twophase.c
M src/backend/storage/lmgr/deadlock.c
M src/backend/storage/lmgr/lock.c
M src/backend/storage/lmgr/proc.c
M src/include/storage/lock.h
M src/include/storage/proc.h
M src/tools/pgindent/typedefs.list

Add detached node functions to ilist

commit   : 51384cc40c4a72c81d2475089ab8a1cf98ea56ff    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Wed, 18 Jan 2023 11:41:14 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Wed, 18 Jan 2023 11:41:14 -0800    

Click here for diff

These allow to test whether an element is in a list by checking whether  
prev/next are NULL. Needed to replace SHMQueueIsDetached() when converting  
from SHM_QUEUE to ilist.h style lists.  
  
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>  
Discussion: https://postgr.es/m/20221120055930.t6kl3tyivzhlrzu2@awork3.anarazel.de  
Discussion: https://postgr.es/m/20200211042229.msv23badgqljrdg2@alap3.anarazel.de  

M src/include/lib/ilist.h

Fix ILIST_DEBUG build

commit   : 2b16208753770318085b1201a6d101cab2697132    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Wed, 18 Jan 2023 10:22:37 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Wed, 18 Jan 2023 10:22:37 -0800    

Click here for diff

In c8ad4d8166a dlist_member_check()'s arguments were made const. Unfortunately  
the implementation of dlist_member_check() used dlist_foreach(), which  
currently doesn't work for const lists.  
  
As a workaround, open-code the list iteration. The other check functions  
already do so.  
  
Discussion: https://postgr.es/m/20230118182214.co7dp4oahiunwg57@awork3.anarazel.de  

M src/backend/lib/ilist.c

Get rid of the "new" and "old" entries in a view's rangetable.

commit   : 47bb9db75996232ea71fc1e1888ffb0e70579b54    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 18 Jan 2023 13:23:57 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 18 Jan 2023 13:23:57 -0500    

Click here for diff

The rule system needs "old" and/or "new" pseudo-RTEs in rule actions  
that are ON INSERT/UPDATE/DELETE.  Historically it's put such entries  
into the ON SELECT rules of views as well, but those are really quite  
vestigial.  The only thing we've used them for is to carry the  
view's relid forward to AcquireExecutorLocks (so that we can  
re-lock the view to verify it hasn't changed before re-using a plan)  
and to carry its relid and permissions data forward to execution-time  
permissions checks.  What we can do instead of that is to retain  
these fields of the RTE_RELATION RTE for the view even after we  
convert it to an RTE_SUBQUERY RTE.  This requires a tiny amount of  
extra complication in the planner and AcquireExecutorLocks, but on  
the other hand we can get rid of the logic that moves that data from  
one place to another.  
  
The principal immediate benefit of doing this, aside from a small  
saving in the pg_rewrite data for views, is that these pseudo-RTEs  
no longer trigger ruleutils.c's heuristic about qualifying variable  
names when the rangetable's length is more than 1.  That results  
in quite a number of small simplifications in regression test outputs,  
which are all to the good IMO.  
  
Bump catversion because we need to dump a few more fields of  
RTE_SUBQUERY RTEs.  While those will always be zeroes anyway in  
stored rules (because we'd never populate them until query rewrite)  
they are useful for debugging, and it seems like we'd better make  
sure to transmit such RTEs accurately in plans sent to parallel  
workers.  I don't think the executor actually examines these fields  
after startup, but someday it might.  
  
This is a second attempt at committing 1b4d280ea.  The difference  
from the first time is that now we can add some filtering rules to  
AdjustUpgrade.pm to allow cross-version upgrade testing to pass  
despite all the cosmetic changes in CREATE VIEW outputs.  
  
Amit Langote (filtering rules by me)  
  
Discussion: https://postgr.es/m/CA+HiwqEf7gPN4Hn+LoZ4tP2q_Qt7n3vw7-6fJKOf92tSEnX6Gg@mail.gmail.com  
Discussion: https://postgr.es/m/891521.1673657296@sss.pgh.pa.us  

M contrib/postgres_fdw/expected/postgres_fdw.out
M src/backend/commands/lockcmds.c
M src/backend/commands/view.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/readfuncs.c
M src/backend/optimizer/plan/setrefs.c
M src/backend/parser/parse_relation.c
M src/backend/rewrite/rewriteDefine.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/utils/cache/plancache.c
M src/bin/pg_dump/t/002_pg_dump.pl
M src/include/catalog/catversion.h
M src/include/nodes/parsenodes.h
M src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
M src/test/regress/expected/aggregates.out
M src/test/regress/expected/alter_table.out
M src/test/regress/expected/collate.icu.utf8.out
M src/test/regress/expected/collate.linux.utf8.out
M src/test/regress/expected/collate.out
M src/test/regress/expected/compression.out
M src/test/regress/expected/create_view.out
M src/test/regress/expected/expressions.out
M src/test/regress/expected/groupingsets.out
M src/test/regress/expected/limit.out
M src/test/regress/expected/matview.out
M src/test/regress/expected/polymorphism.out
M src/test/regress/expected/rangefuncs.out
M src/test/regress/expected/rules.out
M src/test/regress/expected/tablesample.out
M src/test/regress/expected/triggers.out
M src/test/regress/expected/updatable_views.out
M src/test/regress/expected/window.out
M src/test/regress/expected/with.out
M src/test/regress/expected/xml.out
M src/test/regress/expected/xml_2.out

Remove redundant grouping and DISTINCT columns.

commit   : 8d83a5d0a2673174dc478e707de1f502935391a5    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 18 Jan 2023 12:37:57 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 18 Jan 2023 12:37:57 -0500    

Click here for diff

Avoid explicitly grouping by columns that we know are redundant  
for sorting, for example we need group by only one of x and y in  
	SELECT ... WHERE x = y GROUP BY x, y  
This comes up more often than you might think, as shown by the  
changes in the regression tests.  It's nearly free to detect too,  
since we are just piggybacking on the existing logic that detects  
redundant pathkeys.  (In some of the existing plans that change,  
it's visible that a sort step preceding the grouping step already  
didn't bother to sort by the redundant column, making the old plan  
a bit silly-looking.)  
  
To do this, build processed_groupClause and processed_distinctClause  
lists that omit any provably-redundant sort items, and consult those  
not the originals where relevant.  This means that within the  
planner, one should usually consult root->processed_groupClause or  
root->processed_distinctClause if one wants to know which columns  
are to be grouped on; but to check whether grouping or distinct-ing  
is happening at all, check non-NIL-ness of parse->groupClause or  
parse->distinctClause.  This is comparable to longstanding rules  
about handling the HAVING clause, so I don't think it'll be a huge  
maintenance problem.  
  
nodeAgg.c also needs minor mods, because it's now possible to generate  
AGG_PLAIN and AGG_SORTED Agg nodes with zero grouping columns.  
  
Patch by me; thanks to Richard Guo and David Rowley for review.  
  
Discussion: https://postgr.es/m/185315.1672179489@sss.pgh.pa.us  

M contrib/pg_trgm/expected/pg_trgm.out
M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/postgres_fdw.c
M src/backend/executor/nodeAgg.c
M src/backend/optimizer/path/pathkeys.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/prep/prepjointree.c
M src/include/nodes/pathnodes.h
M src/include/optimizer/paths.h
M src/test/regress/expected/aggregates.out
M src/test/regress/expected/groupingsets.out
M src/test/regress/expected/partition_aggregate.out
M src/test/regress/expected/partition_join.out
M src/test/regress/expected/select_distinct.out

Display the leader apply worker's PID for parallel apply workers.

commit   : d540a02a724b9643205abce8c5644a0f0908f6e3    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Wed, 18 Jan 2023 09:03:12 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Wed, 18 Jan 2023 09:03:12 +0530    

Click here for diff

Add leader_pid to pg_stat_subscription. leader_pid is the process ID of  
the leader apply worker if this process is a parallel apply worker. If  
this field is NULL, it indicates that the process is a leader apply  
worker or a synchronization worker. The new column makes it easier to  
distinguish parallel apply workers from other kinds of workers and helps  
to identify the leader for the parallel workers corresponding to a  
particular subscription.  
  
Additionally, update the leader_pid column in pg_stat_activity as well to  
display the PID of the leader apply worker for parallel apply workers.  
  
Author: Hou Zhijie  
Reviewed-by: Peter Smith, Sawada Masahiko, Amit Kapila, Shveta Mallik  
Discussion: https://postgr.es/m/CAA4eK1+wyN6zpaHUkCLorEWNx75MG0xhMwcFhvjqm2KURZEAGw@mail.gmail.com  

M doc/src/sgml/logical-replication.sgml
M doc/src/sgml/monitoring.sgml
M src/backend/catalog/system_views.sql
M src/backend/replication/logical/applyparallelworker.c
M src/backend/replication/logical/launcher.c
M src/backend/utils/adt/pgstatfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.dat
M src/include/replication/logicallauncher.h
M src/include/replication/worker_internal.h
M src/test/regress/expected/rules.out

Refactor code for restoring files via shell commands

commit   : 14bdb3f13de16523609d838b725540af5e23ddd3    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Wed, 18 Jan 2023 11:15:48 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Wed, 18 Jan 2023 11:15:48 +0900    

Click here for diff

Presently, restore_command uses a different code path than  
archive_cleanup_command and recovery_end_command.  These code paths  
are similar and can be easily combined, as long as it is possible to  
identify if a command should:  
- Issue a FATAL on signal.  
- Exit immediately on SIGTERM.  
  
While on it, this removes src/common/archive.c and its associated  
header.  Since the introduction of c96de2c, BuildRestoreCommand() has  
become a simple wrapper of replace_percent_placeholders() able to call  
make_native_path().  This simplifies shell_restore.c as long as  
RestoreArchivedFile() includes a call to make_native_path().  
  
Author: Nathan Bossart  
Reviewed-by: Andres Freund, Michael Paquier  
Discussion: https://postgr.es/m/20221227192449.GA3672473@nathanxps13  

M src/backend/access/transam/shell_restore.c
M src/backend/access/transam/xlogarchive.c
M src/common/Makefile
D src/common/archive.c
M src/common/meson.build
M src/fe_utils/archive.c
D src/include/common/archive.h
M src/tools/msvc/Mkvcbuild.pm

Constify the arguments of copydir.h functions

commit   : 2f31f405e1fa561db27e8dc6f7f3cb3dbd8c0c4f    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Wed, 18 Jan 2023 08:55:26 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Wed, 18 Jan 2023 08:55:26 +0900    

Click here for diff

This makes sure that the internal logic of these functions does not  
attempt to change the value of the arguments constified, and it removes  
one unconstify() in basic_archive.c.  
  
Author: Nathan Bossart  
Reviewed-by: Andrew Dunstan, Peter Eisentraut  
Discussion: https://postgr.es/m/20230114231126.GA2580330@nathanxps13  

M contrib/basic_archive/basic_archive.c
M src/backend/storage/file/copydir.c
M src/include/storage/copydir.h

Doc: fix a few oddly-spelled SGML ID attributes.

commit   : 09d465c397165f99c37e9002a4e7b281111d2580    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 17 Jan 2023 17:13:18 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 17 Jan 2023 17:13:18 -0500    

Click here for diff

Avoid use of "_" in SGML IDs.  Awhile back that was actually  
disallowed by the toolchain, as a consequence of which our convention  
has been to use "-" instead.  Fix a couple of stragglers that are  
particularly inconsistent with that convention and with related IDs.  
  
This is just neatnik-ism, so no need for back-patch.  
  
Discussion: https://postgr.es/m/769446.1673478332@sss.pgh.pa.us  

M doc/src/sgml/config.sgml
M doc/src/sgml/pgbuffercache.sgml
M doc/src/sgml/ref/pg_checksums.sgml
M doc/src/sgml/ref/prepare.sgml

meson: Add two missing regress tests

commit   : 27da598961ce443e9010c19085d17dc2b6a04d56    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Tue, 17 Jan 2023 13:49:09 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Tue, 17 Jan 2023 13:49:09 -0800    

Click here for diff

It's likely worth adding some automated way of preventing further  
omissions. We're discussing how to best do that.  
  
Reported-by: Justin Pryzby <pryzby@telsasoft.com>  
Discussion: https://postgr.es/m/20230117173509.GV9837@telsasoft.com  

M contrib/pg_stat_statements/meson.build
M src/test/modules/unsafe_tests/meson.build

AdjustUpgrade.pm should zap test_ext_cine, too.

commit   : 3a36ca03e423ad1e2c9f19cd0da5e7dedb48734e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 17 Jan 2023 16:00:39 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 17 Jan 2023 16:00:39 -0500    

Click here for diff

test_extensions' test_ext_cine extension has the same upgrade hazard  
as test_ext7: the regression test leaves it in an updated state  
from which no downgrade path to default is provided.  This causes  
the update_extensions.sql script helpfully provided by pg_upgrade  
to fail.  So drop it in cross-version-upgrade testing.  
  
Not entirely sure how come I didn't hit this in testing yesterday;  
possibly I'd built the upgrade reference databases with  
testmodules-install-check disabled.  
  
Backpatch to v10 where this module was introduced.  

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

Refactor recordExtObjInitPriv()

commit   : 2a1d7071c4ed750abb8b39436bb89c7d152bddb8    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Tue, 17 Jan 2023 20:03:35 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Tue, 17 Jan 2023 20:03:35 +0100    

Click here for diff

Instead of half a dozen of mostly-duplicate conditional branches,  
write one common one that can handle most catalogs.  We already have  
all the information we need, such as which system catalog corresponds  
to which catalog table and which column is the ACL column.  
  
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>  
Discussion: https://www.postgresql.org/message-id/flat/504bc485-6bd6-dd1b-fe10-e7351aeb310d@enterprisedb.com  

M src/backend/catalog/aclchk.c

Remove AggregateRelationId from recordExtObjInitPriv()

commit   : 13b345df6438f222daf56eee86cb272628d1f1c3    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Tue, 17 Jan 2023 20:03:35 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Tue, 17 Jan 2023 20:03:35 +0100    

Click here for diff

This was erroneous, because AggregateRelationId has no OID, so it  
cannot be part of an extension directly.  (Aggregates are registered  
via pg_proc.)  No harm in practice, but better to make it correct.  
  
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>  
Discussion: https://www.postgresql.org/message-id/flat/504bc485-6bd6-dd1b-fe10-e7351aeb310d@enterprisedb.com  

M src/backend/catalog/aclchk.c

Remove redundant relkind check

commit   : 15eb1228800a35042ef318f941173aa8b89002d1    
  
author   : John Naylor <john.naylor@postgresql.org>    
date     : Tue, 17 Jan 2023 14:25:01 +0700    
  
committer: John Naylor <john.naylor@postgresql.org>    
date     : Tue, 17 Jan 2023 14:25:01 +0700    

Click here for diff

Ranier Vilela  
  
Reviewed by Justin Pryzby  
Discussion: https://www.postgresql.org/message-id/CAEudQAp2R2fbbi0OHHhv_n4%3DCh0t1VtjObR9YMqtGKHJ%2BfaUFQ%40mail.gmail.com  

M src/bin/pg_dump/pg_dump.c

Remove dead code in formatting.c

commit   : e29c5653434ebf6a88d009746d21ca3a59ddb69b    
  
author   : John Naylor <john.naylor@postgresql.org>    
date     : Tue, 17 Jan 2023 13:52:11 +0700    
  
committer: John Naylor <john.naylor@postgresql.org>    
date     : Tue, 17 Jan 2023 13:52:11 +0700    

Click here for diff

Remove some code guarded by IS_MINUS() or IS_PLUS(), where the entire  
stanza is inside an else-block where both of these are false. This  
should slightly improve test coverage.  
  
While at it, remove coding that apparently assumes that unsetting a  
bit is so expensive that we have to first check if it's already set  
in the first place.  
  
Per Coverity report from Ranier Vilela  
Analysis and review by Justin Pryzby  
  
Discussion: https://www.postgresql.org/message-id/20221223010818.GP1153%40telsasoft.com  

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

Improve the code to decide and process the apply action.

commit   : c981d9145deae067bc67bc8f8bcd68b300ece3fe    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Tue, 17 Jan 2023 11:28:22 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Tue, 17 Jan 2023 11:28:22 +0530    

Click here for diff

The code that decides the apply action missed to handle non-transactional  
messages and we didn't catch it in our testing as currently such messages  
are simply ignored by the apply worker. This was introduced by changes in  
commit 216a784829.  
  
While testing this, I noticed that we forgot to reset stream_xid after  
processing the stream stop message which could also result in the wrong  
apply action after the fix for non-transactional messages.  
  
In passing, change assert to elog for unexpected apply action in some of  
the routines so as to catch the problems in the production environment, if  
any.  
  
Reported-by: Tomas Vondra  
Author: Amit Kapila  
Reviewed-by: Tomas Vondra, Sawada Masahiko, Hou Zhijie  
Discussion: https://postgr.es/m/984ff689-adde-9977-affe-cd6029e850be@enterprisedb.com  
Discussion: https://postgr.es/m/CAA4eK1+wyN6zpaHUkCLorEWNx75MG0xhMwcFhvjqm2KURZEAGw@mail.gmail.com  

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

Fix typo in comment.

commit   : 4f985aba6963b8669325e1c58585d04257977fda    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Tue, 17 Jan 2023 10:39:11 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Tue, 17 Jan 2023 10:39:11 +0530    

Click here for diff

Author: Osumi Takamichi  
Discussion: https://postgr.es/m/TYCPR01MB83737EA140C79B7D099F65E8EDC69@TYCPR01MB8373.jpnprd01.prod.outlook.com  

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

Track behavior of \1 in pg_ident.conf when quoted

commit   : 0b717432ff13683f9d13f007dab1c3380cae2f0d    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Tue, 17 Jan 2023 13:41:09 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Tue, 17 Jan 2023 13:41:09 +0900    

Click here for diff

Entries of pg-user in pg_ident.conf that are quoted and include '\1'  
allow a replacement from a subexpression in a system user regexp.  This  
commit adds a test to track this behavior and a note in the  
documentation, as it could be affected by the use of an AuthToken for  
the pg-user in the IdentLines parsed.  
  
This subject has come up in the discussion aimed at extending the  
support of pg-user in ident entries for more patterns.  
  
Author: Jelte Fennema  
Discussion: https://postgr.es/m/CAGECzQRNow4MwkBjgPxywXdJU_K3a9+Pm78JB7De3yQwwkTDew@mail.gmail.com  

M doc/src/sgml/client-auth.sgml
M src/test/authentication/t/003_peer.pl

Don't presort ORDER BY/DISTINCT Aggrefs with volatile functions

commit   : da5800d5fa636c6e10c9c98402d872c76aa1c8d0    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Tue, 17 Jan 2023 16:37:06 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Tue, 17 Jan 2023 16:37:06 +1300    

Click here for diff

In 1349d2790, we gave the planner the ability to provide ORDER BY/DISTINCT  
Aggrefs with presorted input so that nodeAgg would not have to perform  
sorts during execution.  That commit failed to properly consider the  
implications of if the Aggref had a volatile function in its ORDER  
BY/DISTINCT clause.  As it happened, this resulted in an ERROR about the  
volatile function being missing from the targetlist.  
  
Here, instead of adding the volatile function to the targetlist, we just  
never consider an Aggref with a volatile function in its ORDER BY/DISTINCT  
clause when choosing which Aggrefs we should sort by.  We do this as if we  
were to choose a plan which provided these aggregates with presorted  
input, then if there were many such aggregates which could all share the  
same sort order, then it may be surprising if they all shared the same  
sort sometimes and didn't at other times when some other set of aggregates  
were given presorted results.  We can avoid this inconsistency by just  
never providing these volatile function aggregates with presorted input.  
  
Reported-by: Dean Rasheed  
Discussion: https://postgr.es/m/CAEZATCWETioXs5kY8vT6BVguY41_wD962VDk=u_Nvd7S1UXzuQ@mail.gmail.com  

M src/backend/optimizer/plan/planner.c
M src/test/regress/expected/aggregates.out
M src/test/regress/sql/aggregates.sql

Create common infrastructure for cross-version upgrade testing.

commit   : 52585f8f072ac187380f7e02183e87dcf6789ff0    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 16 Jan 2023 20:35:53 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 16 Jan 2023 20:35:53 -0500    

Click here for diff

To test pg_upgrade across major PG versions, we have to be able to  
modify or drop any old objects with no-longer-supported properties,  
and we have to be able to deal with cosmetic changes in pg_dump output.  
Up to now, the buildfarm and pg_upgrade's own test infrastructure had  
separate implementations of the former, and we had nothing but very  
ad-hoc rules for the latter (including an arbitrary threshold on how  
many lines of unchecked diff were okay!).  This patch creates a Perl  
module that can be shared by both those use-cases, and adds logic  
that deals with pg_dump output diffs in a much more tightly defined  
fashion.  
  
This largely supersedes previous efforts in commits 0df9641d3,  
9814ff550, and 62be9e4cd, which developed a SQL-script-based solution  
for the task of dropping old objects.  There was nothing fundamentally  
wrong with that work in itself, but it had no basis for solving the  
output-formatting problem.  The most plausible way to deal with  
formatting is to build a Perl module that can perform editing on the  
dump files; and once we commit to that, it makes more sense for the  
same module to also embed the knowledge of what has to be done for  
dropping old objects.  
  
Back-patch versions of the helper module as far as 9.2, to  
support buildfarm animals that still test that far back.  
It's also necessary to back-patch PostgreSQL/Version.pm,  
because the new code depends on that.  I fixed up pg_upgrade's  
002_pg_upgrade.pl in v15, but did not look into back-patching  
it further than that.  
  
Tom Lane and Andrew Dunstan  
  
Discussion: https://postgr.es/m/891521.1673657296@sss.pgh.pa.us  

M src/bin/pg_upgrade/TESTING
M src/bin/pg_upgrade/t/002_pg_upgrade.pl
D src/bin/pg_upgrade/upgrade_adapt.sql
A src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm

Tighten up VACUUM's approach to setting VM bits.

commit   : 980ae173108e353045e5ab4a842bb21e9dfe6715    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Mon, 16 Jan 2023 09:34:37 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Mon, 16 Jan 2023 09:34:37 -0800    

Click here for diff

Tighten up the way that visibilitymap_set() is called: request that both  
the all-visible and all-frozen bits get set whenever the all-frozen bit  
is set, regardless of what we think we know about the present state of  
the all-visible bit.  Also make sure that the page level PD_ALL_VISIBLE  
flag is set in the same code path.  
  
In practice there doesn't seem to be a concrete scenario in which the  
previous approach could lead to inconsistencies.  It was almost possible  
in scenarios involving concurrent HOT updates from transactions that  
abort, but (unlike pruning) freezing can never remove XIDs > VACUUM's  
OldestXmin, even those from transactions that are known to have aborted.  
That was protective here.  
  
These issues have been around since commit a892234f83, which added the  
all-frozen bit to the VM fork.  There is no known live bug here, so no  
backpatch.  
  
In passing, add some defensive assertions to catch the issue, and stop  
reading the existing state of the VM when setting the VM in VACUUM's  
final heap pass.  We already know that affected pages must have had at  
least one LP_DEAD item before we set it LP_UNUSED, so there is no point  
in reading the VM when it is set like this.  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Reviewed-By: Andres Freund <andres@anarazel.de>  
Discussion: https://postgr.es/m/CAH2-WznuNGSzF8v6OsgjaC5aYsb3cZ6HW6MLm30X0d65cmSH6A@mail.gmail.com  

M src/backend/access/heap/vacuumlazy.c
M src/backend/access/heap/visibilitymap.c

Assorted improvements to SECURITY DEFINER functions documentation.

commit   : 6fa66ec88ff29f5449d89e9891a00fe64afae34e    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Mon, 16 Jan 2023 10:49:59 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Mon, 16 Jan 2023 10:49:59 -0500    

Click here for diff

Add a cross-reference from the part of the page that introdues SECURITY  
INVOKER and SECURITY DEFINER to the part of the page that talks about  
writing SECURITY DEFINER functions safely, so that users are less likely  
to miss it.  
  
Remove discussion of the pre-8.3 behavior on the theory that it's  
probably not very relevant any more, that release having gone out of  
support nearly a decade ago.  
  
Add a mention of the new createrole_self_grant GUC, which in  
certain cases might need to be set to a safe value to avoid  
unexpected consequences.  
  
Possibly this section needs major surgery rather than just these  
small tweaks, but hopefully this is at least a small step  
forward.  
  
Discussion: http://postgr.es/m/CA+Tgmoauqd1cHQjsNEoxL5O-kEO4iC9dAPyCudSvmNqPJGmy9g@mail.gmail.com  

M doc/src/sgml/ref/create_function.sgml

More documentation update for GRANT ... WITH SET OPTION.

commit   : 3cdf7502f85c9e61913e05519f88580f008b8453    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Mon, 16 Jan 2023 10:35:29 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Mon, 16 Jan 2023 10:35:29 -0500    

Click here for diff

Update the reference pages for various ALTER commands that  
mentioned that you must be a member of role that will be the  
new owner to instead say that you must be able to SET ROLE  
to the new owner. Update ddl.sgml's generate statement on this  
topic along similar lines.  
  
Likewise, update CREATE SCHEMA and CREATE DATABASE, which  
have options to specify who will own the new objects, to say  
that you must be able to SET ROLE to the role that will own  
them.  
  
Finally, update the documentation for the GRANT statement  
itself with some general principles about how the SET option  
works and how it can be used.  
  
Patch by me, reviewed (but not fully endorsed) by Noah Misch.  
  
Discussion: http://postgr.es/m/CA+TgmoZk6VB3DQ83+DO5P_HP=M9PQAh1yj-KgeV30uKefVaWDg@mail.gmail.com  

M doc/src/sgml/ddl.sgml
M doc/src/sgml/ref/alter_aggregate.sgml
M doc/src/sgml/ref/alter_collation.sgml
M doc/src/sgml/ref/alter_conversion.sgml
M doc/src/sgml/ref/alter_database.sgml
M doc/src/sgml/ref/alter_domain.sgml
M doc/src/sgml/ref/alter_foreign_table.sgml
M doc/src/sgml/ref/alter_function.sgml
M doc/src/sgml/ref/alter_large_object.sgml
M doc/src/sgml/ref/alter_materialized_view.sgml
M doc/src/sgml/ref/alter_opclass.sgml
M doc/src/sgml/ref/alter_operator.sgml
M doc/src/sgml/ref/alter_procedure.sgml
M doc/src/sgml/ref/alter_publication.sgml
M doc/src/sgml/ref/alter_schema.sgml
M doc/src/sgml/ref/alter_sequence.sgml
M doc/src/sgml/ref/alter_server.sgml
M doc/src/sgml/ref/alter_statistics.sgml
M doc/src/sgml/ref/alter_subscription.sgml
M doc/src/sgml/ref/alter_table.sgml
M doc/src/sgml/ref/alter_tablespace.sgml
M doc/src/sgml/ref/alter_type.sgml
M doc/src/sgml/ref/alter_view.sgml
M doc/src/sgml/ref/create_database.sgml
M doc/src/sgml/ref/create_schema.sgml
M doc/src/sgml/ref/grant.sgml

Add BufFileRead variants with short read and EOF detection

commit   : 20428d344a2964de6aaef9984fcd472f3c65d115    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 16 Jan 2023 09:20:44 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 16 Jan 2023 09:20:44 +0100    

Click here for diff

Most callers of BufFileRead() want to check whether they read the full  
specified length.  Checking this at every call site is very tedious.  
This patch provides additional variants BufFileReadExact() and  
BufFileReadMaybeEOF() that include the length checks.  
  
I considered changing BufFileRead() itself, but this function is also  
used in extensions, and so changing the behavior like this would  
create a lot of problems there.  The new names are analogous to the  
existing LogicalTapeReadExact().  
  
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>  
Discussion: https://www.postgresql.org/message-id/flat/f3501945-c591-8cc3-5ef0-b72a2e0eaa9c@enterprisedb.com  

M src/backend/access/gist/gistbuildbuffers.c
M src/backend/backup/backup_manifest.c
M src/backend/executor/nodeHashjoin.c
M src/backend/replication/logical/worker.c
M src/backend/storage/file/buffile.c
M src/backend/utils/sort/logtape.c
M src/backend/utils/sort/sharedtuplestore.c
M src/backend/utils/sort/tuplestore.c
M src/include/storage/buffile.h

Fix some BufFileRead() error reporting

commit   : 1561612e3bf3264c31618b9455d0c1003b9271ec    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 16 Jan 2023 09:20:44 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 16 Jan 2023 09:20:44 +0100    

Click here for diff

Remove "%m" from error messages where errno would be bogus.  Add short  
read byte counts where appropriate.  
  
This is equivalent to what was done in  
7897e3bb902c557412645b82120f4d95f7474906, but some code was apparently  
developed concurrently to that and not updated accordingly.  
  
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>  
Discussion: https://www.postgresql.org/message-id/flat/f3501945-c591-8cc3-5ef0-b72a2e0eaa9c@enterprisedb.com  

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

Refactor code in charge of running shell-based recovery commands

commit   : 9a740f81eb02e04179d78f3df2ce671276c27b07    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Mon, 16 Jan 2023 16:31:43 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Mon, 16 Jan 2023 16:31:43 +0900    

Click here for diff

The code specific to the execution of archive_cleanup_command,  
recovery_end_command and restore_command is moved to a new file named  
shell_restore.c.  The code is split into three functions:  
- shell_restore(), that attempts the execution of a shell-based  
restore_command.  
- shell_archive_cleanup(), for archive_cleanup_command.  
- shell_recovery_end(), for recovery_end_command.  
  
This introduces no functional changes, with failure patterns and logs  
generated in consequence being the same as before (one case actually  
generates one less DEBUG2 message "could not restore" when a restore  
command succeeds but the follow-up stat() to check the size fails, but  
that only matters with a elevel high enough).  
  
This is preparatory work for allowing recovery modules, a facility  
similar to archive modules, with callbacks shaped similarly to the  
functions introduced here.  
  
Author: Nathan Bossart  
Reviewed-by: Andres Freund, Michael Paquier  
Discussion: https://postgr.es/m/20221227192449.GA3672473@nathanxps13  

M src/backend/access/transam/Makefile
M src/backend/access/transam/meson.build
A src/backend/access/transam/shell_restore.c
M src/backend/access/transam/xlog.c
M src/backend/access/transam/xlogarchive.c
M src/include/access/xlogarchive.h

Store IdentLine->pg_user as an AuthToken

commit   : 02d3448f4f792964995b8071fa07176606e1af85    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Mon, 16 Jan 2023 13:58:07 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Mon, 16 Jan 2023 13:58:07 +0900    

Click here for diff

While system_user was stored as an AuthToken in IdentLine, pg_user was  
stored as a plain string.  This commit changes the code as we start  
storing pg_user as an AuthToken too.  
  
This does not have any functional changes, as all the operations on  
pg_user only use the string from the AuthToken.  There is no regexp  
compiled and no check based on its quoting, yet.  This is in preparation  
of more features that intend to extend its capabilities, like support  
for regexps and group membership.  
  
Author: Jelte Fennema  
Discussion: https://postgr.es/m/CAGECzQRNow4MwkBjgPxywXdJU_K3a9+Pm78JB7De3yQwwkTDew@mail.gmail.com  

M src/backend/libpq/hba.c
M src/backend/utils/adt/hbafuncs.c
M src/include/libpq/hba.h

Remove arbitrary FUNC_MAX_ARGS limit in int2vectorin and oidvectorin.

commit   : 647fa500547fdf2a967412633a9f6f21ba69e144    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 15 Jan 2023 17:32:09 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 15 Jan 2023 17:32:09 -0500    

Click here for diff

int2vectorin limited the number of array elements it'd take to  
FUNC_MAX_ARGS, which is probably fine for the traditional use-cases.  
But now that pg_publication_rel.prattrs is an int2vector, it's not  
fine at all: it's easy to construct cases where that can have up to  
about MaxTupleAttributeNumber entries.  Trying to replicate such  
tables leads to logical-replication failures.  
  
As long as we have to touch this code anyway, let's just remove  
the a-priori limit altogether, and let it accept any size that'll  
be allowed by repalloc.  (Note that since int2vector isn't toastable,  
we cannot store arrays longer than about BLCKSZ/2; but there is no  
good excuse for letting int2vectorin depend on that.  Perhaps we  
will lift the no-toast restriction someday.)  
  
While at it, also improve the equivalent logic in oidvectorin.  
I don't know of any practical use-case for long oidvectors right  
now, but doing it right actually makes the code shorter.  
  
Per report from Erik Rijkers.  Back-patch to v15 where  
pg_publication_rel.prattrs was added.  
  
Discussion: https://postgr.es/m/668ba539-33c5-8190-ca11-def2913cb94b@xs4all.nl  

M src/backend/utils/adt/int.c
M src/backend/utils/adt/oid.c

Make new GENERATED-expressions code more bulletproof.

commit   : 3f244d020fbf0b4f01d71e1b7620930be4bf9dc5    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 15 Jan 2023 13:14:52 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 15 Jan 2023 13:14:52 -0500    

Click here for diff

In commit 8bf6ec3ba I assumed that no code path could reach  
ExecGetExtraUpdatedCols without having gone through  
ExecInitStoredGenerated.  That turns out not to be the case in  
logical replication: if there's an ON UPDATE trigger on the target  
table, trigger.c will call this code before anybody has set up its  
generated columns.  Having seen that, I don't have a lot of faith in  
there not being other such paths.  ExecGetExtraUpdatedCols can call  
ExecInitStoredGenerated for itself, as long as we are willing to  
assume that it is only called in CMD_UPDATE operations, which on  
the whole seems like a safer leap of faith.  
  
Per report from Vitaly Davydov.  
  
Discussion: https://postgr.es/m/d259d69652b8c2ff50e14cda3c236c7f@postgrespro.ru  

M src/backend/executor/execUtils.c
M src/backend/executor/nodeModifyTable.c
M src/include/executor/nodeModifyTable.h
M src/test/subscription/t/011_generated.pl

Doc: fix typo in backup.sgml.

commit   : 1334b79a359fb842d2d3cfe5b61ad4ccff8b82a4    
  
author   : Tatsuo Ishii <ishii@postgresql.org>    
date     : Sat, 14 Jan 2023 18:05:09 +0900    
  
committer: Tatsuo Ishii <ishii@postgresql.org>    
date     : Sat, 14 Jan 2023 18:05:09 +0900    

Click here for diff

<varname>archive_command</varname> was unnecessarily repeated.  
  
Author: Tatsuo Ishii  
Reviewed-by: Amit Kapila  
Backpatch-through: 15  
Discussion: https://postgr.es/m/flat/20230114.110234.666053507266410467.t-ishii%40sranhm.sra.co.jp  

M doc/src/sgml/backup.sgml

Fix MAINTAIN privileges for toast tables and partitions.

commit   : ff9618e82a466fc9c635f9f087776e57b21e4f14    
  
author   : Jeff Davis <jdavis@postgresql.org>    
date     : Fri, 13 Jan 2023 15:32:37 -0800    
  
committer: Jeff Davis <jdavis@postgresql.org>    
date     : Fri, 13 Jan 2023 15:32:37 -0800    

Click here for diff

Commit 60684dd8 left loose ends when it came to maintaining toast  
tables or partitions.  
  
For toast tables, simply skip the privilege check if the toast table  
is an indirect target of the maintenance command, because the main  
table privileges have already been checked.  
  
For partitions, allow the maintenance command if the user has the  
MAINTAIN privilege on the partition or any parent.  
  
Also make CLUSTER emit "skipping" messages when the user doesn't have  
privileges, similar to VACUUM.  
  
Author: Nathan Bossart  
Reported-by: Pavel Luzanov  
Reviewed-by: Pavel Luzanov, Ted Yu  
Discussion: https://postgr.es/m/20230113231339.GA2422750@nathanxps13  

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/vacuum.out
M src/test/regress/sql/cluster.sql

Add 250c8ee07ed to git-blame-ignore-revs

commit   : ff23b592ad6621563d3128b26860bcb41daf9542    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Fri, 13 Jan 2023 15:33:17 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Fri, 13 Jan 2023 15:33:17 -0800    

Click here for diff

M .git-blame-ignore-revs

commit   : 250c8ee07ede8a104ae1471f6ebca204d94267dd    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Fri, 13 Jan 2023 15:23:09 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Fri, 13 Jan 2023 15:23:09 -0800    

Click here for diff

This is in preparation for commiting a larger patch series in the area.  
  
Discussion: https://postgr.es/m/CAAKRu_bHwGEbzNxxy+MQDkrsgog6aO6iUvajJ4d6PD98gFU7+w@mail.gmail.com  

M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/buffer/localbuf.c
M src/backend/utils/activity/pgstat.c
M src/backend/utils/activity/pgstat_relation.c
M src/backend/utils/adt/pgstatfuncs.c
M src/include/pgstat.h
M src/include/utils/pgstat_internal.h

Clean up useless "skipping" messages for VACUUM/ANALYZE.

commit   : d46a9792a8ebbbed7792b26d6dc0222d2bbde223    
  
author   : Jeff Davis <jdavis@postgresql.org>    
date     : Fri, 13 Jan 2023 14:42:03 -0800    
  
committer: Jeff Davis <jdavis@postgresql.org>    
date     : Fri, 13 Jan 2023 14:42:03 -0800    

Click here for diff

When VACUUM/ANALYZE are run on an entire database, it warns of  
skipping relations for which the user doesn't have sufficient  
privileges. That only makes sense for tables, so skip such messages  
for indexes, etc.  
  
Reviewed-by: Nathan Bossart  
Discussion: https://postgr.es/m/c0a85c2e83158560314b576b6241c8ed0aea1745.camel%40j-davis.com  

M src/backend/commands/vacuum.c

Simplify permissions for LOCK TABLE.

commit   : c44f6334ca6ff6d242d9eb6742441bc4e1294067    
  
author   : Jeff Davis <jdavis@postgresql.org>    
date     : Fri, 13 Jan 2023 14:14:54 -0800    
  
committer: Jeff Davis <jdavis@postgresql.org>    
date     : Fri, 13 Jan 2023 14:14:54 -0800    

Click here for diff

The prior behavior was confusing and hard to document. For instance,  
if you had UPDATE privileges, you could lock a table in any lock mode  
except ACCESS SHARE mode.  
  
Now, if granted a privilege to lock at a given mode, one also has  
privileges to lock at a less-conflicting mode. MAINTAIN, UPDATE,  
DELETE, and TRUNCATE privileges allow any lock mode. INSERT privileges  
allow ROW EXCLUSIVE (or below). SELECT privileges allow ACCESS SHARE.  
  
Reviewed-by: Nathan Bossart  
Discussion: https://postgr.es/m/9550c76535404a83156252b25a11babb4792ea1e.camel%40j-davis.com  

M doc/src/sgml/ref/lock.sgml
M src/backend/commands/lockcmds.c
M src/test/regress/expected/privileges.out
M src/test/regress/sql/privileges.sql

Ignore dropped and generated columns from the column list.

commit   : b7ae03953690a1dee455ba3823cc8f71a72cbe1d    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Fri, 13 Jan 2023 14:49:23 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Fri, 13 Jan 2023 14:49:23 +0530    

Click here for diff

We don't allow different column lists for the same table in the different  
publications of the single subscription. A publication with a column list  
except for dropped and generated columns should be considered the same as  
a publication with no column list (which implicitly includes all columns  
as part of the columns list). However, as we were not excluding the  
dropped and generated columns from the column list combining such  
publications leads to an error "cannot use different column lists for  
table ...".  
  
We decided not to backpatch this fix as there is a risk of users seeing  
this as a behavior change and also we didn't see any field report of this  
case.  
  
Author: Shi yu  
Reviewed-by: Amit Kapila  
Discussion: https://postgr.es/m/OSZPR01MB631091CCBC56F195B1B9ACB0FDFE9@OSZPR01MB6310.jpnprd01.prod.outlook.com  

M src/backend/catalog/pg_publication.c
M src/backend/catalog/system_views.sql
M src/backend/replication/pgoutput/pgoutput.c
M src/include/catalog/catversion.h
M src/test/regress/expected/rules.out
M src/test/subscription/t/031_column_list.pl

Avoid creating parallel apply state hash table unless required.

commit   : dca8b01f5f1f7c83c59a16393724fbd8a29ddecb    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Fri, 13 Jan 2023 08:28:05 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Fri, 13 Jan 2023 08:28:05 +0530    

Click here for diff

This hash table is used to cache the state of streaming transactions being  
applied by the parallel apply workers. So, this should be created only  
when we are successful in launching at least one worker. This avoids rare  
case memory leak when we are never able to launch any worker.  
  
Author: Ted Yu  
Discussion: https://postgr.es/m/CALte62wg0rBR3Vj2beV=HiWo2qG9L0hzKcX=yULNER0wmf4aEw@mail.gmail.com  

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

Add tests for regex replacement with \1 in pg_ident.conf to 0003_peer.pl

commit   : e753ae6397fe16db8e8e5b3e34ca6d53b4eded61    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Fri, 13 Jan 2023 10:35:28 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Fri, 13 Jan 2023 10:35:28 +0900    

Click here for diff

Regexp replacement with \1 in pg_ident.conf is tested in one check of  
the kerberos test suite, still it requires a dependency on  
--with-gssapi to be triggered.  This commit adds to the test suite of  
peer authentication two tests to check the replacement of \1 in a  
pg-username, coupled with a system-username regexp:  
- With a subexpression in system-username, similarly to the kerberos  
test suite.  
- Without a subexpression in system-username, checking for a failure.  
This had no coverage until now, and the error pattern is checked in the  
server logs.  
  
Author: Jelte Fennema  
Discussion: https://postgr.es/m/CAGECzQRNow4MwkBjgPxywXdJU_K3a9+Pm78JB7De3yQwwkTDew@mail.gmail.com  

M src/test/authentication/t/003_peer.pl

doc: Simplify description of functions for pg_walinspect

commit   : 58597edea102258b21d5f4b4f0d7796c0ebf100a    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Fri, 13 Jan 2023 09:29:44 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Fri, 13 Jan 2023 09:29:44 +0900    

Click here for diff

As introduced in 2258e76, the docs were hard to parse:  
- The examples used listed a lot of long records, bloating the output.  
These are switched to show less records with the expanded format,  
similarly to pageinspect.  
- The function descriptions listed all the OUT parameters, producing  
long lines.  This is updated so as only the input parameters are  
documented, clarifying the whole.  
- Remove one example on pg_get_wal_stats() when per_record is set to  
true, which is not really necessary once we know the output produced,  
and the behavior of the parameter is documented.  
  
While on it, fix a few grammar mistakes and simplify a couple of  
sentences.  
  
Author: Bharath Rupireddy  
Discussion: https://postgr.es/m/CALj2ACVGcUpziGgQrcT-1G3dHWQQfWjYBu1YQ2ypv9y86dgogg@mail.gmail.com  
Backpatch-through: 15  

M doc/src/sgml/pgwalinspect.sgml

Fix WaitEventSetWait() buffer overrun.

commit   : f1821b58fc8deee49fba8397bd5baa4b40185110    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 13 Jan 2023 10:40:52 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 13 Jan 2023 10:40:52 +1300    

Click here for diff

The WAIT_USE_EPOLL and WAIT_USE_KQUEUE implementations of  
WaitEventSetWaitBlock() confused the size of their internal buffer with  
the size of the caller's output buffer, and could ask the kernel for too  
many events.  In fact the set of events retrieved from the kernel needs  
to be able to fit in both buffers, so take the smaller of the two.  
  
The WAIT_USE_POLL and WAIT_USE WIN32 implementations didn't have this  
confusion.  
  
This probably didn't come up before because we always used the same  
number in both places, but commit 7389aad6 calculates a dynamic size at  
construction time, while using MAXLISTEN for its output event buffer on  
the stack.  That seems like a reasonable thing to want to do, so  
consider this to be a pre-existing bug worth fixing.  
  
As discovered by valgrind on skink.  
  
Back-patch to all supported releases for epoll, and to release 13 for  
the kqueue part, which copied the incorrect epoll code.  
  
Reviewed-by: Andres Freund <andres@anarazel.de>  
Discussion: https://postgr.es/m/901504.1673504836%40sss.pgh.pa.us  

M src/backend/storage/ipc/latch.c

Fix jsonpath existense checking of missing variables

commit   : 3161ae86ce3ced0a91c2d3cdbbdc602d6e19892d    
  
author   : Alexander Korotkov <akorotkov@postgresql.org>    
date     : Thu, 12 Jan 2023 18:16:34 +0300    
  
committer: Alexander Korotkov <akorotkov@postgresql.org>    
date     : Thu, 12 Jan 2023 18:16:34 +0300    

Click here for diff

The current jsonpath code assumes that the referenced variable always exists.  
It could only throw an error at the value valuation time.  At the same time  
existence checking assumes variable is present without valuation, and error  
suppression doesn't work for missing variables.  
  
This commit makes existense checking trigger an error for missing variables.  
This makes the overall behavior consistent.  
  
Backpatch to 12 where jsonpath was introduced.  
  
Reported-by: David G. Johnston  
Discussion: https://postgr.es/m/CAKFQuwbeytffJkVnEqDyLZ%3DrQsznoTh1OgDoOF3VmOMkxcTMjA%40mail.gmail.com  
Author: Alexander Korotkov, David G. Johnston  
Backpatch-through: 12  

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

Constify the arguments of ilist.c/h functions

commit   : c8ad4d8166aabd6ed5124e7e432166637d0fe646    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 12 Jan 2023 08:00:51 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 12 Jan 2023 08:00:51 +0100    

Click here for diff

Const qualifiers ensure that we don't do something stupid in the  
function implementation.  Additionally they clarify the interface.  As  
an example:  
  
    void  
    slist_delete(slist_head *head, const slist_node *node)  
  
Here one can instantly tell that node->next is not going to be set to  
NULL.  Finally, const qualifiers potentially allow the compiler to do  
more optimizations.  This being said, no benchmarking was done for  
this patch.  
  
The functions that return non-const pointers like slist_next_node(),  
dclist_next_node() etc. are not affected by the patch intentionally.  
  
Author: Aleksander Alekseev  
Reviewed-by: Andres Freund  
Discussion: https://postgr.es/m/CAJ7c6TM2%3D08mNKD9aJg8vEY9hd%2BG4L7%2BNvh30UiNT3kShgRgNg%40mail.gmail.com  

M src/backend/lib/ilist.c
M src/include/lib/ilist.h

Code cleanup

commit   : 881fa869c6b0c4e2f310d1c145141dd9d6f53774    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 12 Jan 2023 07:37:39 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 12 Jan 2023 07:37:39 +0100    

Click here for diff

for commit c96de2ce1782116bd0489b1cd69ba88189a495e8  
  
Author: Nathan Bossart <nathandbossart@gmail.com>  
Discussion: https://www.postgresql.org/message-id/20230111185434.GA1912982@nathanxps13  

M src/backend/access/transam/xlogarchive.c
M src/common/archive.c

commit   : 8607630d74cd83f636a72eb9f2eb62f67e1fb955    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Thu, 12 Jan 2023 14:23:20 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Thu, 12 Jan 2023 14:23:20 +0900    

Click here for diff

The code that handles authentication for user maps was pretty confusing  
with its choice of variable names.  It involves two types of users: a  
system user and a Postgres user (well, role), and these were not named  
consistently throughout the code that processes the user maps loaded  
from pg_ident.conf at authentication.  
  
This commit changes the following things to improve the situation:  
- Rename "pg_role" to "pg_user" and "token" to "system_user" in  
IndetLine.  These choices are more consistent with the pg_ident.conf  
example in the docs, as well.  "token" has been introduced recently in  
fc579e1, and it is way worse than the choice before that, "ident_user".  
- Switch the order of the fields in IdentLine to map with the order of  
the items in the ident files, as of map name, system user and PG user.  
- In check_ident_usermap(), rename "regexp_pgrole" to "expanded_pg_user"  
when processing a regexp for the system user entry in a user map.  This  
variable does not store a regular expression at all: it would be either  
a string or a substitution to \1 if the Postgres role is specified as  
such.  
  
Author: Jelte Fennema  
Discussion: https://postgr.es/m/CAGECzQTkwELHUOAKhvdA+m3tWbUQySHHkExJV8GAZ1pwgbEgXg@mail.gmail.com  

M src/backend/libpq/hba.c
M src/backend/utils/adt/hbafuncs.c
M src/include/libpq/hba.h

Fix incorrect comment in hba.h

commit   : bfd2542001a4a792a82a09607524e9b78a02217c    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Thu, 12 Jan 2023 13:49:28 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Thu, 12 Jan 2023 13:49:28 +0900    

Click here for diff

A comment in hba.h mentioned that AuthTokens are used when building the  
IdentLines from pg_ident.conf, but since 8fea868 that has added support  
of regexps for databases and roles in pg_hba.conf, it is also the case  
of HBA files.  This refreshes the comment to refer to both HBA and ident  
files.  
  
Issue spotted while going through a different patch.  

M src/include/libpq/hba.h

Acquire spinlock when updating 2PC slot data during logical decoding creation

commit   : 5ad165d2c024ae2fdc0a5ddd17522d5c92d7aa1a    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Thu, 12 Jan 2023 13:40:33 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Thu, 12 Jan 2023 13:40:33 +0900    

Click here for diff

The creation of a logical decoding context in CreateDecodingContext()  
updates some data of its slot for two-phase transactions if enabled by  
the caller, but the code forgot to acquire a spinlock when updating  
these fields like any other code paths.  This could lead to the read of  
inconsistent data.  
  
Oversight in a8fd13c.  
  
Author: Sawada Masahiko  
Discussion: https://postgr.es/m/CAD21AoAD8_fp47191LKuecjDd3DYhoQ4TaucFco1_TEr_jQ-Zw@mail.gmail.com  
Backpatch-through: 15  

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

Revert "Get rid of the "new" and "old" entries in a view's rangetable."

commit   : f0e6d6d3c909e14eedd370dd77d7111c2ae24c02    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 11 Jan 2023 22:56:34 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 11 Jan 2023 22:56:34 -0500    

Click here for diff

This reverts commit 1b4d280ea1eb7ddb2e16654d5fa16960bb959566.  
It's broken the buildfarm members that run cross-version-upgrade tests,  
because they're not prepared to deal with cosmetic differences between  
CREATE VIEW commands emitted by older servers and HEAD.  Even if we had  
a solution to that, which we don't, it'd take some time to roll it out  
to the affected animals.  This improvement isn't valuable enough to  
justify addressing that problem on an emergency basis, so revert it  
for now.  

M contrib/postgres_fdw/expected/postgres_fdw.out
M src/backend/commands/lockcmds.c
M src/backend/commands/view.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/readfuncs.c
M src/backend/optimizer/plan/setrefs.c
M src/backend/parser/parse_relation.c
M src/backend/rewrite/rewriteDefine.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/utils/cache/plancache.c
M src/bin/pg_dump/t/002_pg_dump.pl
M src/include/catalog/catversion.h
M src/include/nodes/parsenodes.h
M src/test/regress/expected/aggregates.out
M src/test/regress/expected/alter_table.out
M src/test/regress/expected/collate.icu.utf8.out
M src/test/regress/expected/collate.linux.utf8.out
M src/test/regress/expected/collate.out
M src/test/regress/expected/compression.out
M src/test/regress/expected/create_view.out
M src/test/regress/expected/expressions.out
M src/test/regress/expected/groupingsets.out
M src/test/regress/expected/limit.out
M src/test/regress/expected/matview.out
M src/test/regress/expected/polymorphism.out
M src/test/regress/expected/rangefuncs.out
M src/test/regress/expected/rules.out
M src/test/regress/expected/tablesample.out
M src/test/regress/expected/triggers.out
M src/test/regress/expected/updatable_views.out
M src/test/regress/expected/window.out
M src/test/regress/expected/with.out
M src/test/regress/expected/xml.out
M src/test/regress/expected/xml_2.out

Refactor DetermineSleepTime() to use milliseconds.

commit   : 5a26c7b310b629f8893483cc3cce5bbfa7879115    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Thu, 12 Jan 2023 15:04:08 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Thu, 12 Jan 2023 15:04:08 +1300    

Click here for diff

Since we're not using select() anymore, we don't need to bother with  
struct timeval.  We can work directly in milliseconds, which the latch  
API wants.  
  
Discussion: https://postgr.es/m/CA%2BhUKG%2BZ-HpOj1JsO9eWUP%2Bar7npSVinsC_npxSy%2BjdOMsx%3DGg%40mail.gmail.com  

M src/backend/postmaster/postmaster.c

Use WaitEventSet API for postmaster's event loop.

commit   : 7389aad63666a2cac18cd6d7496378d7f50ef37b    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Thu, 12 Jan 2023 12:34:23 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Thu, 12 Jan 2023 12:34:23 +1300    

Click here for diff

Switch to a design similar to regular backends, instead of the previous  
arrangement where signal handlers did non-trivial state management and  
called fork().  The main changes are:  
  
* The postmaster now has its own local latch to wait on.  (For now, we  
  don't want other backends setting its latch directly, but that could  
  probably be made to work with more research on robustness.)  
  
* The existing signal handlers are cut in two: a handle_pm_XXX() part  
  that just sets pending_pm_XXX flags and the latch, and a  
  process_pm_XXX() part that runs later when the latch is seen.  
  
* Signal handlers are now installed with the regular pqsignal()  
  function rather than the special pqsignal_pm() function; historical  
  portability concerns about the effect of SA_RESTART on select() are no  
  longer relevant, and we don't need to block signals anymore.  
  
Reviewed-by: Andres Freund <andres@anarazel.de>  
Discussion: https://postgr.es/m/CA%2BhUKG%2BZ-HpOj1JsO9eWUP%2Bar7npSVinsC_npxSy%2BjdOMsx%3DGg%40mail.gmail.com  

M src/backend/libpq/pqcomm.c
M src/backend/libpq/pqsignal.c
M src/backend/postmaster/fork_process.c
M src/backend/postmaster/postmaster.c
M src/backend/tcop/postgres.c
M src/backend/utils/init/miscinit.c
M src/include/libpq/pqsignal.h
M src/include/miscadmin.h

Doc: fix silly thinko in 8bf6ec3ba.

commit   : d93d68aeeaeeda0e871825b461fd9ab68c7c0de3    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 11 Jan 2023 22:19:49 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 11 Jan 2023 22:19:49 -0500    

Click here for diff

Amit Langote  
  
Discussion: https://postgr.es/m/CA+HiwqG2v-SnWyJuyVM-Z8DEFukY8+qe3XLMwSG4Xp7Yf=RioA@mail.gmail.com  

M doc/src/sgml/ddl.sgml

Make lazy_vacuum_heap_rel match lazy_scan_heap.

commit   : d30b499997caa77805c112b3e0524d2bca8f3e48    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 11 Jan 2023 18:45:32 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 11 Jan 2023 18:45:32 -0800    

Click here for diff

Make lazy_vacuum_heap_rel variable names match those from lazy_scan_heap  
where that makes sense.  
  
Extracted from a larger patch to deal with issues with how vacuumlazy.c  
sets pages all-frozen.  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Discussion: https://postgr.es/m/CAH2-WznuNGSzF8v6OsgjaC5aYsb3cZ6HW6MLm30X0d65cmSH6A@mail.gmail.com  

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

vacuumlazy.c: Tweak local variable name.

commit   : 8c233cf86b6d77989a1a6bea96f9b2e31a9b6c7a    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 11 Jan 2023 17:57:18 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 11 Jan 2023 17:57:18 -0800    

Click here for diff

Make a local variable name consistent with the name from its WAL record.  
  
Extracted from a larger patch to deal with issues with how vacuumlazy.c  
sets pages all-frozen.  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Discussion: https://postgr.es/m/CAH2-WznuNGSzF8v6OsgjaC5aYsb3cZ6HW6MLm30X0d65cmSH6A@mail.gmail.com  

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

Rename and relocate freeze plan dedup routines.

commit   : 50767705ed093eb4cf64f5980b3ffdfa2fc8ebc8    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 11 Jan 2023 17:30:42 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 11 Jan 2023 17:30:42 -0800    

Click here for diff

Rename the heapam.c freeze plan deduplication routines added by commit  
9e540599 to names that follow conventions for functions in heapam.c.  
Also relocate the functions so that they're next to their caller, which  
runs during original execution, when FREEZE_PAGE WAL records are built.  
  
The routines were initially placed next to (and followed the naming  
conventions of) conceptually related REDO routine code, but that scheme  
turned out to be kind of jarring when considered in a wider context.  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Reported-By: Andres Freund <andres@anarazel.de>  
Discussion: https://postgr.es/m/20230109214308.icz26oqvt3k2274c@awork3.anarazel.de  

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

Get rid of the "new" and "old" entries in a view's rangetable.

commit   : 1b4d280ea1eb7ddb2e16654d5fa16960bb959566    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 11 Jan 2023 19:41:02 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 11 Jan 2023 19:41:02 -0500    

Click here for diff

The rule system needs "old" and/or "new" pseudo-RTEs in rule actions  
that are ON INSERT/UPDATE/DELETE.  Historically it's put such entries  
into the ON SELECT rules of views as well, but those are really quite  
vestigial.  The only thing we've used them for is to carry the  
view's relid forward to AcquireExecutorLocks (so that we can  
re-lock the view to verify it hasn't changed before re-using a plan)  
and to carry its relid and permissions data forward to execution-time  
permissions checks.  What we can do instead of that is to retain  
these fields of the RTE_RELATION RTE for the view even after we  
convert it to an RTE_SUBQUERY RTE.  This requires a tiny amount of  
extra complication in the planner and AcquireExecutorLocks, but on  
the other hand we can get rid of the logic that moves that data from  
one place to another.  
  
The principal immediate benefit of doing this, aside from a small  
saving in the pg_rewrite data for views, is that these pseudo-RTEs  
no longer trigger ruleutils.c's heuristic about qualifying variable  
names when the rangetable's length is more than 1.  That results  
in quite a number of small simplifications in regression test outputs,  
which are all to the good IMO.  
  
Bump catversion because we need to dump a few more fields of  
RTE_SUBQUERY RTEs.  While those will always be zeroes anyway in  
stored rules (because we'd never populate them until query rewrite)  
they are useful for debugging, and it seems like we'd better make  
sure to transmit such RTEs accurately in plans sent to parallel  
workers.  I don't think the executor actually examines these fields  
after startup, but someday it might.  
  
Amit Langote  
  
Discussion: https://postgr.es/m/CA+HiwqEf7gPN4Hn+LoZ4tP2q_Qt7n3vw7-6fJKOf92tSEnX6Gg@mail.gmail.com  

M contrib/postgres_fdw/expected/postgres_fdw.out
M src/backend/commands/lockcmds.c
M src/backend/commands/view.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/readfuncs.c
M src/backend/optimizer/plan/setrefs.c
M src/backend/parser/parse_relation.c
M src/backend/rewrite/rewriteDefine.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/utils/cache/plancache.c
M src/bin/pg_dump/t/002_pg_dump.pl
M src/include/catalog/catversion.h
M src/include/nodes/parsenodes.h
M src/test/regress/expected/aggregates.out
M src/test/regress/expected/alter_table.out
M src/test/regress/expected/collate.icu.utf8.out
M src/test/regress/expected/collate.linux.utf8.out
M src/test/regress/expected/collate.out
M src/test/regress/expected/compression.out
M src/test/regress/expected/create_view.out
M src/test/regress/expected/expressions.out
M src/test/regress/expected/groupingsets.out
M src/test/regress/expected/limit.out
M src/test/regress/expected/matview.out
M src/test/regress/expected/polymorphism.out
M src/test/regress/expected/rangefuncs.out
M src/test/regress/expected/rules.out
M src/test/regress/expected/tablesample.out
M src/test/regress/expected/triggers.out
M src/test/regress/expected/updatable_views.out
M src/test/regress/expected/window.out
M src/test/regress/expected/with.out
M src/test/regress/expected/xml.out
M src/test/regress/expected/xml_2.out

Add support for tab completion after ALTER EXTENSION ADD|DROP in psql

commit   : 2ff5ca86e816846743b31279a9f6b819d4cf4b11    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Thu, 12 Jan 2023 08:49:37 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Thu, 12 Jan 2023 08:49:37 +0900    

Click here for diff

This appends the set of object types supported by these commands, and  
the objects defined in the cluster are completed after that.  Note that  
these may not be in the extension being working on when using DROP, to  
keep the code simple, but this is much more useful than the previous  
behavior of not knowing the objects that can be touched.  
  
Author: Vignesh C  
Discussion: https://postgr.es/m/CALDaNm3LVM2QcUWqgOonKZH80TveT-tUthbw4ZhuE_6pD3yi-A@mail.gmail.com  

M src/bin/psql/tab-complete.c

Improve TransactionIdDidAbort() documentation.

commit   : af3855cb77b94a0321b77d7d9a9849700ea6a758    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 11 Jan 2023 15:31:42 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 11 Jan 2023 15:31:42 -0800    

Click here for diff

Document that TransactionIdDidAbort() won't indicate that transactions  
that were in-progress during a crash have aborted.  Tie this to existing  
discussion of the TransactionIdDidCommit() and TransactionIdDidCommit()  
protocol that code in heapam_visibility.c (and a few other places) must  
observe.  
  
Follow-up to bugfix commit eb5ad4ff.  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Reviewed-By: Andres Freund <andres@anarazel.de>  
Discussion: https://postgr.es/m/CAH2-Wzn4bEEqgmaUQL3aJ73yM9gAeK-wE4ngi7kjRjLztb+P0w@mail.gmail.com  

M src/backend/access/heap/heapam_visibility.c
M src/backend/access/transam/transam.c

Improve handling of inherited GENERATED expressions.

commit   : 8bf6ec3ba3a44448817af47a080587f3b71bee08    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 11 Jan 2023 15:55:02 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 11 Jan 2023 15:55:02 -0500    

Click here for diff

In both partitioning and traditional inheritance, require child  
columns to be GENERATED if and only if their parent(s) are.  
Formerly we allowed the case of an inherited column being  
GENERATED when its parent isn't, but that results in inconsistent  
behavior: the column can be directly updated through an UPDATE  
on the parent table, leading to it containing a user-supplied  
value that might not match the generation expression.  This also  
fixes an oversight that we enforced partition-key-columns-can't-  
be-GENERATED against parent tables, but not against child tables  
that were dynamically attached to them.  
  
Also, remove the restriction that the child's generation expression  
be equivalent to the parent's.  In the wake of commit 3f7836ff6,  
there doesn't seem to be any reason that we need that restriction,  
since generation expressions are always computed per-table anyway.  
By removing this, we can also allow a child to merge multiple  
inheritance parents with inconsistent generation expressions, by  
overriding them with its own expression, much as we've long allowed  
for DEFAULT expressions.  
  
Since we're rejecting a case that we used to accept, this doesn't  
seem like a back-patchable change.  Given the lack of field  
complaints about the inconsistent behavior, it's likely that no  
one is doing this anyway, but we won't change it in minor releases.  
  
Amit Langote and Tom Lane  
  
Discussion: https://postgr.es/m/2793383.1672944799@sss.pgh.pa.us  

M doc/src/sgml/ddl.sgml
M src/backend/commands/tablecmds.c
M src/backend/parser/parse_utilcmd.c
M src/bin/pg_dump/common.c
M src/bin/pg_dump/pg_dump.c
M src/test/regress/expected/generated.out
M src/test/regress/sql/generated.sql

Don't leave roles behind after core regression tests.

commit   : d0d968328794a25c844dc57585d0289a08159bb5    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 11 Jan 2023 12:22:47 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 11 Jan 2023 12:22:47 -0500    

Click here for diff

Commits cf5eb37c5 and e5b8a4c09 each created a new role that they  
forgot to remove again.  This breaks the use-case of running "make  
installcheck" more than once, and it's also against project policy  
because it'd be quite unfriendly behavior if one were running  
"make installcheck" against a non-throwaway installation.  

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

Fix MSVC build

commit   : c971a5b27ac946e7c94f7f655d321279512c7ee7    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Wed, 11 Jan 2023 14:41:52 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Wed, 11 Jan 2023 14:41:52 +0100    

Click here for diff

for commit c96de2ce1782116bd0489b1cd69ba88189a495e8  

M src/tools/msvc/Mkvcbuild.pm

Common function for percent placeholder replacement

commit   : c96de2ce1782116bd0489b1cd69ba88189a495e8    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Wed, 11 Jan 2023 07:22:51 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Wed, 11 Jan 2023 07:22:51 +0100    

Click here for diff

There are a number of places where a shell command is constructed with  
percent-placeholders (like %x).  It's cumbersome to have to open-code  
this several times.  This factors out this logic into a separate  
function.  This also allows us to ensure consistency for and document  
some subtle behaviors, such as what to do with unrecognized  
placeholders.  
  
The unified handling is now that incorrect and unknown placeholders  
are an error, where previously in most cases they were skipped or  
ignored.  This affects the following settings:  
  
- archive_cleanup_command  
- archive_command  
- recovery_end_command  
- restore_command  
- ssl_passphrase_command  
  
The following settings are part of this refactoring but already had  
stricter error handling and should be unchanged in their behavior:  
  
- basebackup_to_shell.command  
  
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>  
Discussion: https://www.postgresql.org/message-id/flat/5238bbed-0b01-83a6-d4b2-7eb0562a054e%40enterprisedb.com  

M contrib/basebackup_to_shell/basebackup_to_shell.c
M src/backend/access/transam/xlogarchive.c
M src/backend/libpq/be-secure-common.c
M src/backend/postmaster/shell_archive.c
M src/common/Makefile
M src/common/archive.c
M src/common/meson.build
A src/common/percentrepl.c
M src/fe_utils/archive.c
A src/include/common/percentrepl.h

Fix typos in code and comments

commit   : 5f6401f81cb24bd3930e0dc589fc4aa8b5424cdc    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Wed, 11 Jan 2023 15:16:38 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Wed, 11 Jan 2023 15:16:38 +0900    

Click here for diff

Author: Justin Pryzby  
Discussion: https://postgr.es/m/20230110045722.GD9837@telsasoft.com  

M doc/src/sgml/ref/alter_database.sgml
M doc/src/sgml/ref/alter_role.sgml
M doc/src/sgml/ref/psql-ref.sgml
M doc/src/sgml/system-views.sgml
M src/backend/access/transam/xlogrecovery.c
M src/backend/utils/mmgr/mcxt.c
M src/bin/psql/common.c
M src/test/modules/test_pg_db_role_setting/expected/test_pg_db_role_setting.out
M src/test/modules/test_pg_db_role_setting/sql/test_pg_db_role_setting.sql

Remove function declarations from headers for some undefined functions

commit   : 69fb29d1affb525d4c91b4dc5b104a551e61c28d    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Wed, 11 Jan 2023 11:54:55 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Wed, 11 Jan 2023 11:54:55 +0900    

Click here for diff

The functions whose declarations are removed here have been removed in  
the past, but their respective headers forgot the call.  
  
Author: Justin Pryzby  
Discussion: https://postgr.es/m/20230110045722.GD9837@telsasoft.com  

M src/bin/pg_dump/compress_io.h
M src/include/access/gist_private.h
M src/include/access/xlogreader.h

Have the planner consider Incremental Sort for DISTINCT

commit   : 3c6fc58209f24b959ee18f5d19ef96403d08f15c    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Wed, 11 Jan 2023 10:25:43 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Wed, 11 Jan 2023 10:25:43 +1300    

Click here for diff

Prior to this, we only considered a full sort on the cheapest input path  
and uniquifying any path which was already sorted in the required sort  
order.  Here we adjust create_final_distinct_paths() so that it also  
adds an Incremental Sort path on any path which has presorted keys.  
  
Additionally, this adjusts the parallel distinct code so that we now  
consider sorting the cheapest partial path and incrementally sorting any  
partial paths with presorted keys.  Previously we didn't consider any  
sorting for parallel distinct and only added a unique path atop any path  
which had the required pathkeys already.  
  
Author: David Rowley  
Reviewed-by: Richard Guo  
Discussion: https://postgr.es/m/CAApHDvo8Lz2H=42urBbfP65LTcEUOh288MT7DsG2_EWtW1AXHQ@mail.gmail.com  

M src/backend/optimizer/plan/planner.c
M src/test/regress/expected/incremental_sort.out
M src/test/regress/expected/select_distinct.out
M src/test/regress/expected/window.out
M src/test/regress/sql/select_distinct.sql

Add new GUC createrole_self_grant.

commit   : e5b8a4c098ad6add39626a14475148872cd687e0    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Tue, 10 Jan 2023 12:44:49 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Tue, 10 Jan 2023 12:44:49 -0500    

Click here for diff

Can be set to the empty string, or to either or both of "set" or  
"inherit". If set to a non-empty value, a non-superuser who creates  
a role (necessarily by relying up the CREATEROLE privilege) will  
grant that role back to themselves with the specified options.  
  
This isn't a security feature, because the grant that this feature  
triggers can also be performed explicitly. Instead, it's a user experience  
feature. A superuser would necessarily inherit the privileges of any  
created role and be able to access all such roles via SET ROLE;  
with this patch, you can configure createrole_self_grant = 'set, inherit'  
to provide a similar experience for a user who has CREATEROLE but not  
SUPERUSER.  
  
Discussion: https://postgr.es/m/CA+TgmobN59ct+Emmz6ig1Nua2Q-_o=r6DSD98KfU53kctq_kQw@mail.gmail.com  

M doc/src/sgml/config.sgml
M doc/src/sgml/ref/create_role.sgml
M doc/src/sgml/ref/createuser.sgml
M src/backend/commands/user.c
M src/backend/utils/misc/guc_tables.c
M src/backend/utils/misc/postgresql.conf.sample
M src/include/commands/user.h
M src/test/regress/expected/create_role.out
M src/test/regress/sql/create_role.sql

Restrict the privileges of CREATEROLE users.

commit   : cf5eb37c5ee0cc54c80d95c1695d7fca1f7c68cb    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Tue, 10 Jan 2023 12:44:30 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Tue, 10 Jan 2023 12:44:30 -0500    

Click here for diff

Previously, CREATEROLE users were permitted to make nearly arbitrary  
changes to roles that they didn't create, with certain exceptions,  
particularly superuser roles.  Instead, allow CREATEROLE users to make such  
changes to roles for which they possess ADMIN OPTION, and to  
grant membership only in roles for which they possess ADMIN OPTION.  
  
When a CREATEROLE user who is not a superuser creates a role, grant  
ADMIN OPTION on the newly-created role to the creator, so that they  
can administer roles they create or for which they have been given  
privileges.  
  
With these changes, CREATEROLE users still have very significant  
powers that unprivileged users do not receive: they can alter, rename,  
drop, comment on, change the password for, and change security labels  
on roles.  However, they can now do these things only for roles for  
which they possess appropriate privileges, rather than all  
non-superuser roles; moreover, they cannot grant a role such as  
pg_execute_server_program unless they themselves possess it.  
  
Patch by me, reviewed by Mark Dilger.  
  
Discussion: https://postgr.es/m/CA+TgmobN59ct+Emmz6ig1Nua2Q-_o=r6DSD98KfU53kctq_kQw@mail.gmail.com  

M doc/src/sgml/ddl.sgml
M doc/src/sgml/ref/alter_role.sgml
M doc/src/sgml/ref/comment.sgml
M doc/src/sgml/ref/create_role.sgml
M doc/src/sgml/ref/createuser.sgml
M doc/src/sgml/ref/drop_role.sgml
M doc/src/sgml/ref/dropuser.sgml
M doc/src/sgml/ref/grant.sgml
M doc/src/sgml/user-manag.sgml
M src/backend/catalog/objectaddress.c
M src/backend/commands/user.c
M src/test/modules/dummy_seclabel/expected/dummy_seclabel.out
M src/test/modules/dummy_seclabel/sql/dummy_seclabel.sql
M src/test/regress/expected/create_role.out
M src/test/regress/sql/create_role.sql

Fix MERGE's test for unreachable WHEN clauses.

commit   : f026c16a2c5a3ee5d7aa6f85333ec80c905913ba    
  
author   : Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Tue, 10 Jan 2023 14:17:47 +0000    
  
committer: Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Tue, 10 Jan 2023 14:17:47 +0000    

Click here for diff

The former code would only detect an unreachable WHEN clause if it had  
an AND condition. Fix, so that unreachable unconditional WHEN clauses  
are also detected.  
  
Back-patch to v15, where MERGE was added.  
  
Discussion: https://postgr.es/m/CAEZATCVQ=7E2z4cSBB49jjeGGsB6WeoYQY32NDeSvcHiLUZ=ow@mail.gmail.com  

M src/backend/parser/parse_merge.c
M src/test/regress/expected/merge.out
M src/test/regress/sql/merge.sql

New header varatt.h split off from postgres.h

commit   : d952373a987bad331c0e499463159dd142ced1ef    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Tue, 10 Jan 2023 05:48:59 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Tue, 10 Jan 2023 05:48:59 +0100    

Click here for diff

This new header contains all the variable-length data types support  
(TOAST support) from postgres.h, which isn't needed by large parts of  
the backend code.  
  
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>  
Discussion: https://www.postgresql.org/message-id/flat/ddcce239-0f29-6e62-4b47-1f8ca742addf%40enterprisedb.com  

M contrib/citext/citext.c
M contrib/cube/cubeparse.y
M contrib/fuzzystrmatch/fuzzystrmatch.c
M contrib/ltree/ltree_io.c
M contrib/ltree/ltxtquery_io.c
M contrib/pg_trgm/trgm_gin.c
M contrib/pg_trgm/trgm_gist.c
M contrib/pg_trgm/trgm_regexp.c
M contrib/pgcrypto/pgcrypto.c
M contrib/uuid-ossp/uuid-ossp.c
M doc/src/sgml/xfunc.sgml
M src/backend/access/common/toast_compression.c
M src/backend/access/hash/hashfunc.c
M src/backend/access/spgist/spgtextproc.c
M src/backend/access/table/toast_helper.c
M src/backend/libpq/be-fsstubs.c
M src/backend/libpq/pqformat.c
M src/backend/tsearch/ts_parse.c
M src/backend/tsearch/ts_typanalyze.c
M src/backend/utils/adt/ascii.c
M src/backend/utils/adt/char.c
M src/backend/utils/adt/cryptohashfuncs.c
M src/backend/utils/adt/encode.c
M src/backend/utils/adt/formatting.c
M src/backend/utils/adt/geo_ops.c
M src/backend/utils/adt/like.c
M src/backend/utils/adt/network_gist.c
M src/backend/utils/adt/network_spgist.c
M src/backend/utils/adt/oracle_compat.c
M src/backend/utils/adt/quote.c
M src/backend/utils/adt/rangetypes.c
M src/backend/utils/adt/rangetypes_typanalyze.c
M src/backend/utils/adt/tsginidx.c
M src/backend/utils/adt/tsquery.c
M src/backend/utils/adt/tsquery_cleanup.c
M src/backend/utils/adt/tsquery_op.c
M src/backend/utils/adt/tsquery_util.c
M src/backend/utils/adt/tsvector.c
M src/backend/utils/cache/attoptcache.c
M src/backend/utils/cache/spccache.c
M src/backend/utils/mb/mbutils.c
M src/include/access/htup_details.h
M src/include/meson.build
M src/include/postgres.h
M src/include/utils/expandeddatum.h
A src/include/varatt.h
M src/pl/plperl/Util.xs
M src/test/modules/spgist_name_ops/spgist_name_ops.c
M src/test/modules/test_custom_rmgrs/test_custom_rmgrs.c
M src/test/modules/test_shm_mq/test.c

Document the newly added wait events added by commit 216a784829.

commit   : cd06ccd78fcf59dd6486b83e4fbf6c73be179523    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Tue, 10 Jan 2023 09:38:08 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Tue, 10 Jan 2023 09:38:08 +0530    

Click here for diff

Author: Shinoda, Noriyoshi  
Reviewed-by: Hou Zhijie  
Discussion: https://postgr.es/m/DM4PR84MB173460530245F56364E1DAF7EEFE9@DM4PR84MB1734.NAMPRD84.PROD.OUTLOOK.COM  

M doc/src/sgml/monitoring.sgml

Round off random_normal() test results one more decimal place.

commit   : 02d552c4f4229c3c1fb4ed5eadb93b6d551b7510    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 9 Jan 2023 22:44:16 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 9 Jan 2023 22:44:16 -0500    

Click here for diff

As I suspected, some machines have even more low-order-bit  
inaccuracy than the ones I tested.  Tweak new test so that  
(hopefully) it will pass everywhere.  Per buildfarm.  
  
Discussion: https://postgr.es/m/4173840.1673290336@sss.pgh.pa.us  

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

Fix the display of lock information for specktoken.

commit   : f745739697e49a38a31a755d7d36d6c97008dd9f    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Tue, 10 Jan 2023 08:53:12 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Tue, 10 Jan 2023 08:53:12 +0530    

Click here for diff

A transaction id is now displayed in the transactionid field and  
speculative insertion token is displayed in the objid field.  
  
Author: Sawada Masahiko  
Reviewed-by: Amit Kapila  
Discussion: https://postgr.es/m/CAD21AoCEKxZztULP1CDm45aSNNR1QO-Bh1q6LMTspQ78PBuJrw@mail.gmail.com  

M doc/src/sgml/system-views.sgml
M src/backend/utils/adt/lockfuncs.c

Remove pg_regress' never-documented "ignore" feature.

commit   : bd8d453e9b5f8b632a400a9e796fc041aed76d82    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 9 Jan 2023 20:34:26 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 9 Jan 2023 20:34:26 -0500    

Click here for diff

We aren't using this anymore in the wake of commit 09d517773,  
so delete it.  We can always revert this if some future use  
emerges, but I think our standards for test quality are now  
high enough that that will never happen.  
  
Discussion: https://postgr.es/m/4173840.1673290336@sss.pgh.pa.us  

M src/test/regress/pg_regress.c

Upgrade the random.sql regression test.

commit   : 09d517773f606baef7958aa5bad25d3b3c30303e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 9 Jan 2023 20:30:25 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 9 Jan 2023 20:30:25 -0500    

Click here for diff

We had some pretty ad-hoc and inefficient code here.  To make  
matters worse, it didn't test the properties of the random()  
function very thoroughly, and it had a test failure rate of  
one in every few tens of thousands of runs.  Replace the  
script altogether with new test cases that prove much more  
about random()'s output, run faster, and can be calculated  
to have test failure rates on the order of 1e-9.  
  
Having done that, the failure rate of this script should be  
negligible in comparison to other causes of test failures,  
so remove the "ignore" marker for it in parallel_schedule.  
(If it does fail, we'd like to know about that, so "ignore"  
was always pretty counterproductive.)  
  
Tom Lane and Dean Rasheed  
  
Discussion: https://postgr.es/m/4173840.1673290336@sss.pgh.pa.us  

M src/test/regress/expected/random.out
M src/test/regress/parallel_schedule
M src/test/regress/sql/random.sql

Doc: add XML ID attributes to <sectN> and <varlistentry> tags.

commit   : 78ee60ed84bb3a1cf0b6bd9a715dcbcf252a90f5    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 9 Jan 2023 15:08:24 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 9 Jan 2023 15:08:24 -0500    

Click here for diff

This doesn't have any external effect at the moment, but it  
will allow adding useful link-discoverability features later.  
  
Brar Piening, reviewed by Karl Pinc.  
  
Discussion: https://postgr.es/m/CAB8KJ=jpuQU9QJe4+RgWENrK5g9jhoysMw2nvTN_esoOU0=a_w@mail.gmail.com  

M doc/src/sgml/amcheck.sgml
M doc/src/sgml/arch-dev.sgml
M doc/src/sgml/auth-delay.sgml
M doc/src/sgml/auto-explain.sgml
M doc/src/sgml/basebackup-to-shell.sgml
M doc/src/sgml/basic-archive.sgml
M doc/src/sgml/bloom.sgml
M doc/src/sgml/btree-gin.sgml
M doc/src/sgml/btree-gist.sgml
M doc/src/sgml/charset.sgml
M doc/src/sgml/citext.sgml
M doc/src/sgml/config.sgml
M doc/src/sgml/contrib-spi.sgml
M doc/src/sgml/cube.sgml
M doc/src/sgml/datatype.sgml
M doc/src/sgml/ddl.sgml
M doc/src/sgml/dict-int.sgml
M doc/src/sgml/dict-xsyn.sgml
M doc/src/sgml/docguide.sgml
M doc/src/sgml/earthdistance.sgml
M doc/src/sgml/ecpg.sgml
M doc/src/sgml/extend.sgml
M doc/src/sgml/features.sgml
M doc/src/sgml/func.sgml
M doc/src/sgml/fuzzystrmatch.sgml
M doc/src/sgml/geqo.sgml
M doc/src/sgml/history.sgml
M doc/src/sgml/hstore.sgml
M doc/src/sgml/install-windows.sgml
M doc/src/sgml/installation.sgml
M doc/src/sgml/intagg.sgml
M doc/src/sgml/intarray.sgml
M doc/src/sgml/isn.sgml
M doc/src/sgml/jit.sgml
M doc/src/sgml/json.sgml
M doc/src/sgml/libpq.sgml
M doc/src/sgml/lo.sgml
M doc/src/sgml/logicaldecoding.sgml
M doc/src/sgml/ltree.sgml
M doc/src/sgml/nls.sgml
M doc/src/sgml/oldsnapshot.sgml
M doc/src/sgml/pageinspect.sgml
M doc/src/sgml/perform.sgml
M doc/src/sgml/pgbuffercache.sgml
M doc/src/sgml/pgcrypto.sgml
M doc/src/sgml/pgfreespacemap.sgml
M doc/src/sgml/pgprewarm.sgml
M doc/src/sgml/pgrowlocks.sgml
M doc/src/sgml/pgstatstatements.sgml
M doc/src/sgml/pgstattuple.sgml
M doc/src/sgml/pgsurgery.sgml
M doc/src/sgml/pgtrgm.sgml
M doc/src/sgml/pgvisibility.sgml
M doc/src/sgml/pgwalinspect.sgml
M doc/src/sgml/plpgsql.sgml
M doc/src/sgml/plpython.sgml
M doc/src/sgml/postgres-fdw.sgml
M doc/src/sgml/problems.sgml
M doc/src/sgml/protocol.sgml
M doc/src/sgml/queries.sgml
M doc/src/sgml/ref/alter_role.sgml
M doc/src/sgml/ref/alter_table.sgml
M doc/src/sgml/ref/commit.sgml
M doc/src/sgml/ref/create_database.sgml
M doc/src/sgml/ref/create_table.sgml
M doc/src/sgml/ref/initdb.sgml
M doc/src/sgml/ref/pgbench.sgml
M doc/src/sgml/ref/psql-ref.sgml
M doc/src/sgml/ref/rollback.sgml
M doc/src/sgml/regress.sgml
M doc/src/sgml/rowtypes.sgml
M doc/src/sgml/rules.sgml
M doc/src/sgml/runtime.sgml
M doc/src/sgml/seg.sgml
M doc/src/sgml/sepgsql.sgml
M doc/src/sgml/sources.sgml
M doc/src/sgml/sslinfo.sgml
M doc/src/sgml/tablefunc.sgml
M doc/src/sgml/tsm-system-rows.sgml
M doc/src/sgml/tsm-system-time.sgml
M doc/src/sgml/unaccent.sgml
M doc/src/sgml/uuid-ossp.sgml
M doc/src/sgml/xfunc.sgml
M doc/src/sgml/xml2.sgml
M doc/src/sgml/xoper.sgml

Invent random_normal() to provide normally-distributed random numbers.

commit   : 38d81760c4d7e22b95252e3545596602c9e38806    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 9 Jan 2023 12:44:00 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 9 Jan 2023 12:44:00 -0500    

Click here for diff

There is already a version of this in contrib/tablefunc, but it  
seems sufficiently widely useful to justify having it in core.  
  
Paul Ramsey  
  
Discussion: https://postgr.es/m/CACowWR0DqHAvOKUCNxTrASFkWsDLqKMd6WiXvVvaWg4pV1BMnQ@mail.gmail.com  

M doc/src/sgml/func.sgml
M src/backend/catalog/system_functions.sql
M src/backend/utils/adt/float.c
M src/bin/pgbench/pgbench.c
M src/common/pg_prng.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.dat
M src/include/common/pg_prng.h
M src/test/regress/expected/random.out
M src/test/regress/sql/random.sql

Remove redundant setting of tuplesort status

commit   : 2673ebf49acfd83b09c777ced8f21eacd27b51ce    
  
author   : John Naylor <john.naylor@postgresql.org>    
date     : Mon, 9 Jan 2023 16:53:21 +0700    
  
committer: John Naylor <john.naylor@postgresql.org>    
date     : Mon, 9 Jan 2023 16:53:21 +0700    

Click here for diff

Also add an explanatory comment to match other similar coding within  
tuplesort_performsort().  
  
Xing Guo  
  
Reviewed by Richard Guo and Cary Huang  
Discussion: https://www.postgresql.org/message-id/CACpMh%2BAQ4GXRKKi9ib2ioUH%2BqwNaSAVbetssJ0tMPfxAWuL2yg%40mail.gmail.com  

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

Fix the file mode of worker.c changed by the commit 216a784829.

commit   : c06caa0d622b21c617d10504d1c1a39dbd2d3f1e    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Mon, 9 Jan 2023 14:02:38 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Mon, 9 Jan 2023 14:02:38 +0530    

Click here for diff

Reported-by: Japin Li  
Discussion: https://postgr.es/m/MEYP282MB166970D1559B7CC74D3E339BB6FE9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM  

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

Allow left join removals and unique joins on partitioned tables

commit   : 3c569049b7b502bb4952483d19ce622ff0af5fd6    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Mon, 9 Jan 2023 17:15:08 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Mon, 9 Jan 2023 17:15:08 +1300    

Click here for diff

This allows left join removals and unique joins to work with partitioned  
tables.  The planner just lacked sufficient proofs that a given join  
would not cause any row duplication.  Unique indexes currently serve as  
that proof, so have get_relation_info() populate the indexlist for  
partitioned tables too.  
  
Author: Arne Roland  
Reviewed-by: Alvaro Herrera, Zhihong Yu, Amit Langote, David Rowley  
Discussion: https://postgr.es/m/c3b2408b7a39433b8230bbcd02e9f302@index.de  

M src/backend/optimizer/util/plancat.c
M src/backend/utils/adt/selfuncs.c
M src/include/nodes/pathnodes.h
M src/test/regress/expected/join.out
M src/test/regress/expected/partition_join.out
M src/test/regress/sql/join.sql
M src/test/regress/sql/partition_join.sql

Perform apply of large transactions by parallel workers.

commit   : 216a784829c2c5f03ab0c43e009126cbb819e9b2    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Mon, 9 Jan 2023 07:00:39 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Mon, 9 Jan 2023 07:00:39 +0530    

Click here for diff

Currently, for large transactions, the publisher sends the data in  
multiple streams (changes divided into chunks depending upon  
logical_decoding_work_mem), and then on the subscriber-side, the apply  
worker writes the changes into temporary files and once it receives the  
commit, it reads from those files and applies the entire transaction. To  
improve the performance of such transactions, we can instead allow them to  
be applied via parallel workers.  
  
In this approach, we assign a new parallel apply worker (if available) as  
soon as the xact's first stream is received and the leader apply worker  
will send changes to this new worker via shared memory. The parallel apply  
worker will directly apply the change instead of writing it to temporary  
files. However, if the leader apply worker times out while attempting to  
send a message to the parallel apply worker, it will switch to  
"partial serialize" mode -  in this mode, the leader serializes all  
remaining changes to a file and notifies the parallel apply workers to  
read and apply them at the end of the transaction. We use a non-blocking  
way to send the messages from the leader apply worker to the parallel  
apply to avoid deadlocks. We keep this parallel apply assigned till the  
transaction commit is received and also wait for the worker to finish at  
commit. This preserves commit ordering and avoid writing to and reading  
from files in most cases. We still need to spill if there is no worker  
available.  
  
This patch also extends the SUBSCRIPTION 'streaming' parameter so that the  
user can control whether to apply the streaming transaction in a parallel  
apply worker or spill the change to disk. The user can set the streaming  
parameter to 'on/off', or 'parallel'. The parameter value 'parallel' means  
the streaming will be applied via a parallel apply worker, if available.  
The parameter value 'on' means the streaming transaction will be spilled  
to disk. The default value is 'off' (same as current behaviour).  
  
In addition, the patch extends the logical replication STREAM_ABORT  
message so that abort_lsn and abort_time can also be sent which can be  
used to update the replication origin in parallel apply worker when the  
streaming transaction is aborted. Because this message extension is needed  
to support parallel streaming, parallel streaming is not supported for  
publications on servers < PG16.  
  
Author: Hou Zhijie, Wang wei, Amit Kapila with design inputs from Sawada Masahiko  
Reviewed-by: Sawada Masahiko, Peter Smith, Dilip Kumar, Shi yu, Kuroda Hayato, Shveta Mallik  
Discussion: https://postgr.es/m/CAA4eK1+wyN6zpaHUkCLorEWNx75MG0xhMwcFhvjqm2KURZEAGw@mail.gmail.com  

M doc/src/sgml/catalogs.sgml
M doc/src/sgml/config.sgml
M doc/src/sgml/logical-replication.sgml
M doc/src/sgml/monitoring.sgml
M doc/src/sgml/protocol.sgml
M doc/src/sgml/ref/create_subscription.sgml
M doc/src/sgml/system-views.sgml
M src/backend/access/transam/xact.c
M src/backend/commands/subscriptioncmds.c
M src/backend/libpq/pqmq.c
M src/backend/postmaster/bgworker.c
M src/backend/postmaster/interrupt.c
M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/backend/replication/logical/Makefile
A src/backend/replication/logical/applyparallelworker.c
M src/backend/replication/logical/decode.c
M src/backend/replication/logical/launcher.c
M src/backend/replication/logical/meson.build
M src/backend/replication/logical/origin.c
M src/backend/replication/logical/proto.c
M src/backend/replication/logical/reorderbuffer.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/storage/ipc/procsignal.c
M src/backend/storage/lmgr/lmgr.c
M src/backend/tcop/postgres.c
M src/backend/utils/activity/wait_event.c
M src/backend/utils/adt/lockfuncs.c
M src/backend/utils/misc/guc_tables.c
M src/backend/utils/misc/postgresql.conf.sample
M src/bin/pg_dump/pg_dump.c
M src/bin/psql/describe.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_subscription.h
M src/include/commands/subscriptioncmds.h
M src/include/replication/logicallauncher.h
M src/include/replication/logicalproto.h
M src/include/replication/logicalworker.h
M src/include/replication/origin.h
M src/include/replication/pgoutput.h
M src/include/replication/reorderbuffer.h
M src/include/replication/walreceiver.h
M src/include/replication/worker_internal.h
M src/include/storage/lmgr.h
M src/include/storage/lock.h
M src/include/storage/procsignal.h
M src/include/utils/wait_event.h
M src/test/regress/expected/subscription.out
M src/test/regress/sql/subscription.sql
M src/test/subscription/t/015_stream.pl
M src/test/subscription/t/016_stream_subxact.pl
M src/test/subscription/t/017_stream_ddl.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/022_twophase_cascade.pl
M src/test/subscription/t/023_twophase_stream.pl
M src/tools/pgindent/typedefs.list

Doc: improve commentary about providing our own definitions of M_PI.

commit   : 5687e7810f1dd32ac1960e67b608c441d87bc229    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 8 Jan 2023 16:25:25 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 8 Jan 2023 16:25:25 -0500    

Click here for diff

M contrib/earthdistance/earthdistance.c
M src/bin/pgbench/pgbench.c
M src/include/utils/float.h

Improve GIN cost estimation

commit   : cd9479af2af25d7fa9bfd24dd4dcf976b360f077    
  
author   : Alexander Korotkov <akorotkov@postgresql.org>    
date     : Sun, 8 Jan 2023 22:34:59 +0300    
  
committer: Alexander Korotkov <akorotkov@postgresql.org>    
date     : Sun, 8 Jan 2023 22:34:59 +0300    

Click here for diff

GIN index scans were not taking any descent CPU-based cost into account.  That  
made them look cheaper than other types of indexes when they shouldn't be.  
  
We use the same heuristic as for btree indexes, but multiply it by the number  
of searched entries.  
  
Additionally, the CPU cost for the tree was based largely on a  
genericcostestimate.  For a GIN index, we should not charge index quals per  
tuple, but per entry. On top of this, charge cpu_index_tuple_cost per actual  
tuple.  
  
This should fix the cases where a GIN index is preferred over a btree and  
the ones where a memoize node is not added on top of the GIN index scan  
because it seemed too cheap.  
  
We don't packpatch this to evade unexpected plan changes in stable versions.  
  
Discussion: https://postgr.es/m/CABs3KGQnOkyQ42-zKQqiE7M0Ks9oWDSee%3D%2BJx3-TGq%3D68xqWYw%40mail.gmail.com  
Discussion: https://postgr.es/m/3188617.44csPzL39Z%40aivenronan  
Author: Ronan Dunklau  
Reported-By: Hung Nguyen  
Reviewed-by: Tom Lane, Alexander Korotkov  

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

Extract the multiplier for CPU process cost of index page into a macro

commit   : eb5c4e953bbd2fab07be74df93f4080bab60176c    
  
author   : Alexander Korotkov <akorotkov@postgresql.org>    
date     : Sun, 8 Jan 2023 22:37:33 +0300    
  
committer: Alexander Korotkov <akorotkov@postgresql.org>    
date     : Sun, 8 Jan 2023 22:37:33 +0300    

Click here for diff

B-tree, GiST and SP-GiST all charge 50.0 * cpu_operator_cost for processing  
an index page.  Extract this to a macro to avoid repeated magic numbers.  
  
Discussion: https://mail.google.com/mail/u/0/?ik=a20b091faa&view=om&permmsgid=msg-f%3A1751459697261369543  
Author: Ronan Dunklau  

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

Check relkind before using TABLESAMPLE in postgres_fdw

commit   : 57d11ef028d126f95595c08c62ffb4c5147d0f86    
  
author   : Tomas Vondra <tomas.vondra@postgresql.org>    
date     : Sat, 7 Jan 2023 14:22:09 +0100    
  
committer: Tomas Vondra <tomas.vondra@postgresql.org>    
date     : Sat, 7 Jan 2023 14:22:09 +0100    

Click here for diff

Check the remote relkind before trying to use TABLESAMPLE to acquire  
sample from the remote relation. Even if the remote server version has  
TABLESAMPLE support, the foreign table may point to incompatible relkind  
(e.g. a view or a sequence).  
  
If the relkind does not support TABLESAMPLE, error out if TABLESAMPLE  
was requested specifically (as system/bernoulli), or fallback to random  
just like we do for old server versions.  
  
We currently end up disabling sampling for such relkind values anyway,  
due to reltuples being -1 or 1, but that seems rather accidental, and  
might get broken by improving reltuples estimates, etc.  So better to  
make the check explicit.  
  
Reported-by: Tom Lane  
Discussion: https://postgr.es/m/951485.1672461744%40sss.pgh.pa.us  

M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/postgres_fdw.c
M contrib/postgres_fdw/postgres_fdw.h

psql: Add support for \dpS and \zS.

commit   : d913928c9c5e905d0062d1e7237b7fb5fbde61ed    
  
author   : Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Sat, 7 Jan 2023 11:09:26 +0000    
  
committer: Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Sat, 7 Jan 2023 11:09:26 +0000    

Click here for diff

This allows an optional "S" modifier to be added to \dp and \z, to  
have them include system objects in the list.  
  
Note that this also changes the behaviour of a bare \dp or \z without  
the "S" modifier to include temp objects in the list, and exclude  
information_schema objects, making them consistent with other psql  
meta-commands.  
  
Nathan Bossart, reviewed by Maxim Orlov.  
  
Discussion: https://postgr.es/m/20221206193606.GB3078082@nathanxps13  

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

Remove the streaming files for incomplete xacts after restart.

commit   : 2b6df05461cb540d8f103dfe55f38efc09b4189b    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Sat, 7 Jan 2023 12:17:14 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Sat, 7 Jan 2023 12:17:14 +0530    

Click here for diff

After restart, we try to stream the changes for large transactions that  
were not sent before server crash and restart. However, we forget to send  
the abort message for such transactions. This leads to spurious streaming  
files on the subscriber which won't be cleaned till the apply worker or  
the subscriber server restarts.  
  
Reported-by: Dilip Kumar  
Author: Hou Zhijie  
Reviewed-by: Dilip Kumar and Amit Kapila  
Backpatch-through: 14  
Discussion: https://postgr.es/m/OS0PR01MB5716A773F46768A1B75BE24394FB9@OS0PR01MB5716.jpnprd01.prod.outlook.com  

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

Add additional regression tests for select_active_windows

commit   : a14a5832923e10ef14a74864c94358d5bc8720e4    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Sat, 7 Jan 2023 15:24:35 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Sat, 7 Jan 2023 15:24:35 +1300    

Click here for diff

During the development of 728202b63, which was aimed at reducing the  
number of sorts required to evaluate multiple window functions with  
different WindowClause definitions, the code written sorted the  
WindowClauses in reverse tleSortGroupRef order.  There appears to be no  
discussion in the thread which was opened to discuss the development of  
this patch and no comments mentioning the fact that having the  
WindowClauses in reverse tleSortGroupRef order makes it more likely that  
the final WindowClause to be evaluated will provide presorted input to  
the query's DISTINCT or ORDER BY clause.  The reason for this is that the  
tleSortGroupRef indexes are assigned for the DISTINCT and ORDER BY clauses  
before they are for the WindowClauses PARTITION BY and ORDER BY clauses.  
Putting the WindowClause with the lowest tleSortGroupRef last means that  
it's more likely that no additional sorting is required for the query's  
DISTINCT or ORDER BY clause.  
  
All we're doing here is adding some tests and a comment to help ensure  
that remains true and that we don't accidentally forget to consider this  
again should we ever rewrite that code.  
  
Author: Ankit Kumar Pandey, David Rowley  
Discussion: https://postgr.es/m/CAApHDvq=g2=ny59f1bvwRVvupsgPHK-KjLPBsSL25fVuGZ4idQ@mail.gmail.com  

M src/backend/optimizer/plan/planner.c
M src/test/regress/expected/window.out
M src/test/regress/sql/window.sql

Wake up a subscription's replication worker processes after DDL.

commit   : c6e1f62e2cee817cad58cccc1dd685e908678241    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 6 Jan 2023 16:08:20 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 6 Jan 2023 16:08:20 -0500    

Click here for diff

Waken related worker processes immediately at commit of a transaction  
that has performed ALTER SUBSCRIPTION (including the RENAME and  
OWNER variants).  This reduces the response time for such operations.  
In the real world that might not be worth much, but it shaves several  
seconds off the runtime for the subscription test suite.  
  
In the case of PREPARE, we just throw away this notification state;  
it doesn't seem worth the work to preserve it.  The workers will  
still react after the eventual COMMIT PREPARED, but not as quickly.  
  
Nathan Bossart  
  
Discussion: https://postgr.es/m/20221122004119.GA132961@nathanxps13  

M src/backend/access/transam/xact.c
M src/backend/commands/alter.c
M src/backend/commands/subscriptioncmds.c
M src/backend/replication/logical/worker.c
M src/include/replication/logicalworker.h

Check for two_phase change at end of process_syncing_tables_for_apply.

commit   : 4c032dd8046b145a25032643f536aab83deb19e3    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 6 Jan 2023 15:35:31 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 6 Jan 2023 15:35:31 -0500    

Click here for diff

Previously this function checked to see if we were ready to switch  
to two_phase mode at its start, but that's silly: we should check  
at the end, after we've done the work that might make us ready.  
This simple change removes one sleep cycle from the time needed to  
switch to two_phase mode.  In the real world that might not be  
worth much, but it shaves a few seconds off the runtime for the  
subscription test suite.  
  
Nathan Bossart  
  
Discussion: https://postgr.es/m/20221122004119.GA132961@nathanxps13  

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

Allow hyphens in ltree labels

commit   : b1665bf01e5f4200d37addfc2ddc406ff7df14a5    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Fri, 6 Jan 2023 16:03:19 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Fri, 6 Jan 2023 16:03:19 -0500    

Click here for diff

Also increase the allowed length of labels to 1000 characters  
  
Garen Torikian  
  
Discussion: https://postgr.es/m/CAGXsc+-mNg9Gc0rp-ER0sv+zkZSZp2wE9-LX6XcoWSLVz22tZA@mail.gmail.com  

M contrib/ltree/expected/ltree.out
M contrib/ltree/ltree.h
M contrib/ltree/ltree_io.c
M contrib/ltree/ltxtquery_io.c
M contrib/ltree/sql/ltree.sql
M doc/src/sgml/ltree.sgml

Add options to control whether VACUUM runs vac_update_datfrozenxid.

commit   : a46a7011b27188af526047a111969f257aaf4db8    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 6 Jan 2023 14:17:25 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 6 Jan 2023 14:17:25 -0500    

Click here for diff

VACUUM normally ends by running vac_update_datfrozenxid(), which  
requires a scan of pg_class.  Therefore, if one attempts to vacuum a  
database one table at a time --- as vacuumdb has done since v12 ---  
we will spend O(N^2) time in vac_update_datfrozenxid().  That causes  
serious performance problems in databases with tens of thousands of  
tables, and indeed the effect is measurable with only a few hundred.  
To add insult to injury, only one process can run  
vac_update_datfrozenxid at the same time per DB, so this behavior  
largely defeats vacuumdb's -j option.  
  
Hence, invent options SKIP_DATABASE_STATS and ONLY_DATABASE_STATS  
to allow applications to postpone vac_update_datfrozenxid() until the  
end of a series of VACUUM requests, and teach vacuumdb to use them.  
  
Per bug #17717 from Gunnar L.  Sadly, this answer doesn't seem  
like something we'd consider back-patching, so the performance  
problem will remain in v12-v15.  
  
Tom Lane and Nathan Bossart  
  
Discussion: https://postgr.es/m/17717-6c50eb1c7d23a886@postgresql.org  

M doc/src/sgml/ref/vacuum.sgml
M src/backend/commands/vacuum.c
M src/backend/postmaster/autovacuum.c
M src/bin/psql/tab-complete.c
M src/bin/scripts/t/100_vacuumdb.pl
M src/bin/scripts/vacuumdb.c
M src/fe_utils/parallel_slot.c
M src/include/commands/vacuum.h
M src/test/regress/expected/vacuum.out
M src/test/regress/sql/vacuum.sql

Invalidate pgoutput's replication-decisions cache upon schema rename.

commit   : cd4b2334db4980bbf86a8ba1d446db17e62ca342    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 6 Jan 2023 11:11:51 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 6 Jan 2023 11:11:51 -0500    

Click here for diff

A schema rename should cause reporting the new qualified names of  
tables to logical replication subscribers, but that wasn't happening.  
Flush the RelationSyncCache to make it happen.  
  
(If you ask me, the new test case shows that the behavior in this area  
is still pretty dubious, but apparently it's operating as designed.)  
  
Vignesh C  
  
Discussion: https://postgr.es/m/CALDaNm32vLRv5KdrDFeVC-CU+4Wg1daA55hMqOxDGJBzvd76-w@mail.gmail.com  

M src/backend/replication/pgoutput/pgoutput.c
M src/test/subscription/t/100_bugs.pl

Fix stale comment about sample_frac adjustment

commit   : 211d80c065626d1a9188188d78ede85d799b93b1    
  
author   : Tomas Vondra <tomas.vondra@postgresql.org>    
date     : Fri, 6 Jan 2023 14:47:02 +0100    
  
committer: Tomas Vondra <tomas.vondra@postgresql.org>    
date     : Fri, 6 Jan 2023 14:47:02 +0100    

Click here for diff

A comment was left behind referencing sample rate adjustment removed  
from 8ad51b5f44. So clean that up. While at it also remove the sample  
rate clamping which should not be necessary without the clamping, and  
just check that with an assert.  
  
Reported-by: Tom Lane  
Discussion: https://postgr.es/m/951485.1672461744%40sss.pgh.pa.us  

M contrib/postgres_fdw/postgres_fdw.c

Fix typo

commit   : 4037c5e2fe9e2c7b083606435d29cdb25092f70f    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 6 Jan 2023 14:25:19 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 6 Jan 2023 14:25:19 +0100    

Click here for diff

This doesn't affect the correctness of the code, but it was clearly  
inconsistent before this change.  

M src/backend/parser/parse_node.c

Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET SCHEMA.

commit   : e7a59094b36a49df057b040611314c9a0b726d05    
  
author   : Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Fri, 6 Jan 2023 11:18:44 +0000    
  
committer: Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Fri, 6 Jan 2023 11:18:44 +0000    

Click here for diff

The ALTER DATABASE|FUNCTION|PROCEDURE|ROLE|ROUTINE|USER ... SET <name>  
case in psql tab completion failed to exclude <name> = "SCHEMA", which  
caused ALTER FUNCTION|PROCEDURE|ROUTINE ... SET SCHEMA to complete  
with "FROM CURRENT" and "TO", which won't work.  
  
Fix that, so that those cases now complete with the list of schemas,  
like other ALTER ... SET SCHEMA commands.  
  
Noticed while testing the recent patch to improve tab completion for  
ALTER FUNCTION/PROCEDURE/ROUTINE, but this is not directly related to  
that patch. Rather, this is a long-standing bug, so back-patch to all  
supported branches.  
  
Discussion: https://postgr.es/m/CALDaNm0s7GQmkLP_mx5Cvk=UzYMnjhPmXBxU8DsHEunFbC5sTg@mail.gmail.com  

M src/bin/psql/tab-complete.c

Improve tab completion for ALTER FUNCTION/PROCEDURE/ROUTINE.

commit   : a3bc631ea96a7c04962df3c97dbeac860be06c03    
  
author   : Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Fri, 6 Jan 2023 09:57:41 +0000    
  
committer: Dean Rasheed <dean.a.rasheed@gmail.com>    
date     : Fri, 6 Jan 2023 09:57:41 +0000    

Click here for diff

This adds psql tab completion for each of the actions supported by  
ALTER FUNCTION/PROCEDURE/ROUTINE.  
  
Vignesh C, reviewed by Dong Wook Lee, Michael Paquier, Melih Mutlu and  
me.  
  
Discussion: https://postgr.es/m/CALDaNm0s7GQmkLP_mx5Cvk=UzYMnjhPmXBxU8DsHEunFbC5sTg@mail.gmail.com  

M src/bin/psql/tab-complete.c

Fix pg_truncate() on Windows.

commit   : 72aea955d49712a17c08748aa9abcbcf98c32fc5    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 6 Jan 2023 16:38:46 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 6 Jan 2023 16:38:46 +1300    

Click here for diff

Commit 57faaf376 added pg_truncate(const char *path, off_t length), but  
"length" was ignored under WIN32 and the file was unconditionally  
truncated to 0.  
  
There was no live bug, since the only caller passes 0.  
  
Fix, and back-patch to 14 where the function arrived.  
  
Author: Justin Pryzby <pryzby@telsasoft.com>  
Discussion: https://postgr.es/m/20230106031652.GR3109%40telsasoft.com  

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

Use unnamed POSIX semaphores on Cygwin.

commit   : f2857af485a00ab5dbfa2c83af9d83afe4378239    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 6 Jan 2023 10:09:02 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 6 Jan 2023 10:09:02 +1300    

Click here for diff

Testing on CI showed that Cygwin's semctl() can fail with EAGAIN  
(possibly due to resource limits in cygserver that could be tuned, not  
examined).  Switch to so-called POSIX semaphores instead, which don't  
seem to fail in that way (possibly due to a more direct implementation  
using Windows semaphore primitives instead of talking to cygserver,  
based on a cursory glance at the source).  
  
Other known problems still prevent PostgreSQL from running on Cygwin  
without random crashes, but this rarer problem was noticed while  
testing.  
  
Discussion: https://postgr.es/m/CA%2BhUKG%2BQ6DU4Ov9LrvUyDcF3oHS4KMRVSKmVGaeePq-kOyG9gA%40mail.gmail.com  

M meson.build
M src/template/cygwin

Pass down current user ID to AddRoleMems and DelRoleMems.

commit   : 39cffe95f2c5d77a268db9f04c2b2aaf2294ad76    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Thu, 5 Jan 2023 14:33:35 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Thu, 5 Jan 2023 14:33:35 -0500    

Click here for diff

This is just refactoring; there should be no functonal change. It  
might have the effect of slightly reducing the number of calls to  
GetUserId(), but the real point is to facilitate future work in  
this area.  
  
Patch by me, reviewed by Mark Dilger.  
  
Discussion: http://postgr.es/m/CA+TgmobFzTLkLwOquFrAcdsWBsOWDr-_H-jw+qBvfx-wSzMwDA@mail.gmail.com  

M src/backend/commands/user.c

Refactor permissions-checking for role grants.

commit   : 25bb03166b16db1faf18c677ed88f046fb08103f    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Thu, 5 Jan 2023 14:30:40 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Thu, 5 Jan 2023 14:30:40 -0500    

Click here for diff

Instead of having checks in AddRoleMems() and DelRoleMems(), have  
the callers perform checks where it's required. In some cases it  
isn't, either because the caller has already performed a check for  
the same condition, or because the check couldn't possibly fail.  
  
The "Skip permission check if nothing to do" check in each of  
AddRoleMems() and DelRoleMems() is pointless. Some call sites  
can't pass an empty list. Others can, but in those cases, the role  
being modified is one that the current user has just created.  
Therefore, they must have permission to modify it, and so no  
permission check is required at all.  
  
This patch is intended to have no user-visible consequences. It is  
intended to simplify future work in this area.  
  
Patch by me, reviewed by Mark Dilger.  
  
Discussion: http://postgr.es/m/CA+TgmobFzTLkLwOquFrAcdsWBsOWDr-_H-jw+qBvfx-wSzMwDA@mail.gmail.com  

M src/backend/commands/user.c

Fix calculation of which GENERATED columns need to be updated.

commit   : 3f7836ff651ad710fef52fa87b248ecdfc6468dc    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 5 Jan 2023 14:12:17 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 5 Jan 2023 14:12:17 -0500    

Click here for diff

We were identifying the updatable generated columns of inheritance  
children by transposing the calculation made for their parent.  
However, there's nothing that says a traditional-inheritance child  
can't have generated columns that aren't there in its parent, or that  
have different dependencies than are in the parent's expression.  
(At present it seems that we don't enforce that for partitioning  
either, which is likely wrong to some degree or other; but the case  
clearly needs to be handled with traditional inheritance.)  
  
Hence, drop the very-klugy-anyway "extraUpdatedCols" RTE field  
in favor of identifying which generated columns depend on updated  
columns during executor startup.  In HEAD we can remove  
extraUpdatedCols altogether; in back branches, it's still there but  
always empty.  Another difference between the HEAD and back-branch  
versions of this patch is that in HEAD we can add the new bitmap field  
to ResultRelInfo, but that would cause an ABI break in back branches.  
Like 4b3e37993, add a List field at the end of struct EState instead.  
  
Back-patch to v13.  The bogus calculation is also being made in v12,  
but it doesn't have the same visible effect because we don't use it  
to decide which generated columns to recalculate; as a consequence of  
which the patch doesn't apply easily.  I think that there might still  
be a demonstrable bug associated with trigger firing conditions, but  
that's such a weird corner-case usage that I'm content to leave it  
unfixed in v12.  
  
Amit Langote and Tom Lane  
  
Discussion: https://postgr.es/m/CA+HiwqFshLKNvQUd1DgwJ-7tsTp=dwv7KZqXC4j2wYBV1aCDUA@mail.gmail.com  
Discussion: https://postgr.es/m/2793383.1672944799@sss.pgh.pa.us  

M src/backend/executor/execMain.c
M src/backend/executor/execUtils.c
M src/backend/executor/nodeModifyTable.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/readfuncs.c
M src/backend/optimizer/util/inherit.c
M src/backend/optimizer/util/plancat.c
M src/backend/replication/logical/worker.c
M src/backend/rewrite/rewriteHandler.c
M src/include/nodes/execnodes.h
M src/include/nodes/parsenodes.h
M src/include/optimizer/plancat.h
M src/include/rewrite/rewriteHandler.h
M src/test/regress/expected/generated.out
M src/test/regress/sql/generated.sql

Remove extra regress check arguments from test_pg_db_role_setting

commit   : 529da086ba7ff8475e469290210ce944ad30975a    
  
author   : Alexander Korotkov <akorotkov@postgresql.org>    
date     : Thu, 5 Jan 2023 13:11:40 +0300    
  
committer: Alexander Korotkov <akorotkov@postgresql.org>    
date     : Thu, 5 Jan 2023 13:11:40 +0300    

Click here for diff

They were accidentally copied from test_oat_hooks.  
  
Reported-by: Justin Pryzby  
Discussion: https://postgr.es/m/20230102154240.GL1153%40telsasoft.com  
Reviewed-by: Pavel Borisov  

M src/test/modules/test_pg_db_role_setting/Makefile
M src/test/modules/test_pg_db_role_setting/meson.build

meson: Add 'running' test setup, as a replacement for installcheck

commit   : afdd9f7f0e001f109472df513eb416cc967bc199    
  
author   : Alexander Korotkov <akorotkov@postgresql.org>    
date     : Thu, 5 Jan 2023 13:11:28 +0300    
  
committer: Alexander Korotkov <akorotkov@postgresql.org>    
date     : Thu, 5 Jan 2023 13:11:28 +0300    

Click here for diff

Do the same as 3f0e786ccbf5 for test_pg_db_role_setting.  
  
Discussion: https://postgr.es/m/20221227065456.GU1153@telsasoft.com  
Author: Pavel Borisov  
Reviewed-by: Justin Pryzby, Tom Lane  

M src/test/modules/test_pg_db_role_setting/meson.build

Fix some compiler warnings in aset.c and generation.c

commit   : b82557ecc2ebbf649142740a1c5ce8d19089f620    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Thu, 5 Jan 2023 12:56:17 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Thu, 5 Jan 2023 12:56:17 +1300    

Click here for diff

This fixes a couple of unused variable warnings that could be seen when  
compiling with MEMORY_CONTEXT_CHECKING but not USE_ASSERT_CHECKING.  
Defining MEMORY_CONTEXT_CHECKING without asserts is a little unusual,  
however, we shouldn't be producing any warnings from such a build.  
  
Author: Richard Guo  
Discussion: https://postgr.es/m/CAMbWs4_D-vgLEh7eO47p=73u1jWO78NWf6Qfv1FndY1kG-Q-jA@mail.gmail.com  

M src/backend/utils/mmgr/aset.c
M src/backend/utils/mmgr/generation.c

Check that xmax didn't commit in freeze check.

commit   : eb5ad4ff05fd382ac98cab60b82f7fd6ce4cfeb8    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Tue, 3 Jan 2023 21:48:27 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Tue, 3 Jan 2023 21:48:27 -0800    

Click here for diff

We cannot rely on TransactionIdDidAbort here, since in general it may  
report transactions that were in-progress at the time of an earlier hard  
crash as not aborted, effectively behaving as if they were still in  
progress even after crash recovery completes.  Go back to defensively  
verifying that xmax didn't commit instead.  
  
Oversight in commit 79d4bf4e.  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Reported-By: Andres Freund <andres@anarazel.de>  
Discussion: https://postgr.es/m/20230104035636.hy5djyr2as4gbc4q@awork3.anarazel.de  

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

Update obsolete multixact.c comments.

commit   : 5212d447fa53518458cbe609092b347803a667c5    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Tue, 3 Jan 2023 16:54:35 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Tue, 3 Jan 2023 16:54:35 -0800    

Click here for diff

Commit 4f627f89 switched SLRU truncation for multixacts back to being a  
task performed during VACUUM, but missed some comments that continued to  
reference truncation happening as part of checkpointing.  Update those  
comments now.  
  
Also update comments that became obsolete when commit c3ffa731 changed  
the way that vacuum_multixact_freeze_min_age is applied by VACUUM as it  
computes its MultiXactCutoff cutoff (which is used by VACUUM to decide  
what to freeze).  Explain the same issues by referencing how OldestMxact  
is the latest valid value that relminmxid can ever be advanced to at the  
end of a VACUUM (following the work in commit 0b018fab).  

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

During pg_dump startup, acquire table locks in batches.

commit   : 5f53b42cfd053a724fcbe0712a9d5716e576a3e6    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 3 Jan 2023 17:56:37 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 3 Jan 2023 17:56:37 -0500    

Click here for diff

Combine multiple LOCK TABLE commands to reduce the number of  
round trips to the server.  This is particularly helpful when  
dumping from a remote server, but it seems useful even without  
that.  In particular, shortening the time from seeing a table  
in pg_class to acquiring lock on it reduces the window for  
trouble from concurrent DDL.  
  
Aleksander Alekseev, reviewed by Fabrízio de Royes Mello,  
Gilles Darold, and Andres Freund  
  
Discussion: https://postgr.es/m/CAJ7c6TO4z1+OBa-R+fC8FnaUgbEWJUf2Kq=nRngTW5EXtKru2g@mail.gmail.com  

M src/bin/pg_dump/pg_dump.c

Fix typo in memutils_memorychunk.h

commit   : b23837dde48028f9e31983c765c32e3f42cb7ef2    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Wed, 4 Jan 2023 09:23:19 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Wed, 4 Jan 2023 09:23:19 +1300    

Click here for diff

Author: Richard Guo  
Discussion: https://postgr.es/m/CAMbWs483CYjHoLH32_hd3Yq1NJfravNdL2zy7+e7pwvFPJF1RQ@mail.gmail.com  

M src/include/utils/memutils_memorychunk.h

Improve documentation of the CREATEROLE attibute.

commit   : 1c77873727dfd2e48ab2ece84d1fb1676e95f9a5    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Tue, 3 Jan 2023 14:50:40 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Tue, 3 Jan 2023 14:50:40 -0500    

Click here for diff

In user-manag.sgml, document precisely what privileges are conveyed  
by CREATEROLE. Make particular note of the fact that it allows  
changing passwords and granting access to high-privilege roles.  
Also remove the suggestion of using a user with CREATEROLE and  
CREATEDB instead of a superuser, as there is no real security  
advantage to this approach.  
  
Elsewhere in the documentation, adjust text that suggests that  
<literal>CREATEROLE</literal> only allows for role creation, and  
refer to the documentation in user-manag.sgml as appropriate.  
  
Patch by me, reviewed by Álvaro Herrera  
  
Discussion: http://postgr.es/m/CA+TgmoZBsPL8nPhvYecx7iGo5qpDRqa9k_AcaW1SbOjugAY1Ag@mail.gmail.com  

M doc/src/sgml/ref/alter_role.sgml
M doc/src/sgml/ref/create_role.sgml
M doc/src/sgml/ref/createuser.sgml
M doc/src/sgml/user-manag.sgml

vacuumlazy.c: Save get_database_name() in vacrel.

commit   : 54afdcd6182af709cb0ab775c11b90decff166eb    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Tue, 3 Jan 2023 11:48:47 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Tue, 3 Jan 2023 11:48:47 -0800    

Click here for diff

This brings dbname strings in line with namespace and relation name  
strings.  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Discussion: https://postgr.es/m/CAH2-WzkQ1TKU-DdNvnGeL870di3+CU1UTo-7nw7xFDpVE-XGjA@mail.gmail.com  

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

Delay commit status checks until freezing executes.

commit   : 79d4bf4eff14d8967b10ad4c60039c1b9b0cf66e    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Tue, 3 Jan 2023 11:22:36 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Tue, 3 Jan 2023 11:22:36 -0800    

Click here for diff

pg_xact lookups are relatively expensive.  Move the xmin/xmax commit  
status checks from the point that freeze plans are prepared to the point  
that they're actually executed.  Otherwise we'll repeat many commit  
status checks whenever multiple successive VACUUM operations scan the  
same pages and decide against freezing each time, which is a waste of  
cycles.  
  
Oversight in commit 1de58df4, which added page-level freezing.  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Discussion: https://postgr.es/m/CAH2-WzkZpe4K6qMfEt8H4qYJCKc2R7TPvKsBva7jc9w7iGXQSw@mail.gmail.com  

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

Refine the definition of page-level freezing.

commit   : b37a0832396414e8469d4ee4daea33396bde39b0    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Tue, 3 Jan 2023 10:08:55 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Tue, 3 Jan 2023 10:08:55 -0800    

Click here for diff

Improve comments added by commit 1de58df4 which describe the  
lazy_scan_prune "freeze the page" path.  These newly revised comments  
are based on suggestions from Jeff Davis.  
  
In passing, remove nearby visibility_cutoff_xid comments left over from  
commit 6daeeb1f.  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Reviewed-By: Jeff Davis <pgsql@j-davis.com>  
Discussion: https://postgr.es/m/ebc857107fe3edd422ef8a65191ca4a8da568b9b.camel@j-davis.com  

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

Windows support in pg_import_system_collations

commit   : bf03cfd162176d543da79f9398131abc251ddbb9    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Tue, 3 Jan 2023 14:21:40 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Tue, 3 Jan 2023 14:21:40 +0100    

Click here for diff

Windows can enumerate the locales that are either installed or  
supported by calling EnumSystemLocalesEx(), similar to what is already  
done in the READ_LOCALE_A_OUTPUT switch.  We can refactor some of the  
logic already used in that switch into a new function  
create_collation_from_locale().  
  
The enumerated locales have BCP 47 shape, that is with a hyphen  
between language and territory, instead of POSIX's underscore.  The  
created collations will retain the BCP 47 shape, but we will also  
create a POSIX alias, so xx-YY will have an xx_YY alias.  
  
A new test collate.windows.win1252 is added that is like  
collate.linux.utf8.  
  
Author: Juan Jose Santamaria Flecha <juanjo.santamaria@gmail.com>  
Reviewed-by: Dmitry Koval <d.koval@postgrespro.ru>  
Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com>  
Discussion: https://www.postgresql.org/message-id/flat/0050ec23-34d9-2765-9015-98c04f0e18ac@postgrespro.ru  

M src/backend/commands/collationcmds.c
A src/test/regress/expected/collate.windows.win1252.out
A src/test/regress/expected/collate.windows.win1252_1.out
M src/test/regress/parallel_schedule
A src/test/regress/sql/collate.windows.win1252.sql
M src/tools/msvc/vcregress.pl

Fix typos in comments, code and documentation

commit   : 33ab0a2a527e3af5beee3a98fc07201e555d6e45    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Tue, 3 Jan 2023 16:26:14 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Tue, 3 Jan 2023 16:26:14 +0900    

Click here for diff

While on it, newlines are removed from the end of two elog() strings.  
The others are simple grammar mistakes.  One comment in pg_upgrade  
referred incorrectly to sequences since a7e5457.  
  
Author: Justin Pryzby  
Discussion: https://postgr.es/m/20221230231257.GI1153@telsasoft.com  
Backpatch-through: 11  

M .cirrus.yml
M doc/src/sgml/auto-explain.sgml
M doc/src/sgml/parallel.sgml
M doc/src/sgml/ref/alter_table.sgml
M doc/src/sgml/ref/create_subscription.sgml
M doc/src/sgml/ref/grant.sgml
M doc/src/sgml/sources.sgml
M doc/src/sgml/syntax.sgml
M meson.build
M src/backend/access/common/bufmask.c
M src/backend/access/spgist/spgutils.c
M src/backend/jit/llvm/llvmjit.c
M src/backend/optimizer/util/tlist.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/misc/guc_internal.h
M src/bin/pg_dump/pg_dumpall.c
M src/bin/pg_upgrade/info.c
M src/include/lib/ilist.h
M src/test/regress/expected/copy.out
M src/test/regress/expected/expressions.out
M src/test/regress/sql/copy.sql
M src/test/regress/sql/expressions.sql
M src/test/ssl/t/SSL/Server.pm

Avoid reference to nonexistent array element in ExecInitAgg().

commit   : 92957ed98c5c565362ce665266132a7f08f6b0c0    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 2 Jan 2023 16:17:00 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 2 Jan 2023 16:17:00 -0500    

Click here for diff

When considering an empty grouping set, we fetched  
phasedata->eqfunctions[-1].  Because the eqfunctions array is  
palloc'd, that would always be an aset pointer in released versions,  
and thus the code accidentally failed to malfunction (since it would  
do nothing unless it found a null pointer).  Nonetheless this seems  
like trouble waiting to happen, so add a check for length == 0.  
  
It's depressing that our valgrind testing did not catch this.  
Maybe we should reconsider the choice to not mark that word NOACCESS?  
  
Richard Guo  
  
Discussion: https://postgr.es/m/CAMbWs4-vZuuPOZsKOYnSAaPYGKhmacxhki+vpOKk0O7rymccXQ@mail.gmail.com  

M src/backend/executor/nodeAgg.c

commit   : c8e1ba736b2b9e8c98d37a5b77c4ed31baf94147    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Mon, 2 Jan 2023 15:00:37 -0500    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Mon, 2 Jan 2023 15:00:37 -0500    

Click here for diff

Backpatch-through: 11  

M COPYRIGHT
M configure
M configure.ac
M contrib/adminpack/adminpack.c
M contrib/adminpack/meson.build
M contrib/amcheck/meson.build
M contrib/amcheck/t/001_verify_heapam.pl
M contrib/amcheck/t/002_cic.pl
M contrib/amcheck/t/003_cic_2pc.pl
M contrib/amcheck/verify_heapam.c
M contrib/amcheck/verify_nbtree.c
M contrib/auth_delay/auth_delay.c
M contrib/auth_delay/meson.build
M contrib/auto_explain/auto_explain.c
M contrib/auto_explain/meson.build
M contrib/auto_explain/t/001_auto_explain.pl
M contrib/basebackup_to_shell/basebackup_to_shell.c
M contrib/basebackup_to_shell/meson.build
M contrib/basebackup_to_shell/t/001_basic.pl
M contrib/basic_archive/basic_archive.c
M contrib/basic_archive/meson.build
M contrib/bloom/blcost.c
M contrib/bloom/blinsert.c
M contrib/bloom/bloom.h
M contrib/bloom/blscan.c
M contrib/bloom/blutils.c
M contrib/bloom/blvacuum.c
M contrib/bloom/blvalidate.c
M contrib/bloom/meson.build
M contrib/bloom/t/001_wal.pl
M contrib/bool_plperl/meson.build
M contrib/btree_gin/meson.build
M contrib/btree_gist/meson.build
M contrib/citext/meson.build
M contrib/cube/meson.build
M contrib/dblink/dblink.c
M contrib/dblink/meson.build
M contrib/dict_int/dict_int.c
M contrib/dict_int/meson.build
M contrib/dict_xsyn/dict_xsyn.c
M contrib/dict_xsyn/meson.build
M contrib/earthdistance/meson.build
M contrib/file_fdw/file_fdw.c
M contrib/file_fdw/meson.build
M contrib/fuzzystrmatch/fuzzystrmatch.c
M contrib/fuzzystrmatch/meson.build
M contrib/hstore/hstore_subs.c
M contrib/hstore/meson.build
M contrib/hstore_plperl/meson.build
M contrib/hstore_plpython/meson.build
M contrib/intagg/meson.build
M contrib/intarray/_int_selfuncs.c
M contrib/intarray/bench/bench.pl
M contrib/intarray/bench/create_test.pl
M contrib/intarray/meson.build
M contrib/isn/isn.c
M contrib/isn/isn.h
M contrib/isn/meson.build
M contrib/jsonb_plperl/meson.build
M contrib/jsonb_plpython/meson.build
M contrib/lo/meson.build
M contrib/ltree/meson.build
M contrib/ltree_plpython/meson.build
M contrib/meson.build
M contrib/oid2name/meson.build
M contrib/oid2name/t/001_basic.pl
M contrib/old_snapshot/meson.build
M contrib/old_snapshot/time_mapping.c
M contrib/pageinspect/brinfuncs.c
M contrib/pageinspect/fsmfuncs.c
M contrib/pageinspect/ginfuncs.c
M contrib/pageinspect/gistfuncs.c
M contrib/pageinspect/hashfuncs.c
M contrib/pageinspect/heapfuncs.c
M contrib/pageinspect/meson.build
M contrib/pageinspect/pageinspect.h
M contrib/pageinspect/rawpage.c
M contrib/passwordcheck/meson.build
M contrib/passwordcheck/passwordcheck.c
M contrib/pg_buffercache/meson.build
M contrib/pg_freespacemap/meson.build
M contrib/pg_prewarm/autoprewarm.c
M contrib/pg_prewarm/meson.build
M contrib/pg_prewarm/pg_prewarm.c
M contrib/pg_prewarm/t/001_basic.pl
M contrib/pg_stat_statements/meson.build
M contrib/pg_stat_statements/pg_stat_statements.c
M contrib/pg_surgery/heap_surgery.c
M contrib/pg_surgery/meson.build
M contrib/pg_trgm/meson.build
M contrib/pg_trgm/trgm_regexp.c
M contrib/pg_visibility/meson.build
M contrib/pg_visibility/pg_visibility.c
M contrib/pg_walinspect/meson.build
M contrib/pg_walinspect/pg_walinspect.c
M contrib/pgcrypto/meson.build
M contrib/pgrowlocks/meson.build
M contrib/pgstattuple/meson.build
M contrib/pgstattuple/pgstatapprox.c
M contrib/postgres_fdw/connection.c
M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/meson.build
M contrib/postgres_fdw/option.c
M contrib/postgres_fdw/postgres_fdw.c
M contrib/postgres_fdw/postgres_fdw.h
M contrib/postgres_fdw/shippable.c
M contrib/seg/meson.build
M contrib/seg/seg-validate.pl
M contrib/seg/sort-segments.pl
M contrib/sepgsql/database.c
M contrib/sepgsql/dml.c
M contrib/sepgsql/hooks.c
M contrib/sepgsql/label.c
M contrib/sepgsql/launcher
M contrib/sepgsql/meson.build
M contrib/sepgsql/proc.c
M contrib/sepgsql/relation.c
M contrib/sepgsql/schema.c
M contrib/sepgsql/selinux.c
M contrib/sepgsql/sepgsql.h
M contrib/sepgsql/uavc.c
M contrib/spi/meson.build
M contrib/sslinfo/meson.build
M contrib/tablefunc/meson.build
M contrib/tablefunc/tablefunc.c
M contrib/tablefunc/tablefunc.h
M contrib/tcn/meson.build
M contrib/tcn/tcn.c
M contrib/test_decoding/meson.build
M contrib/test_decoding/t/001_repl_stats.pl
M contrib/test_decoding/test_decoding.c
M contrib/tsm_system_rows/meson.build
M contrib/tsm_system_rows/tsm_system_rows.c
M contrib/tsm_system_time/meson.build
M contrib/tsm_system_time/tsm_system_time.c
M contrib/unaccent/meson.build
M contrib/unaccent/unaccent.c
M contrib/uuid-ossp/meson.build
M contrib/uuid-ossp/uuid-ossp.c
M contrib/vacuumlo/meson.build
M contrib/vacuumlo/t/001_basic.pl
M contrib/vacuumlo/vacuumlo.c
M contrib/xml2/meson.build
M doc/src/sgml/generate-errcodes-table.pl
M doc/src/sgml/generate-keywords-table.pl
M doc/src/sgml/legal.sgml
M doc/src/sgml/lobj.sgml
M doc/src/sgml/meson.build
M meson.build
M meson_options.txt
M src/backend/Makefile
M src/backend/access/brin/brin.c
M src/backend/access/brin/brin_bloom.c
M src/backend/access/brin/brin_inclusion.c
M src/backend/access/brin/brin_minmax.c
M src/backend/access/brin/brin_minmax_multi.c
M src/backend/access/brin/brin_pageops.c
M src/backend/access/brin/brin_revmap.c
M src/backend/access/brin/brin_tuple.c
M src/backend/access/brin/brin_validate.c
M src/backend/access/brin/brin_xlog.c
M src/backend/access/brin/meson.build
M src/backend/access/common/attmap.c
M src/backend/access/common/bufmask.c
M src/backend/access/common/detoast.c
M src/backend/access/common/heaptuple.c
M src/backend/access/common/indextuple.c
M src/backend/access/common/meson.build
M src/backend/access/common/printsimple.c
M src/backend/access/common/printtup.c
M src/backend/access/common/relation.c
M src/backend/access/common/reloptions.c
M src/backend/access/common/scankey.c
M src/backend/access/common/session.c
M src/backend/access/common/syncscan.c
M src/backend/access/common/toast_compression.c
M src/backend/access/common/toast_internals.c
M src/backend/access/common/tupconvert.c
M src/backend/access/common/tupdesc.c
M src/backend/access/gin/ginarrayproc.c
M src/backend/access/gin/ginbtree.c
M src/backend/access/gin/ginbulk.c
M src/backend/access/gin/gindatapage.c
M src/backend/access/gin/ginentrypage.c
M src/backend/access/gin/ginfast.c
M src/backend/access/gin/ginget.c
M src/backend/access/gin/gininsert.c
M src/backend/access/gin/ginlogic.c
M src/backend/access/gin/ginpostinglist.c
M src/backend/access/gin/ginscan.c
M src/backend/access/gin/ginutil.c
M src/backend/access/gin/ginvacuum.c
M src/backend/access/gin/ginvalidate.c
M src/backend/access/gin/ginxlog.c
M src/backend/access/gin/meson.build
M src/backend/access/gist/gist.c
M src/backend/access/gist/gistbuild.c
M src/backend/access/gist/gistbuildbuffers.c
M src/backend/access/gist/gistget.c
M src/backend/access/gist/gistproc.c
M src/backend/access/gist/gistscan.c
M src/backend/access/gist/gistsplit.c
M src/backend/access/gist/gistutil.c
M src/backend/access/gist/gistvacuum.c
M src/backend/access/gist/gistvalidate.c
M src/backend/access/gist/gistxlog.c
M src/backend/access/gist/meson.build
M src/backend/access/hash/hash.c
M src/backend/access/hash/hash_xlog.c
M src/backend/access/hash/hashfunc.c
M src/backend/access/hash/hashinsert.c
M src/backend/access/hash/hashovfl.c
M src/backend/access/hash/hashpage.c
M src/backend/access/hash/hashsearch.c
M src/backend/access/hash/hashsort.c
M src/backend/access/hash/hashutil.c
M src/backend/access/hash/hashvalidate.c
M src/backend/access/hash/meson.build
M src/backend/access/heap/heapam.c
M src/backend/access/heap/heapam_handler.c
M src/backend/access/heap/heapam_visibility.c
M src/backend/access/heap/heaptoast.c
M src/backend/access/heap/hio.c
M src/backend/access/heap/meson.build
M src/backend/access/heap/pruneheap.c
M src/backend/access/heap/rewriteheap.c
M src/backend/access/heap/vacuumlazy.c
M src/backend/access/heap/visibilitymap.c
M src/backend/access/index/amapi.c
M src/backend/access/index/amvalidate.c
M src/backend/access/index/genam.c
M src/backend/access/index/indexam.c
M src/backend/access/index/meson.build
M src/backend/access/meson.build
M src/backend/access/nbtree/meson.build
M src/backend/access/nbtree/nbtcompare.c
M src/backend/access/nbtree/nbtdedup.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/nbtsplitloc.c
M src/backend/access/nbtree/nbtutils.c
M src/backend/access/nbtree/nbtvalidate.c
M src/backend/access/nbtree/nbtxlog.c
M src/backend/access/rmgrdesc/brindesc.c
M src/backend/access/rmgrdesc/clogdesc.c
M src/backend/access/rmgrdesc/committsdesc.c
M src/backend/access/rmgrdesc/dbasedesc.c
M src/backend/access/rmgrdesc/genericdesc.c
M src/backend/access/rmgrdesc/gindesc.c
M src/backend/access/rmgrdesc/gistdesc.c
M src/backend/access/rmgrdesc/hashdesc.c
M src/backend/access/rmgrdesc/heapdesc.c
M src/backend/access/rmgrdesc/logicalmsgdesc.c
M src/backend/access/rmgrdesc/meson.build
M src/backend/access/rmgrdesc/mxactdesc.c
M src/backend/access/rmgrdesc/nbtdesc.c
M src/backend/access/rmgrdesc/relmapdesc.c
M src/backend/access/rmgrdesc/replorigindesc.c
M src/backend/access/rmgrdesc/seqdesc.c
M src/backend/access/rmgrdesc/smgrdesc.c
M src/backend/access/rmgrdesc/spgdesc.c
M src/backend/access/rmgrdesc/standbydesc.c
M src/backend/access/rmgrdesc/tblspcdesc.c
M src/backend/access/rmgrdesc/xactdesc.c
M src/backend/access/rmgrdesc/xlogdesc.c
M src/backend/access/spgist/meson.build
M src/backend/access/spgist/spgdoinsert.c
M src/backend/access/spgist/spginsert.c
M src/backend/access/spgist/spgkdtreeproc.c
M src/backend/access/spgist/spgproc.c
M src/backend/access/spgist/spgquadtreeproc.c
M src/backend/access/spgist/spgscan.c
M src/backend/access/spgist/spgtextproc.c
M src/backend/access/spgist/spgutils.c
M src/backend/access/spgist/spgvacuum.c
M src/backend/access/spgist/spgvalidate.c
M src/backend/access/spgist/spgxlog.c
M src/backend/access/table/meson.build
M src/backend/access/table/table.c
M src/backend/access/table/tableam.c
M src/backend/access/table/tableamapi.c
M src/backend/access/table/toast_helper.c
M src/backend/access/tablesample/bernoulli.c
M src/backend/access/tablesample/meson.build
M src/backend/access/tablesample/system.c
M src/backend/access/tablesample/tablesample.c
M src/backend/access/transam/clog.c
M src/backend/access/transam/commit_ts.c
M src/backend/access/transam/generic_xlog.c
M src/backend/access/transam/meson.build
M src/backend/access/transam/multixact.c
M src/backend/access/transam/parallel.c
M src/backend/access/transam/slru.c
M src/backend/access/transam/subtrans.c
M src/backend/access/transam/timeline.c
M src/backend/access/transam/transam.c
M src/backend/access/transam/twophase.c
M src/backend/access/transam/twophase_rmgr.c
M src/backend/access/transam/varsup.c
M src/backend/access/transam/xact.c
M src/backend/access/transam/xlog.c
M src/backend/access/transam/xlogarchive.c
M src/backend/access/transam/xlogbackup.c
M src/backend/access/transam/xlogfuncs.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/access/transam/xlogstats.c
M src/backend/access/transam/xlogutils.c
M src/backend/backup/backup_manifest.c
M src/backend/backup/basebackup.c
M src/backend/backup/basebackup_copy.c
M src/backend/backup/basebackup_gzip.c
M src/backend/backup/basebackup_lz4.c
M src/backend/backup/basebackup_progress.c
M src/backend/backup/basebackup_sink.c
M src/backend/backup/basebackup_target.c
M src/backend/backup/basebackup_throttle.c
M src/backend/backup/basebackup_zstd.c
M src/backend/backup/meson.build
M src/backend/bootstrap/bootparse.y
M src/backend/bootstrap/bootscanner.l
M src/backend/bootstrap/bootstrap.c
M src/backend/bootstrap/meson.build
M src/backend/catalog/Catalog.pm
M src/backend/catalog/Makefile
M src/backend/catalog/aclchk.c
M src/backend/catalog/catalog.c
M src/backend/catalog/dependency.c
M src/backend/catalog/genbki.pl
M src/backend/catalog/heap.c
M src/backend/catalog/index.c
M src/backend/catalog/indexing.c
M src/backend/catalog/information_schema.sql
M src/backend/catalog/meson.build
M src/backend/catalog/namespace.c
M src/backend/catalog/objectaccess.c
M src/backend/catalog/objectaddress.c
M src/backend/catalog/partition.c
M src/backend/catalog/pg_aggregate.c
M src/backend/catalog/pg_attrdef.c
M src/backend/catalog/pg_cast.c
M src/backend/catalog/pg_class.c
M src/backend/catalog/pg_collation.c
M src/backend/catalog/pg_constraint.c
M src/backend/catalog/pg_conversion.c
M src/backend/catalog/pg_db_role_setting.c
M src/backend/catalog/pg_depend.c
M src/backend/catalog/pg_enum.c
M src/backend/catalog/pg_inherits.c
M src/backend/catalog/pg_largeobject.c
M src/backend/catalog/pg_namespace.c
M src/backend/catalog/pg_operator.c
M src/backend/catalog/pg_parameter_acl.c
M src/backend/catalog/pg_proc.c
M src/backend/catalog/pg_publication.c
M src/backend/catalog/pg_range.c
M src/backend/catalog/pg_shdepend.c
M src/backend/catalog/pg_subscription.c
M src/backend/catalog/pg_type.c
M src/backend/catalog/storage.c
M src/backend/catalog/system_functions.sql
M src/backend/catalog/system_views.sql
M src/backend/catalog/toasting.c
M src/backend/commands/aggregatecmds.c
M src/backend/commands/alter.c
M src/backend/commands/amcmds.c
M src/backend/commands/analyze.c
M src/backend/commands/async.c
M src/backend/commands/cluster.c
M src/backend/commands/collationcmds.c
M src/backend/commands/comment.c
M src/backend/commands/constraint.c
M src/backend/commands/conversioncmds.c
M src/backend/commands/copy.c
M src/backend/commands/copyfrom.c
M src/backend/commands/copyfromparse.c
M src/backend/commands/copyto.c
M src/backend/commands/createas.c
M src/backend/commands/dbcommands.c
M src/backend/commands/define.c
M src/backend/commands/discard.c
M src/backend/commands/dropcmds.c
M src/backend/commands/event_trigger.c
M src/backend/commands/explain.c
M src/backend/commands/extension.c
M src/backend/commands/foreigncmds.c
M src/backend/commands/functioncmds.c
M src/backend/commands/indexcmds.c
M src/backend/commands/lockcmds.c
M src/backend/commands/matview.c
M src/backend/commands/meson.build
M src/backend/commands/opclasscmds.c
M src/backend/commands/operatorcmds.c
M src/backend/commands/policy.c
M src/backend/commands/portalcmds.c
M src/backend/commands/prepare.c
M src/backend/commands/proclang.c
M src/backend/commands/publicationcmds.c
M src/backend/commands/schemacmds.c
M src/backend/commands/seclabel.c
M src/backend/commands/sequence.c
M src/backend/commands/statscmds.c
M src/backend/commands/subscriptioncmds.c
M src/backend/commands/tablecmds.c
M src/backend/commands/tablespace.c
M src/backend/commands/trigger.c
M src/backend/commands/tsearchcmds.c
M src/backend/commands/typecmds.c
M src/backend/commands/user.c
M src/backend/commands/vacuum.c
M src/backend/commands/vacuumparallel.c
M src/backend/commands/variable.c
M src/backend/commands/view.c
M src/backend/executor/execAmi.c
M src/backend/executor/execAsync.c
M src/backend/executor/execCurrent.c
M src/backend/executor/execExpr.c
M src/backend/executor/execExprInterp.c
M src/backend/executor/execGrouping.c
M src/backend/executor/execIndexing.c
M src/backend/executor/execJunk.c
M src/backend/executor/execMain.c
M src/backend/executor/execParallel.c
M src/backend/executor/execPartition.c
M src/backend/executor/execProcnode.c
M src/backend/executor/execReplication.c
M src/backend/executor/execSRF.c
M src/backend/executor/execScan.c
M src/backend/executor/execTuples.c
M src/backend/executor/execUtils.c
M src/backend/executor/functions.c
M src/backend/executor/instrument.c
M src/backend/executor/meson.build
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeAppend.c
M src/backend/executor/nodeBitmapAnd.c
M src/backend/executor/nodeBitmapHeapscan.c
M src/backend/executor/nodeBitmapIndexscan.c
M src/backend/executor/nodeBitmapOr.c
M src/backend/executor/nodeCtescan.c
M src/backend/executor/nodeCustom.c
M src/backend/executor/nodeForeignscan.c
M src/backend/executor/nodeFunctionscan.c
M src/backend/executor/nodeGather.c
M src/backend/executor/nodeGatherMerge.c
M src/backend/executor/nodeGroup.c
M src/backend/executor/nodeHash.c
M src/backend/executor/nodeHashjoin.c
M src/backend/executor/nodeIncrementalSort.c
M src/backend/executor/nodeIndexonlyscan.c
M src/backend/executor/nodeIndexscan.c
M src/backend/executor/nodeLimit.c
M src/backend/executor/nodeLockRows.c
M src/backend/executor/nodeMaterial.c
M src/backend/executor/nodeMemoize.c
M src/backend/executor/nodeMergeAppend.c
M src/backend/executor/nodeMergejoin.c
M src/backend/executor/nodeModifyTable.c
M src/backend/executor/nodeNamedtuplestorescan.c
M src/backend/executor/nodeNestloop.c
M src/backend/executor/nodeProjectSet.c
M src/backend/executor/nodeRecursiveunion.c
M src/backend/executor/nodeResult.c
M src/backend/executor/nodeSamplescan.c
M src/backend/executor/nodeSeqscan.c
M src/backend/executor/nodeSetOp.c
M src/backend/executor/nodeSort.c
M src/backend/executor/nodeSubplan.c
M src/backend/executor/nodeSubqueryscan.c
M src/backend/executor/nodeTableFuncscan.c
M src/backend/executor/nodeTidrangescan.c
M src/backend/executor/nodeTidscan.c
M src/backend/executor/nodeUnique.c
M src/backend/executor/nodeValuesscan.c
M src/backend/executor/nodeWindowAgg.c
M src/backend/executor/nodeWorktablescan.c
M src/backend/executor/spi.c
M src/backend/executor/tqueue.c
M src/backend/executor/tstoreReceiver.c
M src/backend/foreign/foreign.c
M src/backend/foreign/meson.build
M src/backend/jit/jit.c
M src/backend/jit/llvm/llvmjit.c
M src/backend/jit/llvm/llvmjit_deform.c
M src/backend/jit/llvm/llvmjit_error.cpp
M src/backend/jit/llvm/llvmjit_expr.c
M src/backend/jit/llvm/llvmjit_inline.cpp
M src/backend/jit/llvm/llvmjit_types.c
M src/backend/jit/llvm/llvmjit_wrap.cpp
M src/backend/jit/llvm/meson.build
M src/backend/jit/meson.build
M src/backend/lib/binaryheap.c
M src/backend/lib/bipartite_match.c
M src/backend/lib/bloomfilter.c
M src/backend/lib/dshash.c
M src/backend/lib/hyperloglog.c
M src/backend/lib/ilist.c
M src/backend/lib/integerset.c
M src/backend/lib/knapsack.c
M src/backend/lib/meson.build
M src/backend/lib/pairingheap.c
M src/backend/lib/rbtree.c
M src/backend/libpq/auth-sasl.c
M src/backend/libpq/auth-scram.c
M src/backend/libpq/auth.c
M src/backend/libpq/be-fsstubs.c
M src/backend/libpq/be-gssapi-common.c
M src/backend/libpq/be-secure-common.c
M src/backend/libpq/be-secure-gssapi.c
M src/backend/libpq/be-secure-openssl.c
M src/backend/libpq/be-secure.c
M src/backend/libpq/crypt.c
M src/backend/libpq/hba.c
M src/backend/libpq/ifaddr.c
M src/backend/libpq/meson.build
M src/backend/libpq/pqcomm.c
M src/backend/libpq/pqformat.c
M src/backend/libpq/pqmq.c
M src/backend/libpq/pqsignal.c
M src/backend/main/main.c
M src/backend/main/meson.build
M src/backend/meson.build
M src/backend/nodes/bitmapset.c
M src/backend/nodes/copyfuncs.c
M src/backend/nodes/equalfuncs.c
M src/backend/nodes/extensible.c
M src/backend/nodes/gen_node_support.pl
M src/backend/nodes/list.c
M src/backend/nodes/makefuncs.c
M src/backend/nodes/meson.build
M src/backend/nodes/multibitmapset.c
M src/backend/nodes/nodeFuncs.c
M src/backend/nodes/nodes.c
M src/backend/nodes/outfuncs.c
M src/backend/nodes/params.c
M src/backend/nodes/print.c
M src/backend/nodes/read.c
M src/backend/nodes/readfuncs.c
M src/backend/nodes/tidbitmap.c
M src/backend/nodes/value.c
M src/backend/optimizer/geqo/geqo_copy.c
M src/backend/optimizer/geqo/geqo_eval.c
M src/backend/optimizer/geqo/geqo_main.c
M src/backend/optimizer/geqo/geqo_misc.c
M src/backend/optimizer/geqo/geqo_pool.c
M src/backend/optimizer/geqo/geqo_random.c
M src/backend/optimizer/geqo/geqo_selection.c
M src/backend/optimizer/geqo/meson.build
M src/backend/optimizer/meson.build
M src/backend/optimizer/path/allpaths.c
M src/backend/optimizer/path/clausesel.c
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/joinpath.c
M src/backend/optimizer/path/joinrels.c
M src/backend/optimizer/path/meson.build
M src/backend/optimizer/path/pathkeys.c
M src/backend/optimizer/path/tidpath.c
M src/backend/optimizer/plan/analyzejoins.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/plan/meson.build
M src/backend/optimizer/plan/planagg.c
M src/backend/optimizer/plan/planmain.c
M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/plan/setrefs.c
M src/backend/optimizer/plan/subselect.c
M src/backend/optimizer/prep/meson.build
M src/backend/optimizer/prep/prepagg.c
M src/backend/optimizer/prep/prepjointree.c
M src/backend/optimizer/prep/prepqual.c
M src/backend/optimizer/prep/preptlist.c
M src/backend/optimizer/prep/prepunion.c
M src/backend/optimizer/util/appendinfo.c
M src/backend/optimizer/util/clauses.c
M src/backend/optimizer/util/inherit.c
M src/backend/optimizer/util/joininfo.c
M src/backend/optimizer/util/meson.build
M src/backend/optimizer/util/orclauses.c
M src/backend/optimizer/util/paramassign.c
M src/backend/optimizer/util/pathnode.c
M src/backend/optimizer/util/placeholder.c
M src/backend/optimizer/util/plancat.c
M src/backend/optimizer/util/predtest.c
M src/backend/optimizer/util/relnode.c
M src/backend/optimizer/util/restrictinfo.c
M src/backend/optimizer/util/tlist.c
M src/backend/optimizer/util/var.c
M src/backend/parser/analyze.c
M src/backend/parser/check_keywords.pl
M src/backend/parser/gram.y
M src/backend/parser/gramparse.h
M src/backend/parser/meson.build
M src/backend/parser/parse_agg.c
M src/backend/parser/parse_clause.c
M src/backend/parser/parse_coerce.c
M src/backend/parser/parse_collate.c
M src/backend/parser/parse_cte.c
M src/backend/parser/parse_enr.c
M src/backend/parser/parse_expr.c
M src/backend/parser/parse_func.c
M src/backend/parser/parse_merge.c
M src/backend/parser/parse_node.c
M src/backend/parser/parse_oper.c
M src/backend/parser/parse_param.c
M src/backend/parser/parse_relation.c
M src/backend/parser/parse_target.c
M src/backend/parser/parse_type.c
M src/backend/parser/parse_utilcmd.c
M src/backend/parser/parser.c
M src/backend/parser/scan.l
M src/backend/parser/scansup.c
M src/backend/partitioning/meson.build
M src/backend/partitioning/partbounds.c
M src/backend/partitioning/partdesc.c
M src/backend/partitioning/partprune.c
M src/backend/po/meson.build
M src/backend/port/atomics.c
M src/backend/port/meson.build
M src/backend/port/posix_sema.c
M src/backend/port/sysv_sema.c
M src/backend/port/sysv_shmem.c
M src/backend/port/tas/sunstudio_sparc.s
M src/backend/port/tas/sunstudio_x86.s
M src/backend/port/win32/crashdump.c
M src/backend/port/win32/meson.build
M src/backend/port/win32/signal.c
M src/backend/port/win32/socket.c
M src/backend/port/win32/timer.c
M src/backend/port/win32_sema.c
M src/backend/port/win32_shmem.c
M src/backend/postmaster/autovacuum.c
M src/backend/postmaster/auxprocess.c
M src/backend/postmaster/bgworker.c
M src/backend/postmaster/bgwriter.c
M src/backend/postmaster/checkpointer.c
M src/backend/postmaster/fork_process.c
M src/backend/postmaster/interrupt.c
M src/backend/postmaster/meson.build
M src/backend/postmaster/pgarch.c
M src/backend/postmaster/postmaster.c
M src/backend/postmaster/shell_archive.c
M src/backend/postmaster/startup.c
M src/backend/postmaster/syslogger.c
M src/backend/postmaster/walwriter.c
M src/backend/regex/meson.build
M src/backend/regex/regc_pg_locale.c
M src/backend/regex/regexport.c
M src/backend/regex/regprefix.c
M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
M src/backend/replication/libpqwalreceiver/meson.build
M src/backend/replication/logical/decode.c
M src/backend/replication/logical/launcher.c
M src/backend/replication/logical/logical.c
M src/backend/replication/logical/logicalfuncs.c
M src/backend/replication/logical/meson.build
M src/backend/replication/logical/message.c
M src/backend/replication/logical/origin.c
M src/backend/replication/logical/proto.c
M src/backend/replication/logical/relation.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/meson.build
M src/backend/replication/pgoutput/meson.build
M src/backend/replication/pgoutput/pgoutput.c
M src/backend/replication/repl_gram.y
M src/backend/replication/repl_scanner.l
M src/backend/replication/slot.c
M src/backend/replication/slotfuncs.c
M src/backend/replication/syncrep.c
M src/backend/replication/syncrep_gram.y
M src/backend/replication/syncrep_scanner.l
M src/backend/replication/walreceiver.c
M src/backend/replication/walreceiverfuncs.c
M src/backend/replication/walsender.c
M src/backend/rewrite/meson.build
M src/backend/rewrite/rewriteDefine.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/rewrite/rewriteManip.c
M src/backend/rewrite/rewriteRemove.c
M src/backend/rewrite/rewriteSearchCycle.c
M src/backend/rewrite/rewriteSupport.c
M src/backend/rewrite/rowsecurity.c
M src/backend/snowball/dict_snowball.c
M src/backend/snowball/meson.build
M src/backend/snowball/snowball.sql.in
M src/backend/snowball/snowball_func.sql.in
M src/backend/statistics/dependencies.c
M src/backend/statistics/extended_stats.c
M src/backend/statistics/mcv.c
M src/backend/statistics/meson.build
M src/backend/statistics/mvdistinct.c
M src/backend/storage/buffer/buf_init.c
M src/backend/storage/buffer/buf_table.c
M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/buffer/freelist.c
M src/backend/storage/buffer/localbuf.c
M src/backend/storage/buffer/meson.build
M src/backend/storage/file/buffile.c
M src/backend/storage/file/copydir.c
M src/backend/storage/file/fd.c
M src/backend/storage/file/fileset.c
M src/backend/storage/file/meson.build
M src/backend/storage/file/reinit.c
M src/backend/storage/file/sharedfileset.c
M src/backend/storage/freespace/freespace.c
M src/backend/storage/freespace/fsmpage.c
M src/backend/storage/freespace/indexfsm.c
M src/backend/storage/freespace/meson.build
M src/backend/storage/ipc/barrier.c
M src/backend/storage/ipc/dsm.c
M src/backend/storage/ipc/dsm_impl.c
M src/backend/storage/ipc/ipc.c
M src/backend/storage/ipc/ipci.c
M src/backend/storage/ipc/latch.c
M src/backend/storage/ipc/meson.build
M src/backend/storage/ipc/pmsignal.c
M src/backend/storage/ipc/procarray.c
M src/backend/storage/ipc/procsignal.c
M src/backend/storage/ipc/shm_mq.c
M src/backend/storage/ipc/shm_toc.c
M src/backend/storage/ipc/shmem.c
M src/backend/storage/ipc/shmqueue.c
M src/backend/storage/ipc/signalfuncs.c
M src/backend/storage/ipc/sinval.c
M src/backend/storage/ipc/sinvaladt.c
M src/backend/storage/ipc/standby.c
M src/backend/storage/large_object/inv_api.c
M src/backend/storage/large_object/meson.build
M src/backend/storage/lmgr/condition_variable.c
M src/backend/storage/lmgr/deadlock.c
M src/backend/storage/lmgr/generate-lwlocknames.pl
M src/backend/storage/lmgr/lmgr.c
M src/backend/storage/lmgr/lock.c
M src/backend/storage/lmgr/lwlock.c
M src/backend/storage/lmgr/meson.build
M src/backend/storage/lmgr/predicate.c
M src/backend/storage/lmgr/proc.c
M src/backend/storage/lmgr/s_lock.c
M src/backend/storage/lmgr/spin.c
M src/backend/storage/meson.build
M src/backend/storage/page/bufpage.c
M src/backend/storage/page/checksum.c
M src/backend/storage/page/itemptr.c
M src/backend/storage/page/meson.build
M src/backend/storage/smgr/md.c
M src/backend/storage/smgr/meson.build
M src/backend/storage/smgr/smgr.c
M src/backend/storage/sync/meson.build
M src/backend/storage/sync/sync.c
M src/backend/tcop/cmdtag.c
M src/backend/tcop/dest.c
M src/backend/tcop/fastpath.c
M src/backend/tcop/meson.build
M src/backend/tcop/postgres.c
M src/backend/tcop/pquery.c
M src/backend/tcop/utility.c
M src/backend/tsearch/Makefile
M src/backend/tsearch/dict.c
M src/backend/tsearch/dict_ispell.c
M src/backend/tsearch/dict_simple.c
M src/backend/tsearch/dict_synonym.c
M src/backend/tsearch/dict_thesaurus.c
M src/backend/tsearch/meson.build
M src/backend/tsearch/regis.c
M src/backend/tsearch/spell.c
M src/backend/tsearch/to_tsany.c
M src/backend/tsearch/ts_locale.c
M src/backend/tsearch/ts_parse.c
M src/backend/tsearch/ts_selfuncs.c
M src/backend/tsearch/ts_typanalyze.c
M src/backend/tsearch/ts_utils.c
M src/backend/tsearch/wparser.c
M src/backend/tsearch/wparser_def.c
M src/backend/utils/Gen_dummy_probes.pl
M src/backend/utils/Gen_dummy_probes.pl.prolog
M src/backend/utils/Gen_dummy_probes.sed
M src/backend/utils/Gen_fmgrtab.pl
M src/backend/utils/Makefile
M src/backend/utils/activity/Makefile
M src/backend/utils/activity/backend_progress.c
M src/backend/utils/activity/backend_status.c
M src/backend/utils/activity/meson.build
M src/backend/utils/activity/pgstat.c
M src/backend/utils/activity/pgstat_archiver.c
M src/backend/utils/activity/pgstat_bgwriter.c
M src/backend/utils/activity/pgstat_checkpointer.c
M src/backend/utils/activity/pgstat_database.c
M src/backend/utils/activity/pgstat_function.c
M src/backend/utils/activity/pgstat_relation.c
M src/backend/utils/activity/pgstat_replslot.c
M src/backend/utils/activity/pgstat_shmem.c
M src/backend/utils/activity/pgstat_slru.c
M src/backend/utils/activity/pgstat_subscription.c
M src/backend/utils/activity/pgstat_wal.c
M src/backend/utils/activity/pgstat_xact.c
M src/backend/utils/activity/wait_event.c
M src/backend/utils/adt/acl.c
M src/backend/utils/adt/amutils.c
M src/backend/utils/adt/array_expanded.c
M src/backend/utils/adt/array_selfuncs.c
M src/backend/utils/adt/array_typanalyze.c
M src/backend/utils/adt/array_userfuncs.c
M src/backend/utils/adt/arrayfuncs.c
M src/backend/utils/adt/arraysubs.c
M src/backend/utils/adt/arrayutils.c
M src/backend/utils/adt/ascii.c
M src/backend/utils/adt/bool.c
M src/backend/utils/adt/char.c
M src/backend/utils/adt/cryptohashfuncs.c
M src/backend/utils/adt/date.c
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/datum.c
M src/backend/utils/adt/dbsize.c
M src/backend/utils/adt/domains.c
M src/backend/utils/adt/encode.c
M src/backend/utils/adt/enum.c
M src/backend/utils/adt/expandeddatum.c
M src/backend/utils/adt/expandedrecord.c
M src/backend/utils/adt/float.c
M src/backend/utils/adt/format_type.c
M src/backend/utils/adt/formatting.c
M src/backend/utils/adt/genfile.c
M src/backend/utils/adt/geo_ops.c
M src/backend/utils/adt/geo_selfuncs.c
M src/backend/utils/adt/geo_spgist.c
M src/backend/utils/adt/hbafuncs.c
M src/backend/utils/adt/int.c
M src/backend/utils/adt/int8.c
M src/backend/utils/adt/json.c
M src/backend/utils/adt/jsonb.c
M src/backend/utils/adt/jsonb_gin.c
M src/backend/utils/adt/jsonb_op.c
M src/backend/utils/adt/jsonb_util.c
M src/backend/utils/adt/jsonbsubs.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_gram.y
M src/backend/utils/adt/jsonpath_internal.h
M src/backend/utils/adt/jsonpath_scan.l
M src/backend/utils/adt/levenshtein.c
M src/backend/utils/adt/like.c
M src/backend/utils/adt/like_match.c
M src/backend/utils/adt/like_support.c
M src/backend/utils/adt/lockfuncs.c
M src/backend/utils/adt/mac.c
M src/backend/utils/adt/mac8.c
M src/backend/utils/adt/mcxtfuncs.c
M src/backend/utils/adt/meson.build
M src/backend/utils/adt/misc.c
M src/backend/utils/adt/multirangetypes.c
M src/backend/utils/adt/multirangetypes_selfuncs.c
M src/backend/utils/adt/name.c
M src/backend/utils/adt/network_gist.c
M src/backend/utils/adt/network_selfuncs.c
M src/backend/utils/adt/network_spgist.c
M src/backend/utils/adt/numeric.c
M src/backend/utils/adt/numutils.c
M src/backend/utils/adt/oid.c
M src/backend/utils/adt/oracle_compat.c
M src/backend/utils/adt/orderedsetaggs.c
M src/backend/utils/adt/partitionfuncs.c
M src/backend/utils/adt/pg_locale.c
M src/backend/utils/adt/pg_lsn.c
M src/backend/utils/adt/pg_upgrade_support.c
M src/backend/utils/adt/pgstatfuncs.c
M src/backend/utils/adt/pseudotypes.c
M src/backend/utils/adt/quote.c
M src/backend/utils/adt/rangetypes.c
M src/backend/utils/adt/rangetypes_gist.c
M src/backend/utils/adt/rangetypes_selfuncs.c
M src/backend/utils/adt/rangetypes_spgist.c
M src/backend/utils/adt/rangetypes_typanalyze.c
M src/backend/utils/adt/regexp.c
M src/backend/utils/adt/regproc.c
M src/backend/utils/adt/ri_triggers.c
M src/backend/utils/adt/rowtypes.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/adt/selfuncs.c
M src/backend/utils/adt/tid.c
M src/backend/utils/adt/timestamp.c
M src/backend/utils/adt/trigfuncs.c
M src/backend/utils/adt/tsginidx.c
M src/backend/utils/adt/tsgistidx.c
M src/backend/utils/adt/tsquery.c
M src/backend/utils/adt/tsquery_cleanup.c
M src/backend/utils/adt/tsquery_gist.c
M src/backend/utils/adt/tsquery_op.c
M src/backend/utils/adt/tsquery_rewrite.c
M src/backend/utils/adt/tsquery_util.c
M src/backend/utils/adt/tsrank.c
M src/backend/utils/adt/tsvector.c
M src/backend/utils/adt/tsvector_op.c
M src/backend/utils/adt/tsvector_parser.c
M src/backend/utils/adt/uuid.c
M src/backend/utils/adt/varbit.c
M src/backend/utils/adt/varchar.c
M src/backend/utils/adt/varlena.c
M src/backend/utils/adt/version.c
M src/backend/utils/adt/windowfuncs.c
M src/backend/utils/adt/xid.c
M src/backend/utils/adt/xid8funcs.c
M src/backend/utils/adt/xml.c
M src/backend/utils/cache/attoptcache.c
M src/backend/utils/cache/catcache.c
M src/backend/utils/cache/evtcache.c
M src/backend/utils/cache/inval.c
M src/backend/utils/cache/lsyscache.c
M src/backend/utils/cache/meson.build
M src/backend/utils/cache/partcache.c
M src/backend/utils/cache/plancache.c
M src/backend/utils/cache/relcache.c
M src/backend/utils/cache/relfilenumbermap.c
M src/backend/utils/cache/relmapper.c
M src/backend/utils/cache/spccache.c
M src/backend/utils/cache/syscache.c
M src/backend/utils/cache/ts_cache.c
M src/backend/utils/cache/typcache.c
M src/backend/utils/errcodes.txt
M src/backend/utils/error/assert.c
M src/backend/utils/error/csvlog.c
M src/backend/utils/error/elog.c
M src/backend/utils/error/jsonlog.c
M src/backend/utils/error/meson.build
M src/backend/utils/fmgr/dfmgr.c
M src/backend/utils/fmgr/fmgr.c
M src/backend/utils/fmgr/funcapi.c
M src/backend/utils/fmgr/meson.build
M src/backend/utils/generate-errcodes.pl
M src/backend/utils/hash/dynahash.c
M src/backend/utils/hash/meson.build
M src/backend/utils/hash/pg_crc.c
M src/backend/utils/init/globals.c
M src/backend/utils/init/meson.build
M src/backend/utils/init/miscinit.c
M src/backend/utils/init/postinit.c
M src/backend/utils/mb/Unicode/Makefile
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/mb/conv.c
M src/backend/utils/mb/conversion_procs/Makefile
M src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c
M src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c
M src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c
M src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
M src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c
M src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
M src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c
M src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c
M src/backend/utils/mb/conversion_procs/meson.build
M src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c
M src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c
M src/backend/utils/mb/conversion_procs/utf8_and_euc2004/utf8_and_euc2004.c
M src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c
M src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c
M src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c
M src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c
M src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c
M src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c
M src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c
M src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c
M src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c
M src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c
M src/backend/utils/mb/conversion_procs/utf8_and_sjis2004/utf8_and_sjis2004.c
M src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c
M src/backend/utils/mb/conversion_procs/utf8_and_win/utf8_and_win.c
M src/backend/utils/mb/mbutils.c
M src/backend/utils/mb/meson.build
M src/backend/utils/mb/stringinfo_mb.c
M src/backend/utils/meson.build
M src/backend/utils/misc/conffiles.c
M src/backend/utils/misc/guc-file.l
M src/backend/utils/misc/guc.c
M src/backend/utils/misc/guc_funcs.c
M src/backend/utils/misc/guc_internal.h
M src/backend/utils/misc/guc_tables.c
M src/backend/utils/misc/help_config.c
M src/backend/utils/misc/meson.build
M src/backend/utils/misc/pg_config.c
M src/backend/utils/misc/pg_controldata.c
M src/backend/utils/misc/pg_rusage.c
M src/backend/utils/misc/ps_status.c
M src/backend/utils/misc/queryenvironment.c
M src/backend/utils/misc/queryjumble.c
M src/backend/utils/misc/rls.c
M src/backend/utils/misc/sampling.c
M src/backend/utils/misc/superuser.c
M src/backend/utils/misc/timeout.c
M src/backend/utils/misc/tzparser.c
M src/backend/utils/mmgr/alignedalloc.c
M src/backend/utils/mmgr/aset.c
M src/backend/utils/mmgr/dsa.c
M src/backend/utils/mmgr/freepage.c
M src/backend/utils/mmgr/generation.c
M src/backend/utils/mmgr/mcxt.c
M src/backend/utils/mmgr/memdebug.c
M src/backend/utils/mmgr/meson.build
M src/backend/utils/mmgr/portalmem.c
M src/backend/utils/mmgr/slab.c
M src/backend/utils/postprocess_dtrace.sed
M src/backend/utils/probes.d
M src/backend/utils/resowner/meson.build
M src/backend/utils/resowner/resowner.c
M src/backend/utils/sort/logtape.c
M src/backend/utils/sort/meson.build
M src/backend/utils/sort/sharedtuplestore.c
M src/backend/utils/sort/sortsupport.c
M src/backend/utils/sort/tuplesort.c
M src/backend/utils/sort/tuplesortvariants.c
M src/backend/utils/sort/tuplestore.c
M src/backend/utils/time/combocid.c
M src/backend/utils/time/meson.build
M src/backend/utils/time/snapmgr.c
M src/bin/Makefile
M src/bin/initdb/Makefile
M src/bin/initdb/findtimezone.c
M src/bin/initdb/initdb.c
M src/bin/initdb/meson.build
M src/bin/initdb/po/meson.build
M src/bin/initdb/t/001_initdb.pl
M src/bin/meson.build
M src/bin/pg_amcheck/Makefile
M src/bin/pg_amcheck/meson.build
M src/bin/pg_amcheck/pg_amcheck.c
M src/bin/pg_amcheck/po/meson.build
M src/bin/pg_amcheck/t/001_basic.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_amcheck/t/005_opclass_damage.pl
M src/bin/pg_archivecleanup/meson.build
M src/bin/pg_archivecleanup/po/meson.build
M src/bin/pg_archivecleanup/t/010_pg_archivecleanup.pl
M src/bin/pg_basebackup/Makefile
M src/bin/pg_basebackup/bbstreamer.h
M src/bin/pg_basebackup/bbstreamer_file.c
M src/bin/pg_basebackup/bbstreamer_gzip.c
M src/bin/pg_basebackup/bbstreamer_inject.c
M src/bin/pg_basebackup/bbstreamer_lz4.c
M src/bin/pg_basebackup/bbstreamer_tar.c
M src/bin/pg_basebackup/bbstreamer_zstd.c
M src/bin/pg_basebackup/meson.build
M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_basebackup/pg_receivewal.c
M src/bin/pg_basebackup/pg_recvlogical.c
M src/bin/pg_basebackup/po/meson.build
M src/bin/pg_basebackup/receivelog.c
M src/bin/pg_basebackup/receivelog.h
M src/bin/pg_basebackup/streamutil.c
M src/bin/pg_basebackup/streamutil.h
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/Makefile
M src/bin/pg_checksums/meson.build
M src/bin/pg_checksums/pg_checksums.c
M src/bin/pg_checksums/po/meson.build
M src/bin/pg_checksums/t/001_basic.pl
M src/bin/pg_checksums/t/002_actions.pl
M src/bin/pg_config/Makefile
M src/bin/pg_config/meson.build
M src/bin/pg_config/pg_config.c
M src/bin/pg_config/po/meson.build
M src/bin/pg_config/t/001_pg_config.pl
M src/bin/pg_controldata/Makefile
M src/bin/pg_controldata/meson.build
M src/bin/pg_controldata/po/meson.build
M src/bin/pg_controldata/t/001_pg_controldata.pl
M src/bin/pg_ctl/Makefile
M src/bin/pg_ctl/meson.build
M src/bin/pg_ctl/pg_ctl.c
M src/bin/pg_ctl/po/meson.build
M src/bin/pg_ctl/t/001_start_stop.pl
M src/bin/pg_ctl/t/002_status.pl
M src/bin/pg_ctl/t/003_promote.pl
M src/bin/pg_ctl/t/004_logrotate.pl
M src/bin/pg_dump/Makefile
M src/bin/pg_dump/common.c
M src/bin/pg_dump/compress_io.c
M src/bin/pg_dump/compress_io.h
M src/bin/pg_dump/dumputils.c
M src/bin/pg_dump/dumputils.h
M src/bin/pg_dump/meson.build
M src/bin/pg_dump/parallel.c
M src/bin/pg_dump/parallel.h
M src/bin/pg_dump/pg_backup_directory.c
M src/bin/pg_dump/pg_backup_utils.c
M src/bin/pg_dump/pg_backup_utils.h
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/pg_dumpall.c
M src/bin/pg_dump/po/meson.build
M src/bin/pg_dump/t/001_basic.pl
M src/bin/pg_dump/t/002_pg_dump.pl
M src/bin/pg_dump/t/003_pg_dump_with_server.pl
M src/bin/pg_dump/t/010_dump_connstr.pl
M src/bin/pg_resetwal/Makefile
M src/bin/pg_resetwal/meson.build
M src/bin/pg_resetwal/pg_resetwal.c
M src/bin/pg_resetwal/po/meson.build
M src/bin/pg_resetwal/t/001_basic.pl
M src/bin/pg_resetwal/t/002_corrupted.pl
M src/bin/pg_rewind/Makefile
M src/bin/pg_rewind/datapagemap.c
M src/bin/pg_rewind/datapagemap.h
M src/bin/pg_rewind/file_ops.c
M src/bin/pg_rewind/file_ops.h
M src/bin/pg_rewind/filemap.c
M src/bin/pg_rewind/filemap.h
M src/bin/pg_rewind/libpq_source.c
M src/bin/pg_rewind/local_source.c
M src/bin/pg_rewind/meson.build
M src/bin/pg_rewind/parsexlog.c
M src/bin/pg_rewind/pg_rewind.c
M src/bin/pg_rewind/pg_rewind.h
M src/bin/pg_rewind/po/meson.build
M src/bin/pg_rewind/rewind_source.h
M src/bin/pg_rewind/t/001_basic.pl
M src/bin/pg_rewind/t/002_databases.pl
M src/bin/pg_rewind/t/003_extrafiles.pl
M src/bin/pg_rewind/t/004_pg_xlog_symlink.pl
M src/bin/pg_rewind/t/005_same_timeline.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_rewind/timeline.c
M src/bin/pg_test_fsync/meson.build
M src/bin/pg_test_fsync/po/meson.build
M src/bin/pg_test_fsync/t/001_basic.pl
M src/bin/pg_test_timing/meson.build
M src/bin/pg_test_timing/po/meson.build
M src/bin/pg_test_timing/t/001_basic.pl
M src/bin/pg_upgrade/check.c
M src/bin/pg_upgrade/controldata.c
M src/bin/pg_upgrade/dump.c
M src/bin/pg_upgrade/exec.c
M src/bin/pg_upgrade/file.c
M src/bin/pg_upgrade/function.c
M src/bin/pg_upgrade/info.c
M src/bin/pg_upgrade/meson.build
M src/bin/pg_upgrade/option.c
M src/bin/pg_upgrade/parallel.c
M src/bin/pg_upgrade/pg_upgrade.c
M src/bin/pg_upgrade/pg_upgrade.h
M src/bin/pg_upgrade/po/meson.build
M src/bin/pg_upgrade/relfilenumber.c
M src/bin/pg_upgrade/server.c
M src/bin/pg_upgrade/tablespace.c
M src/bin/pg_upgrade/util.c
M src/bin/pg_upgrade/version.c
M src/bin/pg_verifybackup/meson.build
M src/bin/pg_verifybackup/parse_manifest.c
M src/bin/pg_verifybackup/parse_manifest.h
M src/bin/pg_verifybackup/pg_verifybackup.c
M src/bin/pg_verifybackup/po/meson.build
M src/bin/pg_verifybackup/t/001_basic.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/005_bad_manifest.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/compat.c
M src/bin/pg_waldump/meson.build
M src/bin/pg_waldump/pg_waldump.c
M src/bin/pg_waldump/po/meson.build
M src/bin/pg_waldump/t/001_basic.pl
M src/bin/pg_waldump/t/002_save_fullpage.pl
M src/bin/pgbench/exprparse.y
M src/bin/pgbench/exprscan.l
M src/bin/pgbench/meson.build
M src/bin/pgbench/pgbench.c
M src/bin/pgbench/pgbench.h
M src/bin/pgbench/t/001_pgbench_with_server.pl
M src/bin/pgbench/t/002_pgbench_no_server.pl
M src/bin/pgevent/Makefile
M src/bin/pgevent/meson.build
M src/bin/psql/Makefile
M src/bin/psql/command.c
M src/bin/psql/command.h
M src/bin/psql/common.c
M src/bin/psql/common.h
M src/bin/psql/copy.c
M src/bin/psql/copy.h
M src/bin/psql/create_help.pl
M src/bin/psql/crosstabview.c
M src/bin/psql/crosstabview.h
M src/bin/psql/describe.c
M src/bin/psql/describe.h
M src/bin/psql/help.c
M src/bin/psql/help.h
M src/bin/psql/input.c
M src/bin/psql/input.h
M src/bin/psql/large_obj.c
M src/bin/psql/large_obj.h
M src/bin/psql/mainloop.c
M src/bin/psql/mainloop.h
M src/bin/psql/meson.build
M src/bin/psql/po/meson.build
M src/bin/psql/prompt.c
M src/bin/psql/prompt.h
M src/bin/psql/psqlscanslash.h
M src/bin/psql/psqlscanslash.l
M src/bin/psql/settings.h
M src/bin/psql/startup.c
M src/bin/psql/stringutils.c
M src/bin/psql/stringutils.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/psql/tab-complete.c
M src/bin/psql/tab-complete.h
M src/bin/psql/variables.c
M src/bin/psql/variables.h
M src/bin/scripts/Makefile
M src/bin/scripts/clusterdb.c
M src/bin/scripts/common.c
M src/bin/scripts/common.h
M src/bin/scripts/createdb.c
M src/bin/scripts/createuser.c
M src/bin/scripts/dropdb.c
M src/bin/scripts/dropuser.c
M src/bin/scripts/meson.build
M src/bin/scripts/pg_isready.c
M src/bin/scripts/po/meson.build
M src/bin/scripts/reindexdb.c
M src/bin/scripts/t/010_clusterdb.pl
M src/bin/scripts/t/011_clusterdb_all.pl
M src/bin/scripts/t/020_createdb.pl
M src/bin/scripts/t/040_createuser.pl
M src/bin/scripts/t/050_dropdb.pl
M src/bin/scripts/t/070_dropuser.pl
M src/bin/scripts/t/080_pg_isready.pl
M src/bin/scripts/t/090_reindexdb.pl
M src/bin/scripts/t/091_reindexdb_all.pl
M src/bin/scripts/t/100_vacuumdb.pl
M src/bin/scripts/t/101_vacuumdb_all.pl
M src/bin/scripts/t/102_vacuumdb_stages.pl
M src/bin/scripts/t/200_connstr.pl
M src/bin/scripts/vacuumdb.c
M src/common/archive.c
M src/common/base64.c
M src/common/checksum_helper.c
M src/common/compression.c
M src/common/config_info.c
M src/common/controldata_utils.c
M src/common/cryptohash.c
M src/common/cryptohash_openssl.c
M src/common/d2s.c
M src/common/d2s_full_table.h
M src/common/d2s_intrinsics.h
M src/common/encnames.c
M src/common/exec.c
M src/common/f2s.c
M src/common/fe_memutils.c
M src/common/file_perm.c
M src/common/file_utils.c
M src/common/hashfn.c
M src/common/hmac.c
M src/common/hmac_openssl.c
M src/common/ip.c
M src/common/jsonapi.c
M src/common/keywords.c
M src/common/kwlookup.c
M src/common/link-canary.c
M src/common/logging.c
M src/common/md5.c
M src/common/md5_common.c
M src/common/md5_int.h
M src/common/meson.build
M src/common/pg_get_line.c
M src/common/pg_lzcompress.c
M src/common/pg_prng.c
M src/common/pgfnames.c
M src/common/protocol_openssl.c
M src/common/psprintf.c
M src/common/relpath.c
M src/common/restricted_token.c
M src/common/rmtree.c
M src/common/ryu_common.h
M src/common/saslprep.c
M src/common/scram-common.c
M src/common/sha1.c
M src/common/sha1_int.h
M src/common/sha2.c
M src/common/sha2_int.h
M src/common/sprompt.c
M src/common/string.c
M src/common/stringinfo.c
M src/common/unicode/generate-norm_test_table.pl
M src/common/unicode/generate-unicode_east_asian_fw_table.pl
M src/common/unicode/generate-unicode_nonspacing_table.pl
M src/common/unicode/generate-unicode_norm_table.pl
M src/common/unicode/generate-unicode_normprops_table.pl
M src/common/unicode/meson.build
M src/common/unicode/norm_test.c
M src/common/unicode_norm.c
M src/common/username.c
M src/common/wait_error.c
M src/common/wchar.c
M src/fe_utils/Makefile
M src/fe_utils/archive.c
M src/fe_utils/cancel.c
M src/fe_utils/conditional.c
M src/fe_utils/connect_utils.c
M src/fe_utils/mbprint.c
M src/fe_utils/meson.build
M src/fe_utils/option_utils.c
M src/fe_utils/parallel_slot.c
M src/fe_utils/print.c
M src/fe_utils/psqlscan.l
M src/fe_utils/query_utils.c
M src/fe_utils/recovery_gen.c
M src/fe_utils/simple_list.c
M src/fe_utils/string_utils.c
M src/include/access/amapi.h
M src/include/access/amvalidate.h
M src/include/access/attmap.h
M src/include/access/attnum.h
M src/include/access/brin.h
M src/include/access/brin_internal.h
M src/include/access/brin_page.h
M src/include/access/brin_pageops.h
M src/include/access/brin_revmap.h
M src/include/access/brin_tuple.h
M src/include/access/brin_xlog.h
M src/include/access/bufmask.h
M src/include/access/clog.h
M src/include/access/commit_ts.h
M src/include/access/detoast.h
M src/include/access/genam.h
M src/include/access/generic_xlog.h
M src/include/access/gin.h
M src/include/access/gin_private.h
M src/include/access/ginblock.h
M src/include/access/ginxlog.h
M src/include/access/gist.h
M src/include/access/gist_private.h
M src/include/access/gistscan.h
M src/include/access/gistxlog.h
M src/include/access/hash.h
M src/include/access/hash_xlog.h
M src/include/access/heapam.h
M src/include/access/heapam_xlog.h
M src/include/access/heaptoast.h
M src/include/access/hio.h
M src/include/access/htup.h
M src/include/access/htup_details.h
M src/include/access/itup.h
M src/include/access/multixact.h
M src/include/access/nbtree.h
M src/include/access/nbtxlog.h
M src/include/access/parallel.h
M src/include/access/printsimple.h
M src/include/access/printtup.h
M src/include/access/relation.h
M src/include/access/reloptions.h
M src/include/access/relscan.h
M src/include/access/rewriteheap.h
M src/include/access/rmgrlist.h
M src/include/access/sdir.h
M src/include/access/session.h
M src/include/access/skey.h
M src/include/access/slru.h
M src/include/access/spgist.h
M src/include/access/spgist_private.h
M src/include/access/spgxlog.h
M src/include/access/stratnum.h
M src/include/access/subtrans.h
M src/include/access/syncscan.h
M src/include/access/sysattr.h
M src/include/access/table.h
M src/include/access/tableam.h
M src/include/access/timeline.h
M src/include/access/toast_compression.h
M src/include/access/toast_helper.h
M src/include/access/toast_internals.h
M src/include/access/transam.h
M src/include/access/tsmapi.h
M src/include/access/tupconvert.h
M src/include/access/tupdesc.h
M src/include/access/tupdesc_details.h
M src/include/access/tupmacs.h
M src/include/access/twophase.h
M src/include/access/twophase_rmgr.h
M src/include/access/valid.h
M src/include/access/visibilitymap.h
M src/include/access/visibilitymapdefs.h
M src/include/access/xact.h
M src/include/access/xlog.h
M src/include/access/xlog_internal.h
M src/include/access/xlogarchive.h
M src/include/access/xlogbackup.h
M src/include/access/xlogdefs.h
M src/include/access/xloginsert.h
M src/include/access/xlogprefetcher.h
M src/include/access/xlogreader.h
M src/include/access/xlogrecord.h
M src/include/access/xlogrecovery.h
M src/include/access/xlogstats.h
M src/include/access/xlogutils.h
M src/include/backup/backup_manifest.h
M src/include/backup/basebackup.h
M src/include/backup/basebackup_sink.h
M src/include/backup/basebackup_target.h
M src/include/bootstrap/bootstrap.h
M src/include/c.h
M src/include/catalog/Makefile
M src/include/catalog/binary_upgrade.h
M src/include/catalog/catalog.h
M src/include/catalog/catversion.h
M src/include/catalog/dependency.h
M src/include/catalog/duplicate_oids
M src/include/catalog/genbki.h
M src/include/catalog/heap.h
M src/include/catalog/index.h
M src/include/catalog/indexing.h
M src/include/catalog/meson.build
M src/include/catalog/namespace.h
M src/include/catalog/objectaccess.h
M src/include/catalog/objectaddress.h
M src/include/catalog/partition.h
M src/include/catalog/pg_aggregate.dat
M src/include/catalog/pg_aggregate.h
M src/include/catalog/pg_am.dat
M src/include/catalog/pg_am.h
M src/include/catalog/pg_amop.dat
M src/include/catalog/pg_amop.h
M src/include/catalog/pg_amproc.dat
M src/include/catalog/pg_amproc.h
M src/include/catalog/pg_attrdef.h
M src/include/catalog/pg_attribute.h
M src/include/catalog/pg_auth_members.h
M src/include/catalog/pg_authid.dat
M src/include/catalog/pg_authid.h
M src/include/catalog/pg_cast.dat
M src/include/catalog/pg_cast.h
M src/include/catalog/pg_class.dat
M src/include/catalog/pg_class.h
M src/include/catalog/pg_collation.dat
M src/include/catalog/pg_collation.h
M src/include/catalog/pg_constraint.h
M src/include/catalog/pg_control.h
M src/include/catalog/pg_conversion.dat
M src/include/catalog/pg_conversion.h
M src/include/catalog/pg_database.dat
M src/include/catalog/pg_database.h
M src/include/catalog/pg_db_role_setting.h
M src/include/catalog/pg_default_acl.h
M src/include/catalog/pg_depend.h
M src/include/catalog/pg_description.h
M src/include/catalog/pg_enum.h
M src/include/catalog/pg_event_trigger.h
M src/include/catalog/pg_extension.h
M src/include/catalog/pg_foreign_data_wrapper.h
M src/include/catalog/pg_foreign_server.h
M src/include/catalog/pg_foreign_table.h
M src/include/catalog/pg_index.h
M src/include/catalog/pg_inherits.h
M src/include/catalog/pg_init_privs.h
M src/include/catalog/pg_language.dat
M src/include/catalog/pg_language.h
M src/include/catalog/pg_largeobject.h
M src/include/catalog/pg_largeobject_metadata.h
M src/include/catalog/pg_namespace.dat
M src/include/catalog/pg_namespace.h
M src/include/catalog/pg_opclass.dat
M src/include/catalog/pg_opclass.h
M src/include/catalog/pg_operator.dat
M src/include/catalog/pg_operator.h
M src/include/catalog/pg_opfamily.dat
M src/include/catalog/pg_opfamily.h
M src/include/catalog/pg_parameter_acl.h
M src/include/catalog/pg_partitioned_table.h
M src/include/catalog/pg_policy.h
M src/include/catalog/pg_proc.dat
M src/include/catalog/pg_proc.h
M src/include/catalog/pg_publication.h
M src/include/catalog/pg_publication_namespace.h
M src/include/catalog/pg_publication_rel.h
M src/include/catalog/pg_range.dat
M src/include/catalog/pg_range.h
M src/include/catalog/pg_replication_origin.h
M src/include/catalog/pg_rewrite.h
M src/include/catalog/pg_seclabel.h
M src/include/catalog/pg_sequence.h
M src/include/catalog/pg_shdepend.h
M src/include/catalog/pg_shdescription.h
M src/include/catalog/pg_shseclabel.h
M src/include/catalog/pg_statistic.h
M src/include/catalog/pg_statistic_ext.h
M src/include/catalog/pg_statistic_ext_data.h
M src/include/catalog/pg_subscription.h
M src/include/catalog/pg_subscription_rel.h
M src/include/catalog/pg_tablespace.dat
M src/include/catalog/pg_tablespace.h
M src/include/catalog/pg_transform.h
M src/include/catalog/pg_trigger.h
M src/include/catalog/pg_ts_config.dat
M src/include/catalog/pg_ts_config.h
M src/include/catalog/pg_ts_config_map.dat
M src/include/catalog/pg_ts_config_map.h
M src/include/catalog/pg_ts_dict.dat
M src/include/catalog/pg_ts_dict.h
M src/include/catalog/pg_ts_parser.dat
M src/include/catalog/pg_ts_parser.h
M src/include/catalog/pg_ts_template.dat
M src/include/catalog/pg_ts_template.h
M src/include/catalog/pg_type.dat
M src/include/catalog/pg_type.h
M src/include/catalog/pg_user_mapping.h
M src/include/catalog/reformat_dat_file.pl
M src/include/catalog/renumber_oids.pl
M src/include/catalog/storage.h
M src/include/catalog/storage_xlog.h
M src/include/catalog/toasting.h
M src/include/catalog/unused_oids
M src/include/commands/alter.h
M src/include/commands/async.h
M src/include/commands/cluster.h
M src/include/commands/collationcmds.h
M src/include/commands/comment.h
M src/include/commands/conversioncmds.h
M src/include/commands/copy.h
M src/include/commands/copyfrom_internal.h
M src/include/commands/createas.h
M src/include/commands/dbcommands.h
M src/include/commands/dbcommands_xlog.h
M src/include/commands/defrem.h
M src/include/commands/discard.h
M src/include/commands/event_trigger.h
M src/include/commands/explain.h
M src/include/commands/extension.h
M src/include/commands/lockcmds.h
M src/include/commands/matview.h
M src/include/commands/policy.h
M src/include/commands/portalcmds.h
M src/include/commands/prepare.h
M src/include/commands/proclang.h
M src/include/commands/progress.h
M src/include/commands/publicationcmds.h
M src/include/commands/schemacmds.h
M src/include/commands/seclabel.h
M src/include/commands/sequence.h
M src/include/commands/subscriptioncmds.h
M src/include/commands/tablecmds.h
M src/include/commands/tablespace.h
M src/include/commands/trigger.h
M src/include/commands/typecmds.h
M src/include/commands/vacuum.h
M src/include/commands/view.h
M src/include/common/archive.h
M src/include/common/base64.h
M src/include/common/checksum_helper.h
M src/include/common/compression.h
M src/include/common/config_info.h
M src/include/common/connect.h
M src/include/common/controldata_utils.h
M src/include/common/cryptohash.h
M src/include/common/fe_memutils.h
M src/include/common/file_perm.h
M src/include/common/file_utils.h
M src/include/common/hashfn.h
M src/include/common/hmac.h
M src/include/common/int.h
M src/include/common/int128.h
M src/include/common/ip.h
M src/include/common/jsonapi.h
M src/include/common/keywords.h
M src/include/common/kwlookup.h
M src/include/common/link-canary.h
M src/include/common/logging.h
M src/include/common/md5.h
M src/include/common/openssl.h
M src/include/common/pg_prng.h
M src/include/common/relpath.h
M src/include/common/restricted_token.h
M src/include/common/saslprep.h
M src/include/common/scram-common.h
M src/include/common/sha1.h
M src/include/common/sha2.h
M src/include/common/shortest_dec.h
M src/include/common/string.h
M src/include/common/unicode_norm.h
M src/include/common/unicode_norm_hashfunc.h
M src/include/common/unicode_norm_table.h
M src/include/common/username.h
M src/include/datatype/timestamp.h
M src/include/executor/execAsync.h
M src/include/executor/execExpr.h
M src/include/executor/execParallel.h
M src/include/executor/execPartition.h
M src/include/executor/execdebug.h
M src/include/executor/execdesc.h
M src/include/executor/executor.h
M src/include/executor/functions.h
M src/include/executor/hashjoin.h
M src/include/executor/instrument.h
M src/include/executor/nodeAgg.h
M src/include/executor/nodeAppend.h
M src/include/executor/nodeBitmapAnd.h
M src/include/executor/nodeBitmapHeapscan.h
M src/include/executor/nodeBitmapIndexscan.h
M src/include/executor/nodeBitmapOr.h
M src/include/executor/nodeCtescan.h
M src/include/executor/nodeCustom.h
M src/include/executor/nodeForeignscan.h
M src/include/executor/nodeFunctionscan.h
M src/include/executor/nodeGather.h
M src/include/executor/nodeGatherMerge.h
M src/include/executor/nodeGroup.h
M src/include/executor/nodeHash.h
M src/include/executor/nodeHashjoin.h
M src/include/executor/nodeIncrementalSort.h
M src/include/executor/nodeIndexonlyscan.h
M src/include/executor/nodeIndexscan.h
M src/include/executor/nodeLimit.h
M src/include/executor/nodeLockRows.h
M src/include/executor/nodeMaterial.h
M src/include/executor/nodeMemoize.h
M src/include/executor/nodeMergeAppend.h
M src/include/executor/nodeMergejoin.h
M src/include/executor/nodeModifyTable.h
M src/include/executor/nodeNamedtuplestorescan.h
M src/include/executor/nodeNestloop.h
M src/include/executor/nodeProjectSet.h
M src/include/executor/nodeRecursiveunion.h
M src/include/executor/nodeResult.h
M src/include/executor/nodeSamplescan.h
M src/include/executor/nodeSeqscan.h
M src/include/executor/nodeSetOp.h
M src/include/executor/nodeSort.h
M src/include/executor/nodeSubplan.h
M src/include/executor/nodeSubqueryscan.h
M src/include/executor/nodeTableFuncscan.h
M src/include/executor/nodeTidrangescan.h
M src/include/executor/nodeTidscan.h
M src/include/executor/nodeUnique.h
M src/include/executor/nodeValuesscan.h
M src/include/executor/nodeWindowAgg.h
M src/include/executor/nodeWorktablescan.h
M src/include/executor/spi.h
M src/include/executor/spi_priv.h
M src/include/executor/tablefunc.h
M src/include/executor/tqueue.h
M src/include/executor/tstoreReceiver.h
M src/include/executor/tuptable.h
M src/include/fe_utils/archive.h
M src/include/fe_utils/cancel.h
M src/include/fe_utils/conditional.h
M src/include/fe_utils/connect_utils.h
M src/include/fe_utils/mbprint.h
M src/include/fe_utils/option_utils.h
M src/include/fe_utils/parallel_slot.h
M src/include/fe_utils/print.h
M src/include/fe_utils/psqlscan.h
M src/include/fe_utils/psqlscan_int.h
M src/include/fe_utils/query_utils.h
M src/include/fe_utils/recovery_gen.h
M src/include/fe_utils/simple_list.h
M src/include/fe_utils/string_utils.h
M src/include/fmgr.h
M src/include/foreign/fdwapi.h
M src/include/foreign/foreign.h
M src/include/funcapi.h
M src/include/getopt_long.h
M src/include/jit/jit.h
M src/include/jit/llvmjit.h
M src/include/jit/llvmjit_emit.h
M src/include/lib/binaryheap.h
M src/include/lib/bipartite_match.h
M src/include/lib/bloomfilter.h
M src/include/lib/dshash.h
M src/include/lib/hyperloglog.h
M src/include/lib/ilist.h
M src/include/lib/integerset.h
M src/include/lib/knapsack.h
M src/include/lib/pairingheap.h
M src/include/lib/qunique.h
M src/include/lib/rbtree.h
M src/include/lib/simplehash.h
M src/include/lib/sort_template.h
M src/include/lib/stringinfo.h
M src/include/libpq/auth.h
M src/include/libpq/be-fsstubs.h
M src/include/libpq/be-gssapi-common.h
M src/include/libpq/crypt.h
M src/include/libpq/ifaddr.h
M src/include/libpq/libpq-be.h
M src/include/libpq/libpq-fs.h
M src/include/libpq/libpq.h
M src/include/libpq/pqcomm.h
M src/include/libpq/pqformat.h
M src/include/libpq/pqmq.h
M src/include/libpq/pqsignal.h
M src/include/libpq/sasl.h
M src/include/libpq/scram.h
M src/include/mb/pg_wchar.h
M src/include/mb/stringinfo_mb.h
M src/include/meson.build
M src/include/miscadmin.h
M src/include/nodes/bitmapset.h
M src/include/nodes/execnodes.h
M src/include/nodes/extensible.h
M src/include/nodes/lockoptions.h
M src/include/nodes/makefuncs.h
M src/include/nodes/memnodes.h
M src/include/nodes/meson.build
M src/include/nodes/miscnodes.h
M src/include/nodes/multibitmapset.h
M src/include/nodes/nodeFuncs.h
M src/include/nodes/nodes.h
M src/include/nodes/params.h
M src/include/nodes/parsenodes.h
M src/include/nodes/pathnodes.h
M src/include/nodes/pg_list.h
M src/include/nodes/plannodes.h
M src/include/nodes/primnodes.h
M src/include/nodes/print.h
M src/include/nodes/readfuncs.h
M src/include/nodes/replnodes.h
M src/include/nodes/subscripting.h
M src/include/nodes/supportnodes.h
M src/include/nodes/tidbitmap.h
M src/include/nodes/value.h
M src/include/optimizer/appendinfo.h
M src/include/optimizer/clauses.h
M src/include/optimizer/cost.h
M src/include/optimizer/geqo.h
M src/include/optimizer/geqo_copy.h
M src/include/optimizer/geqo_gene.h
M src/include/optimizer/geqo_misc.h
M src/include/optimizer/geqo_mutation.h
M src/include/optimizer/geqo_pool.h
M src/include/optimizer/geqo_random.h
M src/include/optimizer/geqo_recombination.h
M src/include/optimizer/geqo_selection.h
M src/include/optimizer/inherit.h
M src/include/optimizer/joininfo.h
M src/include/optimizer/optimizer.h
M src/include/optimizer/orclauses.h
M src/include/optimizer/paramassign.h
M src/include/optimizer/pathnode.h
M src/include/optimizer/paths.h
M src/include/optimizer/placeholder.h
M src/include/optimizer/plancat.h
M src/include/optimizer/planmain.h
M src/include/optimizer/planner.h
M src/include/optimizer/prep.h
M src/include/optimizer/restrictinfo.h
M src/include/optimizer/subselect.h
M src/include/optimizer/tlist.h
M src/include/parser/analyze.h
M src/include/parser/kwlist.h
M src/include/parser/parse_agg.h
M src/include/parser/parse_clause.h
M src/include/parser/parse_coerce.h
M src/include/parser/parse_collate.h
M src/include/parser/parse_cte.h
M src/include/parser/parse_enr.h
M src/include/parser/parse_expr.h
M src/include/parser/parse_func.h
M src/include/parser/parse_merge.h
M src/include/parser/parse_node.h
M src/include/parser/parse_oper.h
M src/include/parser/parse_param.h
M src/include/parser/parse_relation.h
M src/include/parser/parse_target.h
M src/include/parser/parse_type.h
M src/include/parser/parse_utilcmd.h
M src/include/parser/parser.h
M src/include/parser/parsetree.h
M src/include/parser/scanner.h
M src/include/parser/scansup.h
M src/include/partitioning/partbounds.h
M src/include/partitioning/partdefs.h
M src/include/partitioning/partdesc.h
M src/include/partitioning/partprune.h
M src/include/pch/meson.build
M src/include/pg_config_manual.h
M src/include/pg_getopt.h
M src/include/pg_trace.h
M src/include/pgstat.h
M src/include/pgtar.h
M src/include/pgtime.h
M src/include/port.h
M src/include/port/atomics.h
M src/include/port/atomics/arch-arm.h
M src/include/port/atomics/arch-hppa.h
M src/include/port/atomics/arch-ppc.h
M src/include/port/atomics/arch-x86.h
M src/include/port/atomics/fallback.h
M src/include/port/atomics/generic-gcc.h
M src/include/port/atomics/generic-msvc.h
M src/include/port/atomics/generic-sunpro.h
M src/include/port/atomics/generic.h
M src/include/port/pg_bitutils.h
M src/include/port/pg_bswap.h
M src/include/port/pg_crc32c.h
M src/include/port/pg_iovec.h
M src/include/port/pg_lfind.h
M src/include/port/simd.h
M src/include/port/win32_port.h
M src/include/port/win32ntdll.h
M src/include/portability/instr_time.h
M src/include/portability/mem.h
M src/include/postgres.h
M src/include/postgres_fe.h
M src/include/postmaster/autovacuum.h
M src/include/postmaster/auxprocess.h
M src/include/postmaster/bgworker.h
M src/include/postmaster/bgworker_internals.h
M src/include/postmaster/bgwriter.h
M src/include/postmaster/fork_process.h
M src/include/postmaster/interrupt.h
M src/include/postmaster/pgarch.h
M src/include/postmaster/postmaster.h
M src/include/postmaster/startup.h
M src/include/postmaster/syslogger.h
M src/include/postmaster/walwriter.h
M src/include/regex/regexport.h
M src/include/replication/decode.h
M src/include/replication/logical.h
M src/include/replication/logicallauncher.h
M src/include/replication/logicalproto.h
M src/include/replication/logicalrelation.h
M src/include/replication/logicalworker.h
M src/include/replication/message.h
M src/include/replication/origin.h
M src/include/replication/output_plugin.h
M src/include/replication/pgoutput.h
M src/include/replication/reorderbuffer.h
M src/include/replication/slot.h
M src/include/replication/snapbuild.h
M src/include/replication/syncrep.h
M src/include/replication/walreceiver.h
M src/include/replication/walsender.h
M src/include/replication/walsender_private.h
M src/include/replication/worker_internal.h
M src/include/rewrite/prs2lock.h
M src/include/rewrite/rewriteDefine.h
M src/include/rewrite/rewriteHandler.h
M src/include/rewrite/rewriteManip.h
M src/include/rewrite/rewriteRemove.h
M src/include/rewrite/rewriteSearchCycle.h
M src/include/rewrite/rewriteSupport.h
M src/include/rewrite/rowsecurity.h
M src/include/snowball/header.h
M src/include/statistics/extended_stats_internal.h
M src/include/statistics/statistics.h
M src/include/storage/backendid.h
M src/include/storage/barrier.h
M src/include/storage/block.h
M src/include/storage/buf.h
M src/include/storage/buf_internals.h
M src/include/storage/buffile.h
M src/include/storage/bufmgr.h
M src/include/storage/bufpage.h
M src/include/storage/checksum.h
M src/include/storage/checksum_impl.h
M src/include/storage/condition_variable.h
M src/include/storage/copydir.h
M src/include/storage/dsm.h
M src/include/storage/dsm_impl.h
M src/include/storage/fd.h
M src/include/storage/fileset.h
M src/include/storage/freespace.h
M src/include/storage/fsm_internals.h
M src/include/storage/indexfsm.h
M src/include/storage/ipc.h
M src/include/storage/item.h
M src/include/storage/itemid.h
M src/include/storage/itemptr.h
M src/include/storage/large_object.h
M src/include/storage/latch.h
M src/include/storage/lmgr.h
M src/include/storage/lock.h
M src/include/storage/lockdefs.h
M src/include/storage/lwlock.h
M src/include/storage/md.h
M src/include/storage/meson.build
M src/include/storage/off.h
M src/include/storage/pg_sema.h
M src/include/storage/pg_shmem.h
M src/include/storage/pmsignal.h
M src/include/storage/predicate.h
M src/include/storage/predicate_internals.h
M src/include/storage/proc.h
M src/include/storage/procarray.h
M src/include/storage/proclist.h
M src/include/storage/proclist_types.h
M src/include/storage/procsignal.h
M src/include/storage/reinit.h
M src/include/storage/relfilelocator.h
M src/include/storage/s_lock.h
M src/include/storage/sharedfileset.h
M src/include/storage/shm_mq.h
M src/include/storage/shm_toc.h
M src/include/storage/shmem.h
M src/include/storage/sinval.h
M src/include/storage/sinvaladt.h
M src/include/storage/smgr.h
M src/include/storage/spin.h
M src/include/storage/standby.h
M src/include/storage/standbydefs.h
M src/include/storage/sync.h
M src/include/tcop/cmdtag.h
M src/include/tcop/cmdtaglist.h
M src/include/tcop/deparse_utility.h
M src/include/tcop/dest.h
M src/include/tcop/fastpath.h
M src/include/tcop/pquery.h
M src/include/tcop/tcopprot.h
M src/include/tcop/utility.h
M src/include/tsearch/dicts/regis.h
M src/include/tsearch/dicts/spell.h
M src/include/tsearch/ts_cache.h
M src/include/tsearch/ts_locale.h
M src/include/tsearch/ts_public.h
M src/include/tsearch/ts_type.h
M src/include/tsearch/ts_utils.h
M src/include/utils/acl.h
M src/include/utils/aclchk_internal.h
M src/include/utils/array.h
M src/include/utils/arrayaccess.h
M src/include/utils/ascii.h
M src/include/utils/attoptcache.h
M src/include/utils/backend_progress.h
M src/include/utils/backend_status.h
M src/include/utils/builtins.h
M src/include/utils/bytea.h
M src/include/utils/catcache.h
M src/include/utils/combocid.h
M src/include/utils/conffiles.h
M src/include/utils/date.h
M src/include/utils/datetime.h
M src/include/utils/datum.h
M src/include/utils/dsa.h
M src/include/utils/dynahash.h
M src/include/utils/elog.h
M src/include/utils/evtcache.h
M src/include/utils/expandeddatum.h
M src/include/utils/expandedrecord.h
M src/include/utils/float.h
M src/include/utils/fmgrtab.h
M src/include/utils/formatting.h
M src/include/utils/freepage.h
M src/include/utils/geo_decls.h
M src/include/utils/guc.h
M src/include/utils/guc_hooks.h
M src/include/utils/guc_tables.h
M src/include/utils/help_config.h
M src/include/utils/hsearch.h
M src/include/utils/index_selfuncs.h
M src/include/utils/inet.h
M src/include/utils/inval.h
M src/include/utils/json.h
M src/include/utils/jsonb.h
M src/include/utils/jsonfuncs.h
M src/include/utils/jsonpath.h
M src/include/utils/logtape.h
M src/include/utils/lsyscache.h
M src/include/utils/memdebug.h
M src/include/utils/memutils.h
M src/include/utils/memutils_internal.h
M src/include/utils/memutils_memorychunk.h
M src/include/utils/meson.build
M src/include/utils/multirangetypes.h
M src/include/utils/numeric.h
M src/include/utils/old_snapshot.h
M src/include/utils/palloc.h
M src/include/utils/partcache.h
M src/include/utils/pg_crc.h
M src/include/utils/pg_locale.h
M src/include/utils/pg_lsn.h
M src/include/utils/pg_rusage.h
M src/include/utils/pgstat_internal.h
M src/include/utils/pidfile.h
M src/include/utils/plancache.h
M src/include/utils/portal.h
M src/include/utils/queryenvironment.h
M src/include/utils/queryjumble.h
M src/include/utils/rangetypes.h
M src/include/utils/regproc.h
M src/include/utils/rel.h
M src/include/utils/relcache.h
M src/include/utils/relfilenumbermap.h
M src/include/utils/relmapper.h
M src/include/utils/relptr.h
M src/include/utils/reltrigger.h
M src/include/utils/resowner.h
M src/include/utils/resowner_private.h
M src/include/utils/rls.h
M src/include/utils/ruleutils.h
M src/include/utils/sampling.h
M src/include/utils/selfuncs.h
M src/include/utils/sharedtuplestore.h
M src/include/utils/snapmgr.h
M src/include/utils/snapshot.h
M src/include/utils/sortsupport.h
M src/include/utils/spccache.h
M src/include/utils/syscache.h
M src/include/utils/timeout.h
M src/include/utils/timestamp.h
M src/include/utils/tuplesort.h
M src/include/utils/tuplestore.h
M src/include/utils/typcache.h
M src/include/utils/tzparser.h
M src/include/utils/uuid.h
M src/include/utils/varbit.h
M src/include/utils/varlena.h
M src/include/utils/wait_event.h
M src/include/utils/xid8.h
M src/include/utils/xml.h
M src/include/windowapi.h
M src/interfaces/ecpg/compatlib/Makefile
M src/interfaces/ecpg/compatlib/meson.build
M src/interfaces/ecpg/ecpglib/Makefile
M src/interfaces/ecpg/ecpglib/meson.build
M src/interfaces/ecpg/ecpglib/po/meson.build
M src/interfaces/ecpg/include/meson.build
M src/interfaces/ecpg/meson.build
M src/interfaces/ecpg/pgtypeslib/Makefile
M src/interfaces/ecpg/pgtypeslib/meson.build
M src/interfaces/ecpg/preproc/Makefile
M src/interfaces/ecpg/preproc/c_kwlist.h
M src/interfaces/ecpg/preproc/check_rules.pl
M src/interfaces/ecpg/preproc/ecpg.c
M src/interfaces/ecpg/preproc/ecpg_kwlist.h
M src/interfaces/ecpg/preproc/keywords.c
M src/interfaces/ecpg/preproc/meson.build
M src/interfaces/ecpg/preproc/parse.pl
M src/interfaces/ecpg/preproc/parser.c
M src/interfaces/ecpg/preproc/pgc.l
M src/interfaces/ecpg/preproc/po/meson.build
M src/interfaces/ecpg/test/compat_informix/meson.build
M src/interfaces/ecpg/test/compat_oracle/meson.build
M src/interfaces/ecpg/test/connect/meson.build
M src/interfaces/ecpg/test/meson.build
M src/interfaces/ecpg/test/pg_regress_ecpg.c
M src/interfaces/ecpg/test/pgtypeslib/meson.build
M src/interfaces/ecpg/test/preproc/meson.build
M src/interfaces/ecpg/test/sql/meson.build
M src/interfaces/ecpg/test/thread/meson.build
M src/interfaces/libpq/Makefile
M src/interfaces/libpq/fe-auth-sasl.h
M src/interfaces/libpq/fe-auth-scram.c
M src/interfaces/libpq/fe-auth.c
M src/interfaces/libpq/fe-auth.h
M src/interfaces/libpq/fe-connect.c
M src/interfaces/libpq/fe-exec.c
M src/interfaces/libpq/fe-gssapi-common.c
M src/interfaces/libpq/fe-gssapi-common.h
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-common.h
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/fe-trace.c
M src/interfaces/libpq/legacy-pqsignal.c
M src/interfaces/libpq/libpq-events.c
M src/interfaces/libpq/libpq-events.h
M src/interfaces/libpq/libpq-fe.h
M src/interfaces/libpq/libpq-int.h
M src/interfaces/libpq/meson.build
M src/interfaces/libpq/po/meson.build
M src/interfaces/libpq/pqexpbuffer.c
M src/interfaces/libpq/pqexpbuffer.h
M src/interfaces/libpq/pthread-win32.c
M src/interfaces/libpq/t/001_uri.pl
M src/interfaces/libpq/t/002_api.pl
M src/interfaces/libpq/test/libpq_testclient.c
M src/interfaces/libpq/test/libpq_uri_regress.c
M src/interfaces/libpq/test/meson.build
M src/interfaces/libpq/win32.c
M src/interfaces/meson.build
M src/makefiles/meson.build
M src/meson.build
M src/pl/meson.build
M src/pl/plperl/meson.build
M src/pl/plperl/plc_perlboot.pl
M src/pl/plperl/plc_trusted.pl
M src/pl/plperl/plperl.h
M src/pl/plperl/plperl_opmask.pl
M src/pl/plperl/po/meson.build
M src/pl/plperl/text2macro.pl
M src/pl/plpgsql/meson.build
M src/pl/plpgsql/src/generate-plerrcodes.pl
M src/pl/plpgsql/src/meson.build
M src/pl/plpgsql/src/pl_comp.c
M src/pl/plpgsql/src/pl_exec.c
M src/pl/plpgsql/src/pl_funcs.c
M src/pl/plpgsql/src/pl_gram.y
M src/pl/plpgsql/src/pl_handler.c
M src/pl/plpgsql/src/pl_reserved_kwlist.h
M src/pl/plpgsql/src/pl_scanner.c
M src/pl/plpgsql/src/pl_unreserved_kwlist.h
M src/pl/plpgsql/src/plpgsql.h
M src/pl/plpgsql/src/po/meson.build
M src/pl/plpython/generate-spiexceptions.pl
M src/pl/plpython/meson.build
M src/pl/plpython/plpython.h
M src/pl/plpython/po/meson.build
M src/pl/tcl/generate-pltclerrcodes.pl
M src/pl/tcl/meson.build
M src/pl/tcl/po/meson.build
M src/port/bsearch_arg.c
M src/port/chklocale.c
M src/port/dirent.c
M src/port/dirmod.c
M src/port/explicit_bzero.c
M src/port/getpeereid.c
M src/port/kill.c
M src/port/meson.build
M src/port/mkdtemp.c
M src/port/noblock.c
M src/port/open.c
M src/port/path.c
M src/port/pg_bitutils.c
M src/port/pg_crc32c_armv8.c
M src/port/pg_crc32c_armv8_choose.c
M src/port/pg_crc32c_sb8.c
M src/port/pg_crc32c_sse42.c
M src/port/pg_crc32c_sse42_choose.c
M src/port/pg_strong_random.c
M src/port/pgcheckdir.c
M src/port/pgsleep.c
M src/port/pgstrcasecmp.c
M src/port/pgstrsignal.c
M src/port/pqsignal.c
M src/port/preadv.c
M src/port/pthread_barrier_wait.c
M src/port/pwritev.c
M src/port/quotes.c
M src/port/snprintf.c
M src/port/strerror.c
M src/port/strlcpy.c
M src/port/strnlen.c
M src/port/strtof.c
M src/port/system.c
M src/port/thread.c
M src/port/win32dlopen.c
M src/port/win32env.c
M src/port/win32error.c
M src/port/win32fdatasync.c
M src/port/win32getrusage.c
M src/port/win32link.c
M src/port/win32ntdll.c
M src/port/win32pread.c
M src/port/win32pwrite.c
M src/port/win32security.c
M src/port/win32setlocale.c
M src/port/win32stat.c
M src/port/win32ver.rc
M src/test/authentication/Makefile
M src/test/authentication/meson.build
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/examples/testlo.c
M src/test/examples/testlo64.c
M src/test/icu/Makefile
M src/test/icu/meson.build
M src/test/icu/t/010_database.pl
M src/test/isolation/isolation_main.c
M src/test/isolation/isolationtester.h
M src/test/isolation/meson.build
M src/test/isolation/specparse.y
M src/test/isolation/specscanner.l
M src/test/kerberos/Makefile
M src/test/kerberos/meson.build
M src/test/kerberos/t/001_auth.pl
M src/test/ldap/Makefile
M src/test/ldap/meson.build
M src/test/ldap/t/001_auth.pl
M src/test/locale/sort-test.pl
M src/test/meson.build
M src/test/modules/brin/meson.build
M src/test/modules/brin/t/01_workitems.pl
M src/test/modules/brin/t/02_wal_consistency.pl
M src/test/modules/commit_ts/meson.build
M src/test/modules/commit_ts/t/001_base.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/delay_execution/delay_execution.c
M src/test/modules/delay_execution/meson.build
M src/test/modules/dummy_index_am/dummy_index_am.c
M src/test/modules/dummy_index_am/meson.build
M src/test/modules/dummy_seclabel/dummy_seclabel.c
M src/test/modules/dummy_seclabel/meson.build
M src/test/modules/libpq_pipeline/libpq_pipeline.c
M src/test/modules/libpq_pipeline/meson.build
M src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
M src/test/modules/meson.build
M src/test/modules/plsample/meson.build
M src/test/modules/plsample/plsample.c
M src/test/modules/snapshot_too_old/meson.build
M src/test/modules/spgist_name_ops/meson.build
M src/test/modules/spgist_name_ops/spgist_name_ops.c
M src/test/modules/ssl_passphrase_callback/meson.build
M src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl
M src/test/modules/test_bloomfilter/meson.build
M src/test/modules/test_bloomfilter/test_bloomfilter.c
M src/test/modules/test_copy_callbacks/meson.build
M src/test/modules/test_copy_callbacks/test_copy_callbacks.c
M src/test/modules/test_custom_rmgrs/meson.build
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/meson.build
M src/test/modules/test_ddl_deparse/test_ddl_deparse.c
M src/test/modules/test_extensions/meson.build
M src/test/modules/test_ginpostinglist/meson.build
M src/test/modules/test_ginpostinglist/test_ginpostinglist.c
M src/test/modules/test_integerset/meson.build
M src/test/modules/test_integerset/test_integerset.c
M src/test/modules/test_lfind/meson.build
M src/test/modules/test_lfind/test_lfind.c
M src/test/modules/test_misc/meson.build
M src/test/modules/test_misc/t/001_constraint_validation.pl
M src/test/modules/test_oat_hooks/meson.build
M src/test/modules/test_oat_hooks/test_oat_hooks.c
M src/test/modules/test_parser/meson.build
M src/test/modules/test_parser/test_parser.c
M src/test/modules/test_pg_db_role_setting/meson.build
M src/test/modules/test_pg_db_role_setting/test_pg_db_role_setting.c
M src/test/modules/test_pg_dump/meson.build
M src/test/modules/test_pg_dump/t/001_base.pl
M src/test/modules/test_predtest/meson.build
M src/test/modules/test_predtest/test_predtest.c
M src/test/modules/test_rbtree/meson.build
M src/test/modules/test_rbtree/test_rbtree.c
M src/test/modules/test_regex/meson.build
M src/test/modules/test_regex/test_regex.c
M src/test/modules/test_rls_hooks/meson.build
M src/test/modules/test_rls_hooks/test_rls_hooks.c
M src/test/modules/test_rls_hooks/test_rls_hooks.h
M src/test/modules/test_shm_mq/meson.build
M src/test/modules/test_shm_mq/setup.c
M src/test/modules/test_shm_mq/test.c
M src/test/modules/test_shm_mq/test_shm_mq.h
M src/test/modules/test_shm_mq/worker.c
M src/test/modules/test_slru/meson.build
M src/test/modules/test_slru/test_slru.c
M src/test/modules/unsafe_tests/meson.build
M src/test/modules/worker_spi/meson.build
M src/test/modules/worker_spi/worker_spi.c
M src/test/perl/Makefile
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/perl/meson.build
M src/test/recovery/Makefile
M src/test/recovery/meson.build
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/004_timeline_switch.pl
M src/test/recovery/t/005_replay_delay.pl
M src/test/recovery/t/006_logical_decoding.pl
M src/test/recovery/t/007_sync_rep.pl
M src/test/recovery/t/008_fsm_truncation.pl
M src/test/recovery/t/009_twophase.pl
M src/test/recovery/t/010_logical_decoding_timelines.pl
M src/test/recovery/t/011_crash_recovery.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/015_promotion_pages.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/021_row_visibility.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/026_overwrite_contrecord.pl
M src/test/recovery/t/028_pitr_timelines.pl
M src/test/recovery/t/029_stats_restart.pl
M src/test/recovery/t/030_stats_cleanup_replica.pl
M src/test/recovery/t/031_recovery_conflict.pl
M src/test/recovery/t/033_replay_tsp_drops.pl
M src/test/regress/GNUmakefile
M src/test/regress/meson.build
M src/test/regress/pg_regress.c
M src/test/regress/pg_regress.h
M src/test/regress/pg_regress_main.c
M src/test/regress/regress.c
M src/test/ssl/Makefile
M src/test/ssl/meson.build
M src/test/ssl/sslfiles.mk
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/Makefile
M src/test/subscription/meson.build
M src/test/subscription/t/001_rep_changes.pl
M src/test/subscription/t/002_types.pl
M src/test/subscription/t/003_constraints.pl
M src/test/subscription/t/004_sync.pl
M src/test/subscription/t/005_encoding.pl
M src/test/subscription/t/006_rewrite.pl
M src/test/subscription/t/007_ddl.pl
M src/test/subscription/t/008_diff_schema.pl
M src/test/subscription/t/009_matviews.pl
M src/test/subscription/t/010_truncate.pl
M src/test/subscription/t/011_generated.pl
M src/test/subscription/t/012_collation.pl
M src/test/subscription/t/013_partition.pl
M src/test/subscription/t/014_binary.pl
M src/test/subscription/t/015_stream.pl
M src/test/subscription/t/016_stream_subxact.pl
M src/test/subscription/t/017_stream_ddl.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/020_messages.pl
M src/test/subscription/t/021_twophase.pl
M src/test/subscription/t/022_twophase_cascade.pl
M src/test/subscription/t/023_twophase_stream.pl
M src/test/subscription/t/024_add_drop_pub.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/029_on_error.pl
M src/test/subscription/t/030_origin.pl
M src/test/subscription/t/031_column_list.pl
M src/test/subscription/t/100_bugs.pl
M src/timezone/meson.build
M src/timezone/pgtz.c
M src/timezone/pgtz.h
M src/timezone/tznames/meson.build
M src/tools/PerfectHash.pm
M src/tools/check_bison_recursion.pl
M src/tools/copyright.pl
M src/tools/fix-old-flex-code.pl
M src/tools/gen_keywordlist.pl
M src/tools/git_changelog
M src/tools/ifaddrs/Makefile
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.pm
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/install.pl
M src/tools/msvc/mkvcbuild.pl
M src/tools/msvc/pgbison.pl
M src/tools/msvc/pgflex.pl
M src/tools/msvc/vcregress.pl
M src/tools/pginclude/cpluspluscheck
M src/tools/pginclude/headerscheck
M src/tools/pginclude/pgcheckdefines
M src/tools/pgindent/pgindent
M src/tools/testint128.c
M src/tools/version_stamp.pl
M src/tools/win32tzlist.pl
M src/tutorial/complex.source
M src/tutorial/syscat.source

Adjust VACUUM hastup LP_REDIRECT comments.

commit   : 325bc54eed4ea0836a0bb715bb18342f0c1c668a    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Mon, 2 Jan 2023 10:18:22 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Mon, 2 Jan 2023 10:18:22 -0800    

Click here for diff

The term "truncation" has been ambiguous since commit 10a8d13823 added  
line pointer array truncation during heap pruning.  Clear things up by  
specifying that we're talking about rel truncation here, to match nearby  
comments that apply to tuples with storage.  

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

Avoid special XID snapshotConflictHorizon values.

commit   : 6daeeb1f9196e5d59aa7d5c9ef7ed67b3f3ac4b5    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Mon, 2 Jan 2023 10:16:51 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Mon, 2 Jan 2023 10:16:51 -0800    

Click here for diff

Don't allow VACUUM to WAL-log the value FrozenTransactionId as the  
snapshotConflictHorizon of freezing or visibility map related WAL  
records.  
  
The only special XID value that's an allowable snapshotConflictHorizon  
is InvalidTransactionId, which is interpreted as "record definitely  
doesn't require a recovery conflict".  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Discussion: https://postgr.es/m/CAH2-WznuNGSzF8v6OsgjaC5aYsb3cZ6HW6MLm30X0d65cmSH6A@mail.gmail.com  

M src/backend/access/heap/vacuumlazy.c
M src/backend/storage/ipc/standby.c

Add bt_multi_page_stats() function to contrib/pageinspect.

commit   : 1fd3dd2048991a164c287dc29fdb78b1f7e6e14e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 2 Jan 2023 13:02:29 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 2 Jan 2023 13:02:29 -0500    

Click here for diff

This is like the existing bt_page_stats() function, but it can  
report on a range of pages rather than just one at a time.  
  
I don't have a huge amount of faith in the portability of the  
new test cases, but they do pass in a 32-bit FreeBSD VM here.  
Further adjustment may be needed depending on buildfarm results.  
  
Hamid Akhtar, reviewed by Naeem Akhter, Bertrand Drouvot,  
Bharath Rupireddy, and myself  
  
Discussion: https://postgr.es/m/CANugjht-=oGMRmNJKMqnBC69y7vr+wHDmm0ZK6-1pJsxoBKBbA@mail.gmail.com  

M contrib/pageinspect/Makefile
M contrib/pageinspect/btreefuncs.c
M contrib/pageinspect/expected/btree.out
M contrib/pageinspect/meson.build
A contrib/pageinspect/pageinspect–1.11–1.12.sql
M contrib/pageinspect/pageinspect.control
M contrib/pageinspect/sql/btree.sql
M doc/src/sgml/pageinspect.sgml

Push lpp variable closer to usage in heapgetpage()

commit   : e351f85418313e97c203c73181757a007dfda6d0    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 2 Jan 2023 09:39:04 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 2 Jan 2023 09:39:04 +0100    

Click here for diff

Author: Melanie Plageman <melanieplageman@gmail.com>  
Discussion: https://www.postgresql.org/message-id/flat/CAAKRu_YSOnhKsDyFcqJsKtBSrd32DP-jjXmv7hL0BPD-z0TGXQ@mail.gmail.com  

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

doc: Re-order Table 28.2 "Collected Statistics Views"

commit   : 72e0ff2677c44ea9047cf515fade9742476e2508    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 2 Jan 2023 08:45:17 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 2 Jan 2023 08:45:17 +0100    

Click here for diff

Make the order more sensible and repeatable.  Comments have been added  
to guide future additions.  
  
Author: Peter Smith <peter.b.smith@fujitsu.com>  
Reviewed-by: David G. Johnston <david.g.johnston@gmail.com>  
Discussion: https://www.postgresql.org/message-id/flat/CAHut+Pv8Oa7v06hJb3+HzCtM2u-3oHWMdvXVHhvi7ofB83pNbg@mail.gmail.com  

M doc/src/sgml/monitoring.sgml

Accept "+infinity" in date and timestamp[tz] input.

commit   : 2ceea5adb02603ef52579b568ca2c5aebed87358    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 1 Jan 2023 14:16:07 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 1 Jan 2023 14:16:07 -0500    

Click here for diff

The float and numeric types accept this variant spelling of  
"infinity", so it seems like the datetime types should too.  
  
Vik Fearing, some cosmetic mods by me  
  
Discussion: https://postgr.es/m/d0bef637-2dbd-0a5d-e539-48243b6f6c5e@postgresfriends.org  

M src/backend/utils/adt/datetime.c
M src/test/regress/expected/date.out
M src/test/regress/expected/timestamp.out
M src/test/regress/expected/timestamptz.out
M src/test/regress/sql/date.sql
M src/test/regress/sql/timestamp.sql
M src/test/regress/sql/timestamptz.sql

In plpgsql, don't preassign portal names to bound cursor variables.

commit   : d747dc85aec536c471fd7c739695e155627b08fd    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 1 Jan 2023 13:22:34 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 1 Jan 2023 13:22:34 -0500    

Click here for diff

A refcursor variable that is bound to a specific query (by declaring  
it with "CURSOR FOR") now chooses a portal name in the same way as an  
unbound, plain refcursor variable.  Its string value starts out as  
NULL, and unless that's overridden by manual assignment, it will be  
replaced by a unique-within-session portal name during OPEN.  
  
The previous behavior was to initialize such variables to contain  
their own name, resulting in that also being the portal name unless  
the user overwrote it before OPEN.  The trouble with this is that  
it causes failures due to conflicting portal names if the same  
cursor variable name is used in different functions.  It is pretty  
non-orthogonal to have bound and unbound refcursor variables behave  
differently on this point, too, so let's change it.  
  
This change can cause compatibility problems for applications that  
open a bound cursor in a plpgsql function and then use it in the  
calling code without explicitly passing back the refcursor value  
(portal name).  If the calling code simply assumes that the portal  
name matches the called function's variable name, it will now fail.  
That can be fixed by explicitly assigning a string value to the  
refcursor variable before OPEN, e.g.  
  
    DECLARE myc CURSOR FOR SELECT ...;  
    BEGIN  
      myc := 'myc';  -- add this  
      OPEN myc;  
  
We have no documentation examples showing the troublesome usage  
pattern, so we can hope it's rare in practice.  
  
Patch by me; thanks to Pavel Stehule and Jan Wieck for review.  
  
Discussion: https://postgr.es/m/1465101.1667345983@sss.pgh.pa.us  

M doc/src/sgml/plpgsql.sgml
M doc/src/sgml/ref/declare.sgml
M src/pl/plpgsql/src/pl_gram.y
M src/test/regress/expected/plpgsql.out
M src/test/regress/sql/plpgsql.sql

ci: Change macOS builds from Intel to ARM.

commit   : 14d63dd2523c5292c4fcab4f45a7f534859c4518    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Sun, 1 Jan 2023 10:45:18 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Sun, 1 Jan 2023 10:45:18 +1300    

Click here for diff

Cirrus is about to shut down its macOS-on-Intel support, so it's time to  
move our CI testing over to ARM instances.  The Homebrew package manager  
changed its default installation prefix for the new architecture, so a  
couple of tests need tweaks to find binaries.  
  
Back-patch to 15, where in-tree CI began.  
  
Author: Justin Pryzby <pryzby@telsasoft.com>  
Discussion: https://postgr.es/m/20221122225744.GF11463%40telsasoft.com  

M .cirrus.yml
M src/test/kerberos/t/001_auth.pl
M src/test/ldap/t/001_auth.pl

Sample postgres_fdw tables remotely during ANALYZE

commit   : 8ad51b5f446b5c19ba2c0033a0f7b3180b3b6d95    
  
author   : Tomas Vondra <tomas.vondra@postgresql.org>    
date     : Fri, 30 Dec 2022 23:14:53 +0100    
  
committer: Tomas Vondra <tomas.vondra@postgresql.org>    
date     : Fri, 30 Dec 2022 23:14:53 +0100    

Click here for diff

When collecting ANALYZE sample on foreign tables, postgres_fdw fetched  
all rows and performed the sampling locally. For large tables this means  
transferring and immediately discarding large amounts of data.  
  
This commit allows the sampling to be performed on the remote server,  
transferring only the much smaller sample. The sampling is performed  
using the built-in TABLESAMPLE methods (system, bernoulli) or random()  
function, depending on the remote server version.  
  
Remote sampling can be enabled by analyze_sampling on the foreign server  
and/or foreign table, with supported values 'off', 'auto', 'system',  
'bernoulli' and 'random'. The default value is 'auto' which uses either  
'bernoulli' (TABLESAMPLE method) or 'random' (for remote servers without  
TABLESAMPLE support).  

M contrib/postgres_fdw/deparse.c
M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/option.c
M contrib/postgres_fdw/postgres_fdw.c
M contrib/postgres_fdw/postgres_fdw.h
M contrib/postgres_fdw/sql/postgres_fdw.sql
M doc/src/sgml/postgres-fdw.sgml

Fix assert in BRIN build_distances

commit   : 02699bc1fd3b7fccba2e6b55189a148ef69b8a00    
  
author   : Tomas Vondra <tomas.vondra@postgresql.org>    
date     : Fri, 30 Dec 2022 19:44:48 +0100    
  
committer: Tomas Vondra <tomas.vondra@postgresql.org>    
date     : Fri, 30 Dec 2022 19:44:48 +0100    

Click here for diff

When brin_minmax_multi_union merges summaries, we may end up with just a  
single range after merge_overlapping_ranges. The summaries may contain  
just one range each, and they may overlap (or be exactly the same).  
  
With a single range there's no distance to calculate, but we happen to  
call build_distances anyway - which is fine, we don't calculate the  
distance in this case, except that with asserts this failed due to a  
check there are at least two ranges.  
  
The assert is unnecessarily strict, so relax it a bit and bail out if  
there's just a single range. The relaxed assert would be enough, but  
this way we don't allocate unnecessary memory for distance.  
  
Backpatch to 14, where minmax-multi opclasses were introduced.  
  
Reported-by: Jaime Casanova  
Backpatch-through: 14  
Discussion: https://postgr.es/m/YzVA55qS0hgz8P3r@ahch-to  

M src/backend/access/brin/brin_minmax_multi.c

Fix precision handling for some COERCE_SQL_SYNTAX functions

commit   : 7aa81c61ec8f68212570192f3088544dbfa43cb9    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Fri, 30 Dec 2022 20:47:57 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Fri, 30 Dec 2022 20:47:57 +0900    

Click here for diff

f193883 has been incorrectly setting up the precision used in the  
timestamp compilations returned by the following functions:  
- LOCALTIME  
- LOCALTIMESTAMP  
- CURRENT_TIME  
- CURRENT_TIMESTAMP  
  
Specifying an out-of-range precision for CURRENT_TIMESTAMP and  
LOCALTIMESTAMP was raising a WARNING without adjusting the precision,  
leading to a subsequent error.  LOCALTIME and CURRENT_TIME raised a  
WARNING without an error, still the precision given to the internal  
routines was not correct, so let's be clean.  
  
Ian has reported the problems in timestamp.c, while I have noticed the  
ones in date.c.  Regression tests are added for all of them with  
precisions high enough to provide coverage for the warnings, something  
that went missing up to this commit.  
  
Author: Ian Lawrence Barwick, Michael Paquier  
Discussion: https://postgr.es/m/CAB8KJ=jQEnn9sYG+N752spt68wMrhmT-ocHCh4oeNmHF82QMWA@mail.gmail.com  

M src/backend/utils/adt/date.c
M src/backend/utils/adt/timestamp.c
M src/test/regress/expected/expressions.out
M src/test/regress/sql/expressions.sql

Change argument of appendBinaryStringInfo from char * to void *

commit   : 1f605b82ba66ece8b421b10d41094dd2e3c0c48b    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 30 Dec 2022 10:59:25 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 30 Dec 2022 10:59:25 +0100    

Click here for diff

There is some code that uses this function to assemble some kind of  
packed binary layout, which requires a bunch of casts because of this.  
Functions taking binary data plus length should take void * instead,  
like memcpy() for example.  
  
Discussion: https://www.postgresql.org/message-id/flat/a0086cfc-ff0f-2827-20fe-52b591d2666c%40enterprisedb.com  

M src/backend/utils/adt/jsonpath.c
M src/backend/utils/adt/xid8funcs.c
M src/common/stringinfo.c
M src/include/lib/stringinfo.h

Use appendStringInfoString instead of appendBinaryStringInfo where possible

commit   : 33a33f0ba4d70a704e2d6bb8ee85f29fe18cead9    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 30 Dec 2022 10:59:25 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 30 Dec 2022 10:59:25 +0100    

Click here for diff

For the jsonpath output, we don't need to squeeze out every bit of  
performance, so instead use a more robust coding style.  There are  
similar calls in jsonb.c, which we leave alone here since there is  
indeed a performance impact for bulk exports.  
  
Discussion: https://www.postgresql.org/message-id/flat/a0086cfc-ff0f-2827-20fe-52b591d2666c%40enterprisedb.com  

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

Add const to BufFileWrite

commit   : faf3750657a8271e2a28c054fd83e47302ac1eb4    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 30 Dec 2022 10:02:59 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 30 Dec 2022 10:02:59 +0100    

Click here for diff

Make data buffer argument to BufFileWrite a const pointer and bubble  
this up to various callers and related APIs.  This makes the APIs  
clearer and more consistent.  
  
Discussion: https://www.postgresql.org/message-id/flat/11dda853-bb5b-59ba-a746-e168b1ce4bdb%40enterprisedb.com  

M src/backend/access/gist/gistbuildbuffers.c
M src/backend/backup/backup_manifest.c
M src/backend/storage/file/buffile.c
M src/backend/utils/sort/logtape.c
M src/include/storage/buffile.h
M src/include/utils/logtape.h

Remove unnecessary casts

commit   : 5f2f99c9c62d754c19e090cb57fdd929438ea519    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 30 Dec 2022 10:02:59 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 30 Dec 2022 10:02:59 +0100    

Click here for diff

Some code carefully cast all data buffer arguments for data write and  
read function calls to void *, even though the respective arguments  
are already void *.  Remove this unnecessary clutter.  
  
Discussion: https://www.postgresql.org/message-id/flat/11dda853-bb5b-59ba-a746-e168b1ce4bdb%40enterprisedb.com  

M src/backend/executor/nodeAgg.c
M src/backend/storage/file/buffile.c
M src/backend/utils/sort/logtape.c
M src/backend/utils/sort/tuplesort.c
M src/backend/utils/sort/tuplesortvariants.c

perl: Hide warnings inside perl.h when using gcc compatible compiler

commit   : 388e80132c007a7528abc987e347e41432dc1542    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Thu, 29 Dec 2022 12:47:29 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Thu, 29 Dec 2022 12:47:29 -0800    

Click here for diff

New versions of perl trigger warnings within perl.h with our compiler  
flags. At least -Wdeclaration-after-statement, -Wshadow=compatible-local are  
known to be problematic.  
  
To avoid these warnings, conditionally use #pragma GCC system_header before  
including plperl.h.  
  
Alternatively, we could add the include paths for problematic headers with  
-isystem, but that is a larger hammer and is harder to search for.  
  
A more granular alternative would be to use #pragma GCC diagnostic  
push/ignored/pop, but gcc warns about unknown warnings being ignored, so every  
to-be-ignored-temporarily compiler warning would require its own pg_config.h  
symbol and #ifdef.  
  
As the warnings are voluminous, it makes sense to backpatch this change. But  
don't do so yet, we first want gather buildfarm coverage - it's e.g. possible  
that some compiler claiming to be gcc compatible has issues with the pragma.  
  
Author: Andres Freund <andres@anarazel.de>  
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>  
Discussion: Discussion: https://postgr.es/m/20221228182455.hfdwd22zztvkojy2@awork3.anarazel.de  

M src/include/c.h
M src/pl/plperl/plperl.h

Fix oversight in 7a05425d96

commit   : 203942243c2a2da188db962f3384f1c607a462b5    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Thu, 29 Dec 2022 07:16:41 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Thu, 29 Dec 2022 07:16:41 -0500    

Click here for diff

This patch was changed as a result of review but one line didn't get the  
message. Mea Culpa.  

M contrib/ltree/ltree_io.c

Add page-level freezing to VACUUM.

commit   : 1de58df4fec7325d91f5a8345757314be7ac05da    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 28 Dec 2022 08:50:47 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Wed, 28 Dec 2022 08:50:47 -0800    

Click here for diff

Teach VACUUM to decide on whether or not to trigger freezing at the  
level of whole heap pages.  Individual XIDs and MXIDs fields from tuple  
headers now trigger freezing of whole pages, rather than independently  
triggering freezing of each individual tuple header field.  
  
Managing the cost of freezing over time now significantly influences  
when and how VACUUM freezes.  The overall amount of WAL written is the  
single most important freezing related cost, in general.  Freezing each  
page's tuples together in batch allows VACUUM to take full advantage of  
the freeze plan WAL deduplication optimization added by commit 9e540599.  
  
Also teach VACUUM to trigger page-level freezing whenever it detects  
that heap pruning generated an FPI.  We'll have already written a large  
amount of WAL just to do that much, so it's very likely a good idea to  
get freezing out of the way for the page early.  This only happens in  
cases where it will directly lead to marking the page all-frozen in the  
visibility map.  
  
In most cases "freezing a page" removes all XIDs < OldestXmin, and all  
MXIDs < OldestMxact.  It doesn't quite work that way in certain rare  
cases involving MultiXacts, though.  It is convenient to define "freeze  
the page" in a way that gives FreezeMultiXactId the leeway to put off  
the work of processing an individual tuple's xmax whenever it happens to  
be a MultiXactId that would require an expensive second pass to process  
aggressively (allocating a new multi is especially worth avoiding here).  
FreezeMultiXactId is eager when processing is cheap (as it usually is),  
and lazy in the event of an individual multi that happens to require  
expensive second pass processing.  This avoids regressions related to  
processing of multis that page-level freezing might otherwise cause.  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Reviewed-By: Jeff Davis <pgsql@j-davis.com>  
Reviewed-By: Andres Freund <andres@anarazel.de>  
Discussion: https://postgr.es/m/CAH2-WzkFok_6EAHuK39GaW4FjEFQsY=3J0AAd6FXk93u-Xq3Fg@mail.gmail.com  

M doc/src/sgml/config.sgml
M src/backend/access/heap/heapam.c
M src/backend/access/heap/vacuumlazy.c
M src/include/access/heapam.h

Convert contrib/ltree's input functions to report errors softly

commit   : 7a05425d96742acff5ebfacf307711385c88429b    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 28 Dec 2022 09:58:04 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 28 Dec 2022 09:58:04 -0500    

Click here for diff

Reviewed by Tom Lane and Amul Sul  
  
Discussion: https://postgr.es/m/49e598c2-cfe8-0928-b6fb-d0cc51aab626@dunslane.net  

M contrib/ltree/expected/ltree.out
M contrib/ltree/ltree_io.c
M contrib/ltree/ltxtquery_io.c
M contrib/ltree/sql/ltree.sql

Convert contrib/intarray's bqarr_in() to report errors softly

commit   : 3b76622e04d8656fb44e7c932cb243e2d92fe40e    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 28 Dec 2022 09:53:00 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 28 Dec 2022 09:53:00 -0500    

Click here for diff

Reviewed by Tom Lane and Amul Sul  
  
Discussion: https://postgr.es/m/49e598c2-cfe8-0928-b6fb-d0cc51aab626@dunslane.net  

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

Reorder some object files in makefiles

commit   : 24b55cd949a11b712927acf2557683976ee149ac    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Wed, 28 Dec 2022 14:20:53 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Wed, 28 Dec 2022 14:20:53 +0100    

Click here for diff

This restores some once-intended alphabetical orders and makes the  
lists consistent between the different build systems.  

M src/bin/pg_basebackup/Makefile
M src/common/Makefile
M src/tools/msvc/Mkvcbuild.pm

Suppress uninitialized-variable warning from a61b1f748.

commit   : adb5c32eb53e1ffdc5c954aafcc5bc9ed93f3de6    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 18:07:48 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 18:07:48 -0500    

Click here for diff

Some compilers complain about sub_rteperminfos not being  
initialized, evidently because they don't detect that it  
is only used and set if isGeneralSelect is true.  
Make it follow the long-established pattern for its  
sibling variable sub_rtable.  
  
Per reports from Pavel Stehule and the buildfarm.  
  
Discussion: https://postgr.es/m/CAFj8pRDOvGOi-n616kM0Cc7qSbg_nGoS=-haB+D785sUXADqSg@mail.gmail.com  

M src/backend/parser/analyze.c

Convert hstore_in to report errors softly.

commit   : 197f98a848233f2d8d8e7f7fd7dde3e49adaaaa3    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 14:50:56 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 14:50:56 -0500    

Click here for diff

The error reporting here was not only old and crufty, but untested.  
I took the opportunity to bring the messages into some sort of  
compliance with our message style guidelines.  
  
Discussion: https://postgr.es/m/6B6A5C77-60AD-4A71-9F3A-B2C026A281A6@dunslane.net  

M contrib/hstore/expected/hstore.out
M contrib/hstore/hstore_io.c
M contrib/hstore/sql/hstore.sql

Remove new locale dependency in regproc regression test.

commit   : a5434c52586f37db7f538d3dcc8aa6dd62dfe61e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 13:06:42 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 13:06:42 -0500    

Click here for diff

The modified error message for regcollationin failure includes  
the database encoding, which it should've occurred to me is a  
portability hazard for the regression tests.  Adjust the test  
so the expected output doesn't include that.  
  
In passing, fix a comment typo introduced in b8c0ffbd2.  
  
Per buildfarm.  

M src/backend/utils/adt/domains.c
M src/test/regress/expected/regproc.out
M src/test/regress/sql/regproc.sql

Simplify the implementations of the to_reg* functions.

commit   : 3ea7329c9a79ade27b5d3742d1a41ce6d0d9aca8    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 12:33:04 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 12:33:04 -0500    

Click here for diff

Given the soft-input-error feature, we can reduce these functions  
to be just thin wrappers around a soft-error call of the  
corresponding datatype input function.  This means less code and  
more certainty that the to_reg* functions match the normal input  
behavior.  
  
Notably, it also means that they will accept numeric OID input,  
which they didn't before.  It's not clear to me if that omission  
had more than laziness behind it, but it doesn't seem like  
something we need to work hard to preserve.  
  
Discussion: https://postgr.es/m/3910031.1672095600@sss.pgh.pa.us  

M doc/src/sgml/func.sgml
M src/backend/utils/adt/regproc.c

Convert the reg* input functions to report (most) errors softly.

commit   : 858e776c84f48841e7e16fba7b690b76e54f3675    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 12:26:01 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 12:26:01 -0500    

Click here for diff

This is not really complete, but it catches most cases of practical  
interest.  The main omissions are:  
  
* regtype, regprocedure, and regoperator parse type names by  
calling the main grammar, so any grammar-detected syntax error  
will still be a hard error.  Also, if one includes a type  
modifier in such a type specification, errors detected by the  
typmodin function will be hard errors.  
  
* Lookup errors are handled just by passing missing_ok = true  
to the relevant catalog lookup function.  Because we've used  
quite a restrictive definition of "missing_ok", this means that  
edge cases such as "the named schema exists, but you lack  
USAGE permission on it" are still hard errors.  
  
It would make sense to me to replace most/all missing_ok  
parameters with an escontext parameter and then allow these  
additional lookup failure cases to be trapped too.  But that's  
a job for some other day.  
  
Discussion: https://postgr.es/m/3342239.1671988406@sss.pgh.pa.us  

M src/backend/catalog/objectaddress.c
M src/backend/parser/parse_type.c
M src/backend/tsearch/dict_thesaurus.c
M src/backend/utils/adt/misc.c
M src/backend/utils/adt/regproc.c
M src/backend/utils/adt/tsvector_op.c
M src/backend/utils/cache/ts_cache.c
M src/backend/utils/fmgr/funcapi.c
M src/include/parser/parse_type.h
M src/include/utils/regproc.h
M src/pl/plperl/plperl.c
M src/pl/plpgsql/src/pl_gram.y
M src/pl/plpython/plpy_spi.c
M src/pl/tcl/pltcl.c
M src/test/regress/expected/regproc.out
M src/test/regress/sql/regproc.sql

Convert tsqueryin and tsvectorin to report errors softly.

commit   : 78212f21011449f0374831323655baa7c00f3680    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 12:00:31 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 12:00:31 -0500    

Click here for diff

This is slightly tedious because the adjustments cascade through  
a couple of levels of subroutines, but it's not very hard.  
I chose to avoid changing function signatures more than absolutely  
necessary, by passing the escontext pointer in existing structs  
where possible.  
  
tsquery's nuisance NOTICEs about empty queries are suppressed in  
soft-error mode, since they're not errors and we surely don't want  
them to be shown to the user anyway.  Maybe that whole behavior  
should be reconsidered.  
  
Discussion: https://postgr.es/m/3824377.1672076822@sss.pgh.pa.us  

M src/backend/tsearch/to_tsany.c
M src/backend/utils/adt/tsquery.c
M src/backend/utils/adt/tsquery_cleanup.c
M src/backend/utils/adt/tsvector.c
M src/backend/utils/adt/tsvector_parser.c
M src/include/tsearch/ts_utils.h
M src/test/regress/expected/tstypes.out
M src/test/regress/sql/tstypes.sql

Detect bad input for types xid, xid8, and cid.

commit   : eb8312a22a84c33fc405ae9b497113973f552f90    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 11:40:01 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 27 Dec 2022 11:40:01 -0500    

Click here for diff

Historically these input functions just called strtoul or strtoull  
and returned the result, with no error detection whatever.  Upgrade  
them to reject garbage input and out-of-range values, similarly to  
our other numeric input routines.  
  
To share the code for this with type oid, adjust the existing  
"oidin_subr" to be agnostic about the SQL name of the type it is  
handling, and move it to numutils.c; then clone it for 64-bit types.  
  
Because the xid types previously accepted hex and octal input by  
reason of calling strtoul[l] with third argument zero, I made the  
common subroutine do that too, with the consequence that type oid  
now also accepts hex and octal input.  In view of 6fcda9aba, that  
seems like a good thing.  
  
While at it, simplify the existing over-complicated handling of  
syntax errors from strtoul: we only need one ereturn not three.  
  
Discussion: https://postgr.es/m/3526121.1672000729@sss.pgh.pa.us  

M src/backend/utils/adt/numutils.c
M src/backend/utils/adt/oid.c
M src/backend/utils/adt/xid.c
M src/include/utils/builtins.h
M src/test/regress/expected/xid.out
M src/test/regress/sql/xid.sql

Remove overzealous MultiXact freeze assertion.

commit   : 63c844a0a5d70cdbd6ae0470d582d39e75ad8d66    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Mon, 26 Dec 2022 23:36:02 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Mon, 26 Dec 2022 23:36:02 -0800    

Click here for diff

When VACUUM determines that an existing MultiXact should use a freeze  
plan that sets xmax to InvalidTransactionId, the original Multi may or  
may not be before OldestMxact.  Remove an incorrect assertion that  
expected it to always be from before OldestMxact.  
  
Oversight in commit 4ce3af.  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Reported-By: Hayato Kuroda <kuroda.hayato@fujitsu.com>  
Discussion: https://postgr.es/m/TYAPR01MB5866B24104FD80B5D7E65C3EF5ED9@TYAPR01MB5866.jpnprd01.prod.outlook.com  

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

Add custom filtering rules to the TAP tests of pg_upgrade

commit   : 9814ff550046f825b751803191b29a2fbbc79283    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Tue, 27 Dec 2022 14:35:56 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Tue, 27 Dec 2022 14:35:56 +0900    

Click here for diff

002_pg_upgrade.pl gains support for a new environment variable called  
"filter_rules", that can be used to point to a file that includes a  
set of custom regular expressions that would be applied to the dumps of  
the origin and target clusters when doing a cross-version test (aka when  
defining olddump and oldinstall), to give the possibility to reshape  
dynamically the dumps in the same way as the internals of the buildfarm  
code so as the tests are able to pass in scenarios where one expects  
them to even if pg_dump generates slightly-different outputs depending  
on the versions involved.  
  
This option is not used when pg_upgrade runs with the same version for  
the origin and target clusters, and it is the last piece I see as  
required to be able to plug-in more efficiently the TAP tests of  
pg_upgrade with the buildfarm or just a CI.  
  
Author: Anton A. Melnikov  
Discussion: https://postgr.es/m/49f389ba-95ce-8a9b-09ae-f60650c0e7c7@inbox.ru  

M src/bin/pg_upgrade/TESTING
M src/bin/pg_upgrade/t/002_pg_upgrade.pl

Fix incorrect copy-pasto in error message of pg_waldump.c

commit   : 2259c661dc4ecd88ac22b5358248f47ca5a5d4fc    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Tue, 27 Dec 2022 12:16:24 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Tue, 27 Dec 2022 12:16:24 +0900    

Click here for diff

The error message used on fclose() failure was incorrect, so fix it.  
Oversight in d497093, that I have somehow managed to miss.  

M src/bin/pg_waldump/pg_waldump.c

pg_waldump: Add --save-fullpage=PATH to save full page images from WAL records

commit   : d497093cbecccf6df26365e06a5f8f8614b591c8    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Tue, 27 Dec 2022 08:27:53 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Tue, 27 Dec 2022 08:27:53 +0900    

Click here for diff

This option extracts (potentially decompressing) full-page images  
included in WAL records into a given target directory.  These images are  
subject to the same filtering rules as the normal display of the WAL  
records, hence with --relation one can for example extract only the FPIs  
issued on the relation defined.  By default, the records are printed or  
their stats computed (--stats), using --quiet would only save the images  
without any output generated.  
  
This is a tool aimed mostly for very experienced users, useful for  
fixing page-level corruption or just analyzing the past state of a page,  
and there were no easy way to do that with the in-core tools up to now  
when looking at WAL.  
  
Each block is saved in a separate file, to ease their manipulation, with  
the file respecting <lsn>.<ts>.<db>.<rel>.<blk>_<fork> with as format.  
  
For instance, 00000000-010000C0.1663.1.6117.123_main refers to:  
- WAL record LSN in hexa format (00000000-010000C0).  
- Tablespace OID (1663).  
- Database OID (1).  
- Relfilenode (6117).  
- Block number (123).  
- Fork name of the file this block came from (_main).  
  
Author: David Christensen  
Reviewed-by: Sho Kato, Justin Pryzby, Bharath Rupireddy, Matthias van de  
Meent  
Discussion: https://postgr.es/m/CAOxo6XKjQb2bMSBRpePf3ZpzfNTwjQUc4Tafh21=jzjX6bX8CA@mail.gmail.com  

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

Add 'logical_decoding_mode' GUC.

commit   : 5de94a041ed7a51b571db2030ba87600c7fc6262    
  
author   : Amit Kapila <akapila@postgresql.org>    
date     : Mon, 26 Dec 2022 08:58:16 +0530    
  
committer: Amit Kapila <akapila@postgresql.org>    
date     : Mon, 26 Dec 2022 08:58:16 +0530    

Click here for diff

This enables streaming or serializing changes immediately in logical  
decoding. This parameter is intended to be used to test logical decoding  
and replication of large transactions for which otherwise we need to  
generate the changes till logical_decoding_work_mem is reached.  
  
This helps in reducing the timing of existing tests related to logical  
replication of in-progress transactions and will help in writing tests for  
for the upcoming feature for parallelly applying large in-progress  
transactions.  
  
Author: Shi yu  
Reviewed-by: Sawada Masahiko, Shveta Mallik, Amit Kapila, Dilip Kumar, Kuroda Hayato, Kyotaro Horiguchi  
Discussion: https://postgr.es/m/OSZPR01MB63104E7449DBE41932DB19F1FD1B9@OSZPR01MB6310.jpnprd01.prod.outlook.com  

M doc/src/sgml/config.sgml
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/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
M src/tools/pgindent/typedefs.list

Switch query fixing aclitems in ~15 from O(N^2) to O(N) in upgrade_adapt.sql

commit   : d3c0cc4447307a2ffbcff8274573b544294e583c    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Mon, 26 Dec 2022 08:00:55 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Mon, 26 Dec 2022 08:00:55 +0900    

Click here for diff

f4f2f2b was doing a sequential scan of pg_class before checking if a  
relation had attributes dependent on aclitem as data typewhen building  
the set of ALTER TABLE queries, but it would be costly on a regression  
database.  
  
While on it, make the query style more consistent with the rest.  
  
Reported-by: Justin Pryzby  
Discussion: https://postgr.es/m/20221223032724.GQ1153@telsasoft.com  

M src/bin/pg_upgrade/upgrade_adapt.sql

Convert enum_in() to report errors softly.

commit   : 442e25d2485b1ecf3357725acee995a1c349163d    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 25 Dec 2022 14:32:02 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 25 Dec 2022 14:32:02 -0500    

Click here for diff

I missed this in my initial survey, probably because I examined  
the contents of pg_type in the postgres database, which lacks  
any enumerated types.  
  
Discussion: https://postgr.es/m/CAAJ_b97KeDWUdpTKGOaFYPv0OicjOu6EW+QYWj-Ywrgj_aEy1g@mail.gmail.com  

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

Fix thinko in 720e0327bc

commit   : 361ec4368b1da252e031e2ee8bce366bce5f72b2    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Sun, 25 Dec 2022 04:36:58 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Sun, 25 Dec 2022 04:36:58 -0500    

Click here for diff

M contrib/isn/isn.c

Convert contrib/isn's input functions to report errors softly

commit   : 720e0327bc98464b889801a65ae2358f86a0265a    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Sat, 24 Dec 2022 15:28:13 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Sat, 24 Dec 2022 15:28:13 -0500    

Click here for diff

M contrib/isn/expected/isn.out
M contrib/isn/isn.c
M contrib/isn/sql/isn.sql

Convert jsonpath's input function to report errors softly

commit   : e37fe1db6ef930f657be28fe764f7e642b93464a    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Sat, 24 Dec 2022 15:19:14 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Sat, 24 Dec 2022 15:19:14 -0500    

Click here for diff

Reviewed by Tom Lane  
  
Discussion: https://postgr.es/m/a8dc5700-c341-3ba8-0507-cc09881e6200@dunslane.net  

M src/backend/utils/adt/jsonpath.c
M src/backend/utils/adt/jsonpath_exec.c
M src/backend/utils/adt/jsonpath_gram.y
M src/backend/utils/adt/jsonpath_internal.h
M src/backend/utils/adt/jsonpath_scan.l
M src/include/utils/jsonpath.h
M src/test/regress/expected/jsonpath.out
M src/test/regress/sql/jsonpath.sql

Make the numeric-OID cases of regprocin and friends be non-throwing.

commit   : 780ec9f1b2a44c118d1246325404ad0ed2226cbf    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 24 Dec 2022 15:01:21 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 24 Dec 2022 15:01:21 -0500    

Click here for diff

While at it, use a common subroutine already.  
  
This doesn't move the needle very far in terms of making these  
functions non-throwing; the only case we're now able to trap is  
numeric-OID-is-out-of-range.  Still, it seems like a pretty  
non-controversial step in that direction.  

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

Fix recent accidental omission in pg_proc.dat

commit   : b5aff9255700b0b3155a4d2be865b6a776c2bda4    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Sat, 24 Dec 2022 13:18:35 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Sat, 24 Dec 2022 13:18:35 +1300    

Click here for diff

ed1a88dda added support functions for the ntile(), percent_rank() and  
cume_dist() window functions but neglected to actually add these support  
functions to the pg_proc entry for the corresponding window function.  
  
Also, take this opportunity to add these window functions to one of the  
regression tests added in ed1a88dda to give the support functions a little  
bit of exercise.  If I'd done that in the first place then the omission  
would have been more obvious.  
  
Bump the catversion, again.  

M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.dat
M src/test/regress/expected/window.out
M src/test/regress/sql/window.sql

Rework <warning> box about column list combining in logical replication

commit   : c6f21b2ac215ad870a95159ea22024f734429622    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 23 Dec 2022 17:49:51 +0100    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 23 Dec 2022 17:49:51 +0100    

Click here for diff

After some copy-edit I made in commit 3a06a79cd137, we have a <sect2>  
that only contains a warning box.  This doesn't look good.  Rework by  
moving the sect2 title to be the warning's title, and put the 'id' to it  
as well, so that the external reference continues to work.  
  
Backpatch to 15.  
  
In branch master, I also take the opportunity to add titles to a couple  
of other warning boxes elsewhere in the documentation.  
  
Discussion: https://postgr.es/m/20221219164713.ccnlvtkyj6lmshqq@alvherre.pgsql  

M doc/src/sgml/logical-replication.sgml
M doc/src/sgml/mvcc.sgml
M doc/src/sgml/ref/pg_rewind.sgml

Fix end LSN determination in recently added test

commit   : 6602599ce25665394112b944f3cdbd68a2587d97    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 23 Dec 2022 17:27:05 +0100    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 23 Dec 2022 17:27:05 +0100    

Click here for diff

The test added in commit e44dae07f931 has a thinko: it wants to read  
info about a few WAL records, but it obtains the LSN of the final record  
to read by asking for the WAL insert position; however,  
pg_get_wal_records_info only accepts to read up to the flush position  
(cf. IsFutureLSN()).  In normal conditions there is no difference, since  
the last record written by the preceding loop is known flushed and it's  
the one the test wants; but it's possible to have some other process  
insert another WAL record that isn't flushed, and that causes the whole  
test to explode.  
  
Fix by having pg_get_wal_records_info() read only up to the flushed  
position.  Backpatch to 15, which is where pg_walinspect appeared.  
  
Author: Karina Litskevich <litskevichkarina@gmail.com>  
Discussion: https://postgr.es/m/a5559c95-52c3-5eea-cd63-9b4f1c70ff96@gmail.com  

M src/test/modules/brin/t/02_wal_consistency.pl

Convert contrib/seg's input function to report errors softly

commit   : 878ce16056c087e2dcd7cc31cd7e4700f407a770    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Fri, 23 Dec 2022 09:17:24 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Fri, 23 Dec 2022 09:17:24 -0500    

Click here for diff

Reviewed by Tom Lane  
  
Discussion: https://postgr.es/m/a8dc5700-c341-3ba8-0507-cc09881e6200@dunslane.net  

M contrib/seg/expected/seg.out
M contrib/seg/seg.c
M contrib/seg/segdata.h
M contrib/seg/segparse.y
M contrib/seg/segscan.l
M contrib/seg/sql/seg.sql

Fix event trigger example

commit   : 7a310338f4dd3195376477d502e93fba5f165769    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 23 Dec 2022 13:21:41 +0100    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Fri, 23 Dec 2022 13:21:41 +0100    

Click here for diff

Commit 2f9661311b changed command tags from strings to numbers, but  
forgot to adjust the code in the event trigger example, which  
consequently failed to compile.  
  
While fixing that, improve the indentation to adhere to pgindent style.  
  
Backpatch to v13, where the change was introduced.  
  
Author: Laurenz Albe  
Discussion: https://postgr.es/m/81e36ac17dc80489e74dc5b6914afa6ccdb1a99d.camel@cybertec.at  

M doc/src/sgml/event-trigger.sgml

Fix bug in translate_col_privs_multilevel

commit   : bbfdf7180de85f9e7e995ba00dddc58452b3ba4b    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Sat, 24 Dec 2022 00:58:34 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Sat, 24 Dec 2022 00:58:34 +1300    

Click here for diff

Fix incorrect code which was trying to convert a Bitmapset of columns at  
the attnums according to a parent table and transform them into the  
equivalent Bitmapset with same attnums according to the given child table.  
This code is new as of a61b1f748 and was failing to do the correct  
translation when there was an intermediate parent table between 'rel' and  
'top_parent_rel'.  
  
Reported-by: Ranier Vilela  
Author: Richard Guo, Amit Langote  
Discussion: https://postgr.es/m/CAEudQArohfB_Gy%2BhcH2-bANUkxgjJiP%3DABq01_LgTNTbcNijag%40mail.gmail.com  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/sql/postgres_fdw.sql
M src/backend/optimizer/util/inherit.c

Allow parent's WaitEventSets to be freed after fork().

commit   : b5d0f8ec01c021452203b2fd3921c9b55f6c3cd3    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 23 Dec 2022 20:26:52 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 23 Dec 2022 20:26:52 +1300    

Click here for diff

An epoll fd belonging to the parent should be closed in the child.  A  
kqueue fd is automatically closed by fork(), but we should still adjust  
our counter.  For poll and Windows systems, nothing special is required.  
On all systems we free the memory.  
  
No caller yet, but we'll need this if we start using WaitEventSet in the  
postmaster as planned.  
  
Reviewed-by: Andres Freund <andres@anarazel.de>  
Discussion: https://postgr.es/m/CA%2BhUKG%2BZ-HpOj1JsO9eWUP%2Bar7npSVinsC_npxSy%2BjdOMsx%3DGg%40mail.gmail.com  

M src/backend/storage/ipc/latch.c
M src/include/storage/latch.h

Don't leak a signalfd when using latches in the postmaster.

commit   : 1f0019de2fe374fa54fca277f36c2e754894db30    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 23 Dec 2022 20:24:41 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 23 Dec 2022 20:24:41 +1300    

Click here for diff

At the time of commit 6a2a70a02 we didn't use latch infrastructure in  
the postmaster.  We're planning to start doing that, so we'd better make  
sure that the signalfd inherited from a postmaster is not duplicated and  
then leaked in the child.  
  
Reviewed-by: Andres Freund <andres@anarazel.de>  
Reviewed-by: Justin Pryzby <pryzby@telsasoft.com>  
Discussion: https://postgr.es/m/CA%2BhUKG%2BZ-HpOj1JsO9eWUP%2Bar7npSVinsC_npxSy%2BjdOMsx%3DGg%40mail.gmail.com  

M src/backend/storage/ipc/latch.c

Add WL_SOCKET_ACCEPT event to WaitEventSet API.

commit   : 30829e52ff1a026c0b6ad042e7e5f39ff6abf9bb    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 23 Dec 2022 20:21:47 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 23 Dec 2022 20:21:47 +1300    

Click here for diff

To be able to handle incoming connections on a server socket with  
the WaitEventSet API, we'll need a new kind of event to indicate that  
the the socket is ready to accept a connection.  
  
On Unix, it's just the same as WL_SOCKET_READABLE, but on Windows there  
is a different underlying kernel event that we need to map our  
abstraction to.  
  
No user yet, but a proposed patch would use this.  
  
Reviewed-by: Andres Freund <andres@anarazel.de>  
Discussion: https://postgr.es/m/CA%2BhUKG%2BZ-HpOj1JsO9eWUP%2Bar7npSVinsC_npxSy%2BjdOMsx%3DGg%40mail.gmail.com  

M src/backend/storage/ipc/latch.c
M src/include/storage/latch.h

Update upgrade_adapt.sql to handle tables using aclitem as data type

commit   : f4f2f2b84a0bbf9edbfc4a8684040a941cd6d085    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Fri, 23 Dec 2022 11:36:57 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Fri, 23 Dec 2022 11:36:57 +0900    

Click here for diff

The regression test suite includes a table called "tab_core_types" that  
has one attribute based on the type "aclitem".  Keeping this attribute  
as-is causes hard failures when running pg_upgrade with an origin on  
~15.  This commit updates upgrade_adapt.sql to automatically detect the  
tables with such attributes and switch them to text so as pg_upgrade  
is able to go through its run.  
  
This does not provide the same detection coverage as pg_upgrade, where  
we are able to find out aclitems used in arrays, domains or even  
composite types, but this is (I guess) enough for most things like an  
instance that had installcheck run on before the upgrade with a dump  
generated from it.  
  
Note that the buildfarm code has taken the simplest approach of just  
dropping "tab_core_types", so what we have here is more modular.  
  
Author: Anton A. Melnikov  
Discussion: https://postgr.es/m/49f389ba-95ce-8a9b-09ae-f60650c0e7c7@inbox.ru  

M src/bin/pg_upgrade/upgrade_adapt.sql

Fix some incorrectness in upgrade_adapt.sql on query for WITH OIDS

commit   : 3022cb14339656be2afeee72150dcc5725838398    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Fri, 23 Dec 2022 11:26:49 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Fri, 23 Dec 2022 11:26:49 +0900    

Click here for diff

The query used to disable WITH OIDS in all the relations making use of  
it was checking for materialized views, but this is not a supported  
operation.  On the contrary, this needs to be done on foreign tables.  
  
While on it, use quote_ident() in the ALTER TABLE strings built on the  
relation name.  
  
Author: Anton A. Melnikov, Michael Paquier  
Discussion: https://postgr.es/m/49f389ba-95ce-8a9b-09ae-f60650c0e7c7@inbox.ru  
Backpatch-through: 12  

M src/bin/pg_upgrade/upgrade_adapt.sql

Fix come incorrect elog() messages in aclchk.c

commit   : 2fcf685f6daa4f872ca726e25cc504a544916dbb    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Fri, 23 Dec 2022 10:04:18 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Fri, 23 Dec 2022 10:04:18 +0900    

Click here for diff

Three error strings used with cache lookup failures were referring to  
incorrect object types for ACL checks:  
- Schemas  
- Types  
- Foreign Servers  
There errors should never be triggered, but if they do incorrect  
information would be reported.  
  
Author: Justin Pryzby  
Discussion: https://postgr.es/m/20221222153041.GN1153@telsasoft.com  
Backpatch-through: 11  

M src/backend/catalog/aclchk.c

Rename pg_dissect_walfile_name() to pg_split_walfile_name()

commit   : 13e0d7a603852b8b05c03b45228daabffa0cced2    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Fri, 23 Dec 2022 09:15:01 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Fri, 23 Dec 2022 09:15:01 +0900    

Click here for diff

The former name was discussed as being confusing, so use "split", as per  
a suggestion from Magnus Hagander.  
  
While on it, one of the output arguments is renamed from "segno" to  
"segment_number", as per a suggestion from Kyotaro Horiguchi.  
  
The documentation is updated to reflect all these changes.  
  
Bump catalog version.  
  
Author: Bharath Rupireddy, Michael Paquier  
Discussion: https://postgr.es/m/CABUevEytQVaOOhGdoh0D7hGwe3fuKcRF6NthsSW7ww04EmtFgQ@mail.gmail.com  

M doc/src/sgml/func.sgml
M src/backend/access/transam/xlogfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.dat
M src/test/regress/expected/misc_functions.out
M src/test/regress/sql/misc_functions.sql

Allow window functions to adjust their frameOptions

commit   : ed1a88ddaccfe883e4cf74d30319accfeae6cfe5    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Fri, 23 Dec 2022 12:43:52 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Fri, 23 Dec 2022 12:43:52 +1300    

Click here for diff

WindowFuncs such as row_number() don't care if it's called with ROWS  
UNBOUNDED PRECEDING AND CURRENT ROW or with RANGE UNBOUNDED PRECEDING AND  
CURRENT ROW.  The latter is less efficient as the RANGE option requires  
that the executor check for peer rows, so using the ROW option instead  
would cause less overhead.  Because RANGE is part of the default frame  
options for WindowClauses, it means WindowAgg is, by default, working much  
harder than it needs to for window functions where the ROWS / RANGE option  
has no effect on the window function's result.  
  
On a test query from the discussion thread, a performance improvement of  
344% was seen by using ROWS instead of RANGE.  
  
Here we add a new support function node type to allow support functions to  
be called for window functions so that the most optimal version of the  
frame options can be set.  The planner has been adjusted so that the frame  
options are changed only if all window functions sharing the same window  
clause agree on what the optimized frame options are.  
  
Here we give the ability for row_number(), rank(), dense_rank(),  
percent_rank(), cume_dist() and ntile() to alter their WindowClause's  
frameOptions.  
  
Reviewed-by: Vik Fearing, Erwin Brandstetter, Zhihong Yu  
Discussion: https://postgr.es/m/CAGHENJ7LBBszxS+SkWWFVnBmOT2oVsBhDMB1DFrgerCeYa_DyA@mail.gmail.com  
Discussion: https://postgr.es/m/CAApHDvohAKEtTXxq7Pc-ic2dKT8oZfbRKeEJP64M0B6+S88z+A@mail.gmail.com  

M src/backend/optimizer/plan/planner.c
M src/backend/parser/parse_agg.c
M src/backend/utils/adt/windowfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.dat
M src/include/nodes/supportnodes.h
M src/test/regress/expected/window.out
M src/test/regress/sql/window.sql

Improve notation of cacheinfo table in syscache.c.

commit   : cc150596341e2a7913519769a88a1537c2e94720    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 23 Dec 2022 10:40:18 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 23 Dec 2022 10:40:18 +1300    

Click here for diff

Use C99 designated initializer syntax for the array elements, instead of  
writing the enumerator name and position in a comment.  Replace nkeys  
and key with a local variadic macro, for a shorter notation.  
  
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>  
Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com>  
Discussion: https://postgr.es/m/CA%2BhUKGKdpDjKL2jgC-GpoL4DGZU1YPqnOFHbDqFkfRQcPaR5DQ%40mail.gmail.com  

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

Use scanned_pages to decide when to failsafe check.

commit   : 07eef53955ea9885dd3e4701b7eaa34ccdf2ae02    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Thu, 22 Dec 2022 10:41:40 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Thu, 22 Dec 2022 10:41:40 -0800    

Click here for diff

Perform a failsafe check every time VACUUM's first heap scan scans a  
further FAILSAFE_EVERY_PAGES pages, rather than using an approach based  
on the number of physical blocks that our current blkno is from the  
blkno at the time of the previous failsafe check.  That way VACUUM will  
perform a failsafe check every time it has scanned a uniform number of  
pages, without it mattering when or how VACUUM skipped pages using the  
visibility map.  
  
Sami Imseih, with changes to FAILSAFE_EVERY_PAGES comments added by me.  
  
Author: Sami Imseih <simseih@amazon.com>  
Reviewed-By: Peter Geoghegan <pg@bowt.ie>  
Discussion: https://postgr.es/m/401CE010-4049-4B94-9961-0B610A5D254D%40amazon.com  

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

Refactor how VACUUM passes around its XID cutoffs.

commit   : 4ce3afb82ecfbf64d4f6247e725004e1da30f47c    
  
author   : Peter Geoghegan <pg@bowt.ie>    
date     : Thu, 22 Dec 2022 09:37:59 -0800    
  
committer: Peter Geoghegan <pg@bowt.ie>    
date     : Thu, 22 Dec 2022 09:37:59 -0800    

Click here for diff

Use a dedicated struct for the XID/MXID cutoffs used by VACUUM, such as  
FreezeLimit and OldestXmin.  This state is initialized in vacuum.c, and  
then passed around by code from vacuumlazy.c to heapam.c freezing  
related routines.  The new convention is that everybody works off of the  
same cutoff state, which is passed around via pointers to const.  
  
Also simplify some of the logic for dealing with frozen xmin in  
heap_prepare_freeze_tuple: add dedicated "xmin_already_frozen" state to  
clearly distinguish xmin XIDs that we're going to freeze from those that  
were already frozen from before.  That way the routine's xmin handling  
code is symmetrical with the existing xmax handling code.  This is  
preparation for an upcoming commit that will add page level freezing.  
  
Also refactor the control flow within FreezeMultiXactId(), while adding  
stricter sanity checks.  We now test OldestXmin directly, instead of  
using FreezeLimit as an inexact proxy for OldestXmin.  This is further  
preparation for the page level freezing work, which will make the  
function's caller cede control of page level freezing to the function  
where appropriate (where heap_prepare_freeze_tuple sees a tuple that  
happens to contain a MultiXactId in its xmax).  
  
Author: Peter Geoghegan <pg@bowt.ie>  
Reviewed-By: Jeff Davis <pgsql@j-davis.com>  
Discussion: https://postgr.es/m/CAH2-WznS9TxXmz2_=SY+SyJyDFbiOftKofM9=aDo68BbXNBUMA@mail.gmail.com  

M src/backend/access/heap/heapam.c
M src/backend/access/heap/vacuumlazy.c
M src/backend/access/transam/multixact.c
M src/backend/commands/cluster.c
M src/backend/commands/vacuum.c
M src/include/access/heapam.h
M src/include/access/tableam.h
M src/include/commands/vacuum.h

Avoid O(N^2) cost when pulling up lots of UNION ALL subqueries.

commit   : e42e312430279dcd8947846fdfeb4885e3754eac    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 22 Dec 2022 11:02:03 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 22 Dec 2022 11:02:03 -0500    

Click here for diff

perform_pullup_replace_vars() knows how to scan the whole parent  
query tree when we are replacing Vars during a subquery flattening  
operation.  However, for the specific case of flattening a  
UNION ALL leaf query, that's mostly wasted work: the only place  
where relevant Vars could exist is in the AppendRelInfo that we  
just made for this leaf.  Teaching perform_pullup_replace_vars()  
to just deal with that and exit is worthwhile because, if we have  
N such subqueries to pull up, we were spending O(N^2) work uselessly  
mutating the AppendRelInfos for all the other subqueries.  
  
While we're at it, avoid calling substitute_phv_relids if there are no  
PlaceHolderVars, and remove an obsolete check of parse->hasSubLinks.  
  
Andrey Lepikhov and Tom Lane  
  
Discussion: https://postgr.es/m/703c09a2-08f3-d2ec-b33d-dbecd62428b8@postgrespro.ru  

M src/backend/optimizer/prep/prepjointree.c

Add some recursion and looping defenses in prepjointree.c.

commit   : 5beb7881fb27d1830fa4c57ba263c8042449a599    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 22 Dec 2022 10:35:02 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 22 Dec 2022 10:35:02 -0500    

Click here for diff

Andrey Lepikhov demonstrated a case where we spend an unreasonable  
amount of time in pull_up_subqueries().  Not only is that recursing  
with no explicit check for stack overrun, but the code seems not  
interruptable by control-C.  Let's stick a CHECK_FOR_INTERRUPTS  
there, along with sprinkling some stack depth checks.  
  
An actual fix for the excessive time consumption seems a bit  
risky to back-patch; but this isn't, so let's do so.  
  
Discussion: https://postgr.es/m/703c09a2-08f3-d2ec-b33d-dbecd62428b8@postgrespro.ru  

M src/backend/optimizer/prep/prepjointree.c

Remove dead code

commit   : 73bb72f0ca2833329b59ebaf9476be3be71e462f    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 22 Dec 2022 08:12:41 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 22 Dec 2022 08:12:41 +0100    

Click here for diff

The second appearance of NamespaceRelationId in this if-else chain is  
in error and can be removed.  

M src/backend/catalog/aclchk.c

Add work-around for VA_ARGS_NARGS() on MSVC.

commit   : 3f28bd7337d7c01820283fee51027a9dc9d2295f    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Thu, 22 Dec 2022 17:14:23 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Thu, 22 Dec 2022 17:14:23 +1300    

Click here for diff

The previous coding of VA_ARGS_NARGS() always returned 1 on Visual  
Studio, because it treats __VA_ARGS__ as a single token unless you jump  
through extra hoops.  Newer compilers have an option to fix that.  Add a  
comment about that so that we can remember to clean this up in the  
future when our minimum MSVC version advances.  
  
Author: Victor Spirin <v.spirin@postgrespro.ru>  
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>  
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>  
Reviewed-by: Michael Paquier <michael@paquier.xyz>  
Discussion: https://postgr.es/m/f450fc57-a147-19d0-e50c-33571c52cc13%40postgrespro.ru  

M src/include/c.h

Fix operator typo in tablecmds.c

commit   : 01be9d498fa4b836ec3dbf035b6743c8b8f34767    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Thu, 22 Dec 2022 12:08:45 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Thu, 22 Dec 2022 12:08:45 +0900    

Click here for diff

A bitwise operator was getting used on two bools in  
ATAddCheckConstraint() to track if constraints should be merged or not  
with the existing ones of a relation, though obviously this should use  
a boolean OR operator.  This led to the same result, but let's be  
clean.  
  
Oversight in 074c5cf.  
  
Author: Ranier Vilela  
Reviewed-by: Justin Pryzby  
Discussion: https://postgr.es/m/CAEudQAp2R2fbbi0OHHhv_n4=Ch0t1VtjObR9YMqtGKHJ+faUFQ@mail.gmail.com  

M src/backend/commands/tablecmds.c

Add palloc_aligned() to allow aligned memory allocations

commit   : 439f61757f054109f9ee5415530a2744f7e5cb7a    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Thu, 22 Dec 2022 13:32:05 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Thu, 22 Dec 2022 13:32:05 +1300    

Click here for diff

This introduces palloc_aligned() and MemoryContextAllocAligned() which  
allow callers to obtain memory which is allocated to the given size and  
also aligned to the specified alignment boundary.  The alignment  
boundaries may be any power-of-2 value.  Currently, the alignment is  
capped at 2^26, however, we don't expect values anything like that large.  
The primary expected use case is to align allocations to perhaps CPU  
cache line size or to maybe I/O page size.  Certain use cases can benefit  
from having aligned memory by either having better performance or more  
predictable performance.  
  
The alignment is achieved by requesting 'alignto' additional bytes from  
the underlying allocator function and then aligning the address that is  
returned to the requested alignment.  This obviously does waste some  
memory, so alignments should be kept as small as what is required.  
  
It's also important to note that these alignment bytes eat into the  
maximum allocation size.  So something like:  
  
palloc_aligned(MaxAllocSize, 64, 0);  
  
will not work as we cannot request MaxAllocSize + 64 bytes.  
  
Additionally, because we're just requesting the requested size plus the  
alignment requirements from the given MemoryContext, if that context is  
the Slab allocator, then since slab can only provide chunks of the size  
that's specified when the slab context is created, then this is not going  
to work.  Slab will generate an error to indicate that the requested size  
is not supported.  
  
The alignment that is requested in palloc_aligned() is stored along with  
the allocated memory.  This allows the alignment to remain intact through  
repalloc() calls.  
  
Author: Andres Freund, David Rowley  
Reviewed-by: Maxim Orlov, Andres Freund, John Naylor  
Discussion: https://postgr.es/m/CAApHDvpxLPUMV1mhxs6g7GNwCP6Cs6hfnYQL5ffJQTuFAuxt8A%40mail.gmail.com  

M src/backend/utils/cache/catcache.c
M src/backend/utils/mmgr/Makefile
A src/backend/utils/mmgr/alignedalloc.c
M src/backend/utils/mmgr/mcxt.c
M src/backend/utils/mmgr/meson.build
M src/include/utils/memutils_internal.h
M src/include/utils/memutils_memorychunk.h
M src/include/utils/palloc.h

Fix contrib/seg to be more wary of long input numbers.

commit   : 701c881f782b93ee29587112390bd3bfe035e78d    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 21 Dec 2022 17:51:50 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 21 Dec 2022 17:51:50 -0500    

Click here for diff

seg stores the number of significant digits in an input number  
in a "char" field.  If char is signed, and the input is more than  
127 digits long, the count can read out as negative causing  
seg_out() to print garbage (or, if you're really unlucky,  
even crash).  
  
To fix, clamp the digit count to be not more than FLT_DIG.  
(In theory this loses some information about what the original  
input was, but it doesn't seem like useful information; it would  
not survive dump/restore in any case.)  
  
Also, in case there are stored values of the seg type containing  
bad data, add a clamp in seg_out's restore() subroutine.  
  
Per bug #17725 from Robins Tharakan.  It's been like this  
forever, so back-patch to all supported branches.  
  
Discussion: https://postgr.es/m/17725-0a09313b67fbe86e@postgresql.org  

M contrib/seg/expected/seg.out
M contrib/seg/seg.c
M contrib/seg/segparse.y
M contrib/seg/sql/seg.sql

Introduce float4in_internal

commit   : 33dd895ef3316bd1896def6882e9075359d7e9af    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 21 Dec 2022 08:37:17 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Wed, 21 Dec 2022 08:37:17 -0500    

Click here for diff

This is the guts of float4in, callable as a routine to input floats,  
which will be useful in an upcoming patch for allowing soft errors in  
the seg module's input function.  
  
A similar operation was performed some years ago for float8in in  
commit 50861cd683e.  
  
Reviewed by Tom Lane  
  
Discussion: https://postgr.es/m/cee4e426-d014-c0b7-aa22-a659f2cd9130@dunslane.net  

M src/backend/utils/adt/float.c
M src/include/utils/float.h

Fix newly introduced bug in slab.c

commit   : eb706fde8302c32267518663032905556db21f57    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Thu, 22 Dec 2022 09:57:49 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Thu, 22 Dec 2022 09:57:49 +1300    

Click here for diff

d21ded75f changed the way slab.c works but introduced a bug that meant we  
could end up with the slab's curBlocklistIndex pointing to the wrong list.  
The condition which was checking for this was failing to account for two  
things:  
  
1. The curBlocklistIndex could be 0 as we've currently got no non-full  
blocks to put chunks on.  In this case, the dlist_is_empty() check cannot  
be performed as there can be any number of completely full blocks at that  
index.  
  
2. The curBlocklistIndex may be greater than the index we just moved the  
block onto.  Since we need to ensure we fill up fuller blocks first, we  
must reset curBlocklistIndex when changing any blocklist element that's  
less than the curBlocklistIndex too.  
  
Reported-by: Takamichi Osumi  
Discussion: https://postgr.es/m/TYCPR01MB8373329C6329768D7E093D68EDEB9@TYCPR01MB8373.jpnprd01.prod.outlook.com  

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

commit   : f450695e8899fcaffd1da06b6ef1b7f39abcac89    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Wed, 21 Dec 2022 10:39:06 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Wed, 21 Dec 2022 10:39:06 +0900    

Click here for diff

This commit changes some of the bbstreamer files and pg_dump to use the  
same style as a few other places (like common/compression.c), where the  
name of the compression method is not part of the string, but an  
argument of it.  This reduces a bit the translation work with less  
string patterns.  
  
Discussion: https://postgr.es/m/Y5/5tdK+4n3clvtU@paquier.xyz  

M src/bin/pg_basebackup/bbstreamer_gzip.c
M src/bin/pg_basebackup/bbstreamer_lz4.c
M src/bin/pg_basebackup/bbstreamer_zstd.c
M src/bin/pg_dump/compress_io.c

Switch some system functions to use get_call_result_type()

commit   : 22e3b558052aa209cba2a8fec192d76b5faef19e    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Wed, 21 Dec 2022 10:11:22 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Wed, 21 Dec 2022 10:11:22 +0900    

Click here for diff

This shaves some code by replacing the combinations of  
CreateTemplateTupleDesc()/TupleDescInitEntry() hardcoding a mapping of  
the attributes listed in pg_proc.dat by get_call_result_type() to build  
the TupleDesc needed for the rows generated.  
  
get_call_result_type() is more expensive than the former style, but this  
removes some duplication with the lists of OUT parameters (pg_proc.dat  
and the attributes hardcoded in these code paths).  This is applied to  
functions that are not considered as critical (aka that could be called  
repeatedly for monitoring purposes).  
  
Author: Bharath Rupireddy  
Reviewed-by: Robert Haas, Álvaro Herrera, Tom Lane, Michael Paquier  
Discussion: https://postgr.es/m/CALj2ACV23HW5HP5hFjd89FNS-z5X8r2jNXdMXcpN2BgTtKd87w@mail.gmail.com  

M contrib/old_snapshot/time_mapping.c
M contrib/pg_visibility/pg_visibility.c
M src/backend/access/transam/commit_ts.c
M src/backend/access/transam/multixact.c
M src/backend/catalog/objectaddress.c
M src/backend/commands/sequence.c
M src/backend/tsearch/wparser.c
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/misc.c
M src/backend/utils/adt/partitionfuncs.c
M src/backend/utils/adt/tsvector_op.c
M src/backend/utils/misc/pg_controldata.c

Use existing SSL certs in LDAP tests instead of generating them

commit   : f03bd5717eaf31569ca797a2f7d65608f88ac2a2    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 19 Dec 2022 05:58:08 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Mon, 19 Dec 2022 05:58:08 -0500    

Click here for diff

The SSL test suite has a bunch of pre-existing certificates, so it's  
better simply to use what we already have than generate new certificates  
each time the LDAP tests are run.  
  
Discussion: https://postgr.es/m/bc305c7a-f390-44f2-2e82-9bcaec6108da@dunslane.net  

M src/test/ldap/Makefile
M src/test/ldap/meson.build
M src/test/ldap/t/001_auth.pl
M src/test/ssl/README

commit   : 8284cf5f746f84303eda34d213e89c8439a83a42    
  
author   : Andrew Dunstan <andrew@dunslane.net>    
date     : Tue, 20 Dec 2022 07:54:39 -0500    
  
committer: Andrew Dunstan <andrew@dunslane.net>    
date     : Tue, 20 Dec 2022 07:54:39 -0500    

Click here for diff

Discussion: https://postgr.es/m/222b43a5-2fb3-2c1b-9cd0-375d376c8246@dunslane.net  

M contrib/adminpack/meson.build
M contrib/amcheck/meson.build
M contrib/auth_delay/meson.build
M contrib/auto_explain/meson.build
M contrib/basebackup_to_shell/meson.build
M contrib/basic_archive/meson.build
M contrib/bloom/meson.build
M contrib/bool_plperl/meson.build
M contrib/btree_gin/meson.build
M contrib/btree_gist/meson.build
M contrib/citext/meson.build
M contrib/cube/meson.build
M contrib/dblink/meson.build
M contrib/dict_int/meson.build
M contrib/dict_xsyn/meson.build
M contrib/earthdistance/meson.build
M contrib/file_fdw/meson.build
M contrib/fuzzystrmatch/meson.build
M contrib/hstore/meson.build
M contrib/hstore_plperl/meson.build
M contrib/hstore_plpython/meson.build
M contrib/intagg/meson.build
M contrib/intarray/meson.build
M contrib/isn/meson.build
M contrib/jsonb_plperl/meson.build
M contrib/jsonb_plpython/meson.build
M contrib/lo/meson.build
M contrib/ltree/meson.build
M contrib/ltree_plpython/meson.build
M contrib/meson.build
M contrib/oid2name/meson.build
M contrib/old_snapshot/meson.build
M contrib/pageinspect/meson.build
M contrib/passwordcheck/meson.build
M contrib/pg_buffercache/meson.build
M contrib/pg_freespacemap/meson.build
M contrib/pg_prewarm/meson.build
M contrib/pg_stat_statements/meson.build
M contrib/pg_surgery/meson.build
M contrib/pg_trgm/meson.build
M contrib/pg_visibility/meson.build
M contrib/pg_walinspect/meson.build
M contrib/pgcrypto/meson.build
M contrib/pgrowlocks/meson.build
M contrib/pgstattuple/meson.build
M contrib/postgres_fdw/meson.build
M contrib/seg/meson.build
M contrib/sepgsql/meson.build
M contrib/spi/meson.build
M contrib/sslinfo/meson.build
M contrib/tablefunc/meson.build
M contrib/tcn/meson.build
M contrib/test_decoding/meson.build
M contrib/tsm_system_rows/meson.build
M contrib/tsm_system_time/meson.build
M contrib/unaccent/meson.build
M contrib/uuid-ossp/meson.build
M contrib/vacuumlo/meson.build
M contrib/xml2/meson.build
M doc/src/sgml/meson.build
M meson.build
M meson_options.txt
M src/backend/access/brin/meson.build
M src/backend/access/common/meson.build
M src/backend/access/gin/meson.build
M src/backend/access/gist/meson.build
M src/backend/access/hash/meson.build
M src/backend/access/heap/meson.build
M src/backend/access/index/meson.build
M src/backend/access/meson.build
M src/backend/access/nbtree/meson.build
M src/backend/access/rmgrdesc/meson.build
M src/backend/access/spgist/meson.build
M src/backend/access/table/meson.build
M src/backend/access/tablesample/meson.build
M src/backend/access/transam/meson.build
M src/backend/backup/meson.build
M src/backend/bootstrap/meson.build
M src/backend/catalog/meson.build
M src/backend/commands/meson.build
M src/backend/executor/meson.build
M src/backend/foreign/meson.build
M src/backend/jit/llvm/meson.build
M src/backend/jit/meson.build
M src/backend/lib/meson.build
M src/backend/libpq/meson.build
M src/backend/main/meson.build
M src/backend/meson.build
M src/backend/nodes/meson.build
M src/backend/optimizer/geqo/meson.build
M src/backend/optimizer/meson.build
M src/backend/optimizer/path/meson.build
M src/backend/optimizer/plan/meson.build
M src/backend/optimizer/prep/meson.build
M src/backend/optimizer/util/meson.build
M src/backend/parser/meson.build
M src/backend/partitioning/meson.build
M src/backend/po/meson.build
M src/backend/port/meson.build
M src/backend/port/win32/meson.build
M src/backend/postmaster/meson.build
M src/backend/regex/meson.build
M src/backend/replication/libpqwalreceiver/meson.build
M src/backend/replication/logical/meson.build
M src/backend/replication/meson.build
M src/backend/replication/pgoutput/meson.build
M src/backend/rewrite/meson.build
M src/backend/snowball/meson.build
M src/backend/statistics/meson.build
M src/backend/storage/buffer/meson.build
M src/backend/storage/file/meson.build
M src/backend/storage/freespace/meson.build
M src/backend/storage/ipc/meson.build
M src/backend/storage/large_object/meson.build
M src/backend/storage/lmgr/meson.build
M src/backend/storage/meson.build
M src/backend/storage/page/meson.build
M src/backend/storage/smgr/meson.build
M src/backend/storage/sync/meson.build
M src/backend/tcop/meson.build
M src/backend/tsearch/meson.build
M src/backend/utils/activity/meson.build
M src/backend/utils/adt/meson.build
M src/backend/utils/cache/meson.build
M src/backend/utils/error/meson.build
M src/backend/utils/fmgr/meson.build
M src/backend/utils/hash/meson.build
M src/backend/utils/init/meson.build
M src/backend/utils/mb/conversion_procs/meson.build
M src/backend/utils/mb/meson.build
M src/backend/utils/meson.build
M src/backend/utils/misc/meson.build
M src/backend/utils/mmgr/meson.build
M src/backend/utils/resowner/meson.build
M src/backend/utils/sort/meson.build
M src/backend/utils/time/meson.build
M src/bin/initdb/meson.build
M src/bin/initdb/po/meson.build
M src/bin/meson.build
M src/bin/pg_amcheck/meson.build
M src/bin/pg_amcheck/po/meson.build
M src/bin/pg_archivecleanup/meson.build
M src/bin/pg_archivecleanup/po/meson.build
M src/bin/pg_basebackup/meson.build
M src/bin/pg_basebackup/po/meson.build
M src/bin/pg_checksums/meson.build
M src/bin/pg_checksums/po/meson.build
M src/bin/pg_config/meson.build
M src/bin/pg_config/po/meson.build
M src/bin/pg_controldata/meson.build
M src/bin/pg_controldata/po/meson.build
M src/bin/pg_ctl/meson.build
M src/bin/pg_ctl/po/meson.build
M src/bin/pg_dump/meson.build
M src/bin/pg_dump/po/meson.build
M src/bin/pg_resetwal/meson.build
M src/bin/pg_resetwal/po/meson.build
M src/bin/pg_rewind/meson.build
M src/bin/pg_rewind/po/meson.build
M src/bin/pg_test_fsync/meson.build
M src/bin/pg_test_fsync/po/meson.build
M src/bin/pg_test_timing/meson.build
M src/bin/pg_test_timing/po/meson.build
M src/bin/pg_upgrade/meson.build
M src/bin/pg_upgrade/po/meson.build
M src/bin/pg_verifybackup/meson.build
M src/bin/pg_verifybackup/po/meson.build
M src/bin/pg_waldump/meson.build
M src/bin/pg_waldump/po/meson.build
M src/bin/pgbench/meson.build
M src/bin/pgevent/meson.build
M src/bin/psql/meson.build
M src/bin/psql/po/meson.build
M src/bin/scripts/meson.build
M src/bin/scripts/po/meson.build
M src/common/meson.build
M src/common/unicode/meson.build
M src/fe_utils/meson.build
M src/include/catalog/meson.build
M src/include/meson.build
M src/include/nodes/meson.build
M src/include/pch/meson.build
M src/include/storage/meson.build
M src/include/utils/meson.build
M src/interfaces/ecpg/compatlib/meson.build
M src/interfaces/ecpg/ecpglib/meson.build
M src/interfaces/ecpg/ecpglib/po/meson.build
M src/interfaces/ecpg/include/meson.build
M src/interfaces/ecpg/meson.build
M src/interfaces/ecpg/pgtypeslib/meson.build
M src/interfaces/ecpg/preproc/meson.build
M src/interfaces/ecpg/preproc/po/meson.build
M src/interfaces/ecpg/test/compat_informix/meson.build
M src/interfaces/ecpg/test/compat_oracle/meson.build
M src/interfaces/ecpg/test/connect/meson.build
M src/interfaces/ecpg/test/meson.build
M src/interfaces/ecpg/test/pgtypeslib/meson.build
M src/interfaces/ecpg/test/preproc/meson.build
M src/interfaces/ecpg/test/sql/meson.build
M src/interfaces/ecpg/test/thread/meson.build
M src/interfaces/libpq/meson.build
M src/interfaces/libpq/po/meson.build
M src/interfaces/libpq/test/meson.build
M src/interfaces/meson.build
M src/makefiles/meson.build
M src/meson.build
M src/pl/meson.build
M src/pl/plperl/meson.build
M src/pl/plperl/po/meson.build
M src/pl/plpgsql/meson.build
M src/pl/plpgsql/src/meson.build
M src/pl/plpgsql/src/po/meson.build
M src/pl/plpython/meson.build
M src/pl/plpython/po/meson.build
M src/pl/tcl/meson.build
M src/pl/tcl/po/meson.build
M src/port/meson.build
M src/test/authentication/meson.build
M src/test/icu/meson.build
M src/test/isolation/meson.build
M src/test/kerberos/meson.build
M src/test/ldap/meson.build
M src/test/meson.build
M src/test/modules/brin/meson.build
M src/test/modules/commit_ts/meson.build
M src/test/modules/delay_execution/meson.build
M src/test/modules/dummy_index_am/meson.build
M src/test/modules/dummy_seclabel/meson.build
M src/test/modules/libpq_pipeline/meson.build
M src/test/modules/meson.build
M src/test/modules/plsample/meson.build
M src/test/modules/snapshot_too_old/meson.build
M src/test/modules/spgist_name_ops/meson.build
M src/test/modules/ssl_passphrase_callback/meson.build
M src/test/modules/test_bloomfilter/meson.build
M src/test/modules/test_copy_callbacks/meson.build
M src/test/modules/test_custom_rmgrs/meson.build
M src/test/modules/test_ddl_deparse/meson.build
M src/test/modules/test_extensions/meson.build
M src/test/modules/test_ginpostinglist/meson.build
M src/test/modules/test_integerset/meson.build
M src/test/modules/test_lfind/meson.build
M src/test/modules/test_misc/meson.build
M src/test/modules/test_oat_hooks/meson.build
M src/test/modules/test_parser/meson.build
M src/test/modules/test_pg_db_role_setting/meson.build
M src/test/modules/test_pg_dump/meson.build
M src/test/modules/test_predtest/meson.build
M src/test/modules/test_rbtree/meson.build
M src/test/modules/test_regex/meson.build
M src/test/modules/test_rls_hooks/meson.build
M src/test/modules/test_shm_mq/meson.build
M src/test/modules/test_slru/meson.build
M src/test/modules/unsafe_tests/meson.build
M src/test/modules/worker_spi/meson.build
M src/test/perl/meson.build
M src/test/recovery/meson.build
M src/test/regress/meson.build
M src/test/ssl/meson.build
M src/test/subscription/meson.build
M src/timezone/meson.build
M src/timezone/tznames/meson.build

Allow batching of inserts during cross-partition updates.

commit   : 594f8d3776af4699c5c32443b9d6a486f44beabf    
  
author   : Etsuro Fujita <efujita@postgresql.org>    
date     : Tue, 20 Dec 2022 19:05:00 +0900    
  
committer: Etsuro Fujita <efujita@postgresql.org>    
date     : Tue, 20 Dec 2022 19:05:00 +0900    

Click here for diff

Commit 927f453a9 disallowed batching added by commit b663a4136 to be  
used for the inserts performed as part of cross-partition updates of  
partitioned tables, mainly because the previous code in  
nodeModifyTable.c couldn't handle pending inserts into foreign-table  
partitions that are also UPDATE target partitions.  But we don't have  
such a limitation anymore (cf. commit ffbb7e65a), so let's allow for  
this by removing from execPartition.c the restriction added by commit  
927f453a9 that batching is only allowed if the query command type is  
CMD_INSERT.  
  
In postgres_fdw, since commit 86dc90056 changed it to effectively  
disable cross-partition updates in the case where a foreign-table  
partition chosen to insert rows into is also an UPDATE target partition,  
allow batching in the case where a foreign-table partition chosen to  
do so is *not* also an UPDATE target partition.  This is enabled by the  
"batch_size" option added by commit b663a4136, which is disabled by  
default.  
  
This patch also adjusts the test case added by commit 927f453a9 to  
confirm that the inserts performed as part of a cross-partition update  
of a partitioned table indeed uses batching.  
  
Amit Langote, reviewed and/or tested by Georgios Kokolatos, Zhihong Yu,  
Bharath Rupireddy, Hou Zhijie, Vignesh C, and me.  
  
Discussion: http://postgr.es/m/CA%2BHiwqH1Lz1yJmPs%3DaD-pzd_HLLynLHvq5iYeT9mB0bBV7oJ6w%40mail.gmail.com  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/postgres_fdw.c
M contrib/postgres_fdw/sql/postgres_fdw.sql
M src/backend/executor/execPartition.c

Add enable_presorted_aggregate GUC

commit   : 3226f47282a05979483475d1e4a11aab8c1bfc39    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Tue, 20 Dec 2022 22:28:58 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Tue, 20 Dec 2022 22:28:58 +1300    

Click here for diff

1349d279 added query planner support to allow more efficient execution of  
aggregate functions which have an ORDER BY or a DISTINCT clause.  Prior to  
that commit, the planner would only request that the lower planner produce  
a plan with the order required for the GROUP BY clause and it would be  
left up to nodeAgg.c to perform the final sort of records within each  
group so that the aggregate transition functions were called in the  
correct order.  Now that the planner requests the lower planner produce a  
plan with the GROUP BY and the ORDER BY / DISTINCT aggregates in mind,  
there is the possibility that the planner chooses a plan which could be  
less efficient than what would have been produced before 1349d279.  
  
While developing 1349d279, I had in mind that Incremental Sort would help  
us in cases where an index exists only on the GROUP BY column(s).  
Incremental Sort would just replace the implicit tuplesorts which are  
being performed in nodeAgg.c.  However, because the planner has the  
flexibility to instead choose a plan which just performs a full sort on  
both the GROUP BY and ORDER BY / DISTINCT aggregate columns, there is  
potential for the planner to make a bad choice.  The costing for  
Incremental Sort is not perfect as it assumes an even distribution of rows  
to sort within each sort group.  
  
Here we add an escape hatch in the form of the enable_presorted_aggregate  
GUC.  This will allow users to get the pre-PG16 behavior in cases where  
they have no other means to convince the query planner to produce a plan  
which only sorts on the GROUP BY column(s).  
  
Discussion: https://postgr.es/m/CAApHDvr1Sm+g9hbv4REOVuvQKeDWXcKUAhmbK5K+dfun0s9CvA@mail.gmail.com  

M doc/src/sgml/config.sgml
M src/backend/optimizer/path/costsize.c
M src/backend/optimizer/plan/planner.c
M src/backend/utils/misc/guc_tables.c
M src/backend/utils/misc/postgresql.conf.sample
M src/include/optimizer/cost.h
M src/test/regress/expected/aggregates.out
M src/test/regress/expected/sysviews.out
M src/test/regress/sql/aggregates.sql

Improve the performance of the slab memory allocator

commit   : d21ded75fdbc18d68be6e6c172f0f842c50e9263    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Tue, 20 Dec 2022 21:48:51 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Tue, 20 Dec 2022 21:48:51 +1300    

Click here for diff

Slab has traditionally been fairly slow when compared with the AllocSet or  
Generation memory allocators.  Part of this slowness came from having to  
write out an entire block when we allocate a new block in order to  
populate the free list indexes within the block's memory.  Additional  
slowness came from having to move a block onto another dlist each time we  
palloc or pfree a chunk from it.  
  
Here we optimize both of those cases and do a little bit extra to improve  
the performance of the slab allocator.  
  
Here, instead of writing out the free list indexes when allocating a new  
block, we introduce the concept of "unused" chunks.  When a block is first  
allocated all chunks are unused.  These chunks only make it onto the  
free list when they are pfree'd.  When allocating new chunks on an  
existing block, we have the choice of consuming a chunk from the free list  
or an unused chunk.  When both exist, we opt to use one from the free  
list, as these have been used already and the memory of them is more  
likely to be cached by the CPU.  
  
Here we also reduce the number of block lists from there being one for  
every possible value of free chunks on a block to just having a small  
fixed number of block lists.  We keep the 0th block list for completely  
full blocks and anything else stores blocks for some range of free chunks  
with fuller blocks appearing on lower block list array elements.  This  
reduces how often we must move a block to another list when we allocate or  
free chunks, but still allows us to prefer to put new chunks on fuller  
blocks and perhaps allow blocks with fewer chunks to be free'd later  
once all their remaining chunks have been pfree'd.  
  
Additionally, we now store a list of "emptyblocks", which are blocks that  
no longer contain any allocated chunks.  We now keep up to 10 of these  
around to avoid having to thrash malloc/free when allocation patterns  
continually cause blocks to become free of any allocated chunks only to  
allocate more chunks again.  Now only once we have 10 of these, we free  
the block.  This does raise the high water mark for the total memory that  
a slab context can consume.  It does not seem entirely unreasonable that  
we might one day want to make this a property of SlabContext rather than a  
compile-time constant.  Let's wait and see if there is any evidence to  
support that this is required before doing it.  
  
Author: Andres Freund, David Rowley  
Tested-by: Tomas Vondra, John Naylor  
Discussion: https://postgr.es/m/20210717194333.mr5io3zup3kxahfm@alap3.anarazel.de  

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

Move variable increment to the end of the loop

commit   : 995a9fb14f6aa81ad8eedaf4e8dce1b3e51105c0    
  
author   : John Naylor <john.naylor@postgresql.org>    
date     : Tue, 20 Dec 2022 14:13:14 +0700    
  
committer: John Naylor <john.naylor@postgresql.org>    
date     : Tue, 20 Dec 2022 14:13:14 +0700    

Click here for diff

This is less error prone and matches the placement of other code  
in the file.  
  
Justin Pryzby  
  
Reviewed by Tom Lane  
Discussion: https://www.postgresql.org/message-id/20221123172436.GJ11463@telsasoft.com  

M src/backend/utils/activity/backend_status.c

Add pg_dissect_walfile_name()

commit   : cca186348929cd75f23ef1b25922386bf38cf99c    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Tue, 20 Dec 2022 13:36:27 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Tue, 20 Dec 2022 13:36:27 +0900    

Click here for diff

This function takes in input a WAL segment name and returns a tuple made  
of the segment sequence number (dependent on the WAL segment size of the  
cluster) and its timeline, as of a thin SQL wrapper around the existing  
XLogFromFileName().  
  
This function has multiple usages, like being able to compile a LSN from  
a file name and an offset, or finding the timeline of a segment without  
having to do to some maths based on the first eight characters of the  
segment.  
  
Bump catalog version.  
  
Author: Bharath Rupireddy  
Reviewed-by: Nathan Bossart, Kyotaro Horiguchi, Maxim Orlov, Michael  
Paquier  
Discussion: https://postgr.es/m/CALj2ACWV=FCddsxcGbVOA=cvPyMr75YCFbSQT6g4KDj=gcJK4g@mail.gmail.com  

M doc/src/sgml/func.sgml
M src/backend/access/transam/xlogfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.dat
M src/test/regress/expected/misc_functions.out
M src/test/regress/sql/misc_functions.sql

Remove hardcoded dependency to cryptohash type in the internals of SCRAM

commit   : b3bb7d12af97f035c3aa3ad8dd41b44d01e2defa    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Tue, 20 Dec 2022 08:53:22 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Tue, 20 Dec 2022 08:53:22 +0900    

Click here for diff

SCRAM_KEY_LEN was a variable used in the internal routines of SCRAM to  
size a set of fixed-sized arrays used in the SHA and HMAC computations  
during the SASL exchange or when building a SCRAM password.  This had a  
hard dependency on SHA-256, reducing the flexibility of SCRAM when it  
comes to the addition of more hash methods.  A second issue was that  
SHA-256 is assumed as the cryptohash method to use all the time.  
  
This commit renames SCRAM_KEY_LEN to a more generic SCRAM_KEY_MAX_LEN,  
which is used as the size of the buffers used by the internal routines  
of SCRAM.  This is aimed at tracking centrally the maximum size  
necessary for all the hash methods supported by SCRAM.  A global  
variable has the advantage of keeping the code in its simplest form,  
reducing the need of more alloc/free logic for all the buffers used in  
the hash calculations.  
  
A second change is that the key length (SHA digest length) and hash  
types are now tracked by the state data in the backend and the frontend,  
the common portions being extended to handle these as arguments by the  
internal routines of SCRAM.  There are a few RFC proposals floating  
around to extend the SCRAM protocol, including some to use stronger  
cryptohash algorithms, so this lifts some of the existing restrictions  
in the code.  
  
The code in charge of parsing and building SCRAM secrets is extended to  
rely on the key length and on the cryptohash type used for the exchange,  
assuming currently that only SHA-256 is supported for the moment.  Note  
that the mock authentication simply enforces SHA-256.  
  
Author: Michael Paquier  
Reviewed-by: Peter Eisentraut, Jonathan Katz  
Discussion: https://postgr.es/m/Y5k3Qiweo/1g9CG6@paquier.xyz  

M src/backend/libpq/auth-scram.c
M src/backend/libpq/crypt.c
M src/common/scram-common.c
M src/include/common/scram-common.h
M src/include/libpq/scram.h
M src/interfaces/libpq/fe-auth-scram.c

Fix comment that was missing a word.

commit   : eb60eb08a95eb531f3f2a459c1b623c5ac37ecd3    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Mon, 19 Dec 2022 15:56:17 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Mon, 19 Dec 2022 15:56:17 -0500    

Click here for diff

Ted Yu  
  
Discussion: http://postgr.es/m/CALte62wkFB05=RTWf7BL_6MfWs2=DY=ai-K7LWn_+0TJUuPJ2w@mail.gmail.com  

M src/include/utils/backend_status.h

Fix typo in comment

commit   : af6284a666742d6932bae2e93f9eef156274a92e    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 19 Dec 2022 21:08:28 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 19 Dec 2022 21:08:28 +0100    

Click here for diff

Author: Ted Yu <yuzhihong@gmail.com>  

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

Expose some information about backend subxact status.

commit   : 10ea0f924a2788f9e701d6213745aaa5ca3efb8a    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Mon, 19 Dec 2022 14:43:09 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Mon, 19 Dec 2022 14:43:09 -0500    

Click here for diff

A new function pg_stat_get_backend_subxact() can be used to get  
information about the number of subtransactions in the cache of  
a particular backend and whether that cache has overflowed. This  
can be useful for tracking down performance problems that can  
result from overflowed snapshots.  
  
Dilip Kumar, reviewed by Zhihong Yu, Nikolay Samokhvalov,  
Justin Pryzby, Nathan Bossart, Ashutosh Sharma, Julien  
Rouhaud. Additional design comments from Andres Freund,  
Tom Lane, Bruce Momjian, and David G. Johnston.  
  
Discussion: http://postgr.es/m/CAFiTN-ut0uwkRJDQJeDPXpVyTWD46m3gt3JDToE02hTfONEN=Q@mail.gmail.com  

M doc/src/sgml/monitoring.sgml
M src/backend/storage/ipc/sinvaladt.c
M src/backend/utils/activity/backend_status.c
M src/backend/utils/adt/pgstatfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.dat
M src/include/storage/sinvaladt.h
M src/include/utils/backend_status.h

Fix bit-rotted planner test case.

commit   : 7122f9d5437789312cb0a7e26e853bb8d2e57add    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 17 Dec 2022 18:51:24 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 17 Dec 2022 18:51:24 -0500    

Click here for diff

While fooling with my pet outer-join-variables patch, I discovered  
that the test case I added in commit 11086f2f2 no longer demonstrates  
what it's supposed to.  The idea is to tempt the planner to reverse  
the order of the two outer joins, which would leave noplace to  
correctly evaluate the WHERE clause that's inserted between them.  
Before the addition of the delay_upper_joins mechanism, it would  
have taken the bait.  
  
However, subsequent improvements broke the test in two different ways.  
First, we now recognize the IS NULL coding pattern as an antijoin, and  
we won't re-order antijoins; even if we did, the IS NULL test clauses  
get removed so there would be no opportunity for them to misbehave.  
Second, the planner now discovers that nested parameterized indexscans  
are a lot cheaper than the double hash join it used back in the day,  
and that approach doesn't want to re-order the joins anyway.  Thus,  
in HEAD the test passes even if one dikes out delay_upper_joins.  
  
To fix, change the IS NULL tests to COALESCE clauses, which produce  
the same results but the planner isn't smart enough to convert them  
to antijoins.  It'll still go for parameterized indexscans though,  
so drop the index enabling that (don't know why I added that in the  
first place), and disable nestloop joining just to be sure.  
  
This time around, add an EXPLAIN to make the choice of plan visible.  

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

Doc: update pg_list.h header comments to include XidLists.

commit   : 0efecb5518c914a45d9f294adebc2948f5882f2e    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 17 Dec 2022 10:31:25 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 17 Dec 2022 10:31:25 -0500    

Click here for diff

I realize that the XidList infrastructure is rather incomplete,  
but failing to mention it in adjacent comments takes that a bit  
too far.  

M src/include/nodes/pg_list.h

Fix inability to reference CYCLE column from inside its CTE.

commit   : 935277b24172979e8244a5399906c358e4176b49    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 16 Dec 2022 13:07:42 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 16 Dec 2022 13:07:42 -0500    

Click here for diff

Such references failed with "cache lookup failed for type 0"  
because we didn't resolve the type of the CYCLE column until after  
analyzing the CTE's query.  We can just move that processing  
to before the recursive parse_sub_analyze call, though.  
  
While here, invent a couple of local variables to make this  
code less egregiously wider-than-80-columns.  
  
Per bug #17723 from Vik Fearing.  Back-patch to v14 where  
the CYCLE feature was added.  
  
Discussion: https://postgr.es/m/17723-2c4985ff111e7bba@postgresql.org  

M src/backend/parser/parse_cte.c
M src/test/regress/expected/with.out
M src/test/regress/sql/with.sql

pg_upgrade: Make testing different transfer modes easier

commit   : b059a2409faf5833b3ba7792e247d6466c9e8090    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 16 Dec 2022 17:49:59 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 16 Dec 2022 17:49:59 +0100    

Click here for diff

The environment variable PG_TEST_PG_UPGRADE_MODE can be set to  
override the default transfer mode for the pg_upgrade tests.  
(Automatically running the pg_upgrade tests for all supported modes  
would be too slow.)  
  
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>  
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>  
Discussion: https://www.postgresql.org/message-id/flat/50a97009-8ff9-ca4d-a0f6-6086a6775a5b%40enterprisedb.com  

M src/bin/pg_upgrade/TESTING
M src/bin/pg_upgrade/t/002_pg_upgrade.pl

pg_upgrade: Add --copy option

commit   : 746915c6866953506379e996ce5198bc9e9e5b94    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 16 Dec 2022 17:49:59 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Fri, 16 Dec 2022 17:49:59 +0100    

Click here for diff

This option selects the default transfer mode.  Having an explicit  
option is handy to make scripts and tests more explicit.  It also  
makes it easier to talk about a "copy" mode rather than "the default  
mode" or something like that, since until now the default mode didn't  
have an externally visible name.  
  
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>  
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>  
Discussion: https://www.postgresql.org/message-id/flat/50a97009-8ff9-ca4d-a0f6-6086a6775a5b%40enterprisedb.com  

M doc/src/sgml/ref/pgupgrade.sgml
M src/bin/pg_upgrade/option.c

C comment: fix wording

commit   : 59346209a839dfc627dd7986af3a6a8349c7ea0f    
  
author   : Bruce Momjian <bruce@momjian.us>    
date     : Fri, 16 Dec 2022 12:15:54 -0500    
  
committer: Bruce Momjian <bruce@momjian.us>    
date     : Fri, 16 Dec 2022 12:15:54 -0500    

Click here for diff

Backpatch-through: master  

M contrib/postgres_fdw/postgres_fdw.c

Clean up dubious error handling in wellformed_xml().

commit   : c4939f121563f300b98b30837151753fc8255554    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 16 Dec 2022 11:10:36 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 16 Dec 2022 11:10:36 -0500    

Click here for diff

This ancient bit of code was summarily trapping any ereport longjmp  
whatsoever and assuming that it must represent an invalid-XML report.  
It's not really appropriate to handle OOM-like situations that way:  
maybe the input is valid or maybe not, but we couldn't find out.  
And it'd be a seriously bad idea to ignore, say, a query cancel  
error that way.  (Perhaps that can't happen because there is no  
CHECK_FOR_INTERRUPTS anywhere within xml_parse, but even if that's  
true today it's obviously a very fragile assumption.)  
  
But in the wake of the previous commit, we can drop the PG_TRY  
here altogether, and use the soft error mechanism to catch only  
the kinds of errors that are legitimate to treat as invalid-XML.  
  
(This is our first use of the soft error mechanism for something  
not directly related to a datatype input function.  It won't be  
the last.)  
  
xml_is_document can be converted in the same way.  That one is  
not actively broken, because it was checking specifically for  
ERRCODE_INVALID_XML_DOCUMENT rather than trapping everything;  
but the code is still shorter and probably faster this way.  
  
Discussion: https://postgr.es/m/3564577.1671142683@sss.pgh.pa.us  

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

Convert xml_in to report errors softly.

commit   : 37bef842f5530fc9f4a48daba9f4709ee5e36c9b    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 16 Dec 2022 10:58:49 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 16 Dec 2022 10:58:49 -0500    

Click here for diff

The key idea here is that xml_parse must distinguish hard errors  
from soft errors.  We want to throw a hard error for libxml  
initialization failures: those might be out-of-memory, or something  
else, but in any case they are not the fault of the input string.  
If we get to the point of parsing the input, and something goes  
wrong, we can fairly consider that to mean bad input.  
  
One thing that arguably does mean bad input, but I didn't trouble  
to handle softly, is encoding conversion failure while converting  
the server encoding to UTF8.  This might be something to improve  
later, but it seems like a pretty low-probability scenario.  
  
Discussion: https://postgr.es/m/3564577.1671142683@sss.pgh.pa.us  

M src/backend/utils/adt/xml.c
M src/test/regress/expected/xml.out
M src/test/regress/expected/xml_1.out
M src/test/regress/expected/xml_2.out
M src/test/regress/sql/xml.sql

Fix typo in reference to __FreeBSD__.

commit   : e52f8b301ed54aac5162b185b43f5f1e44b6b17e    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 16 Dec 2022 17:36:22 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Fri, 16 Dec 2022 17:36:22 +1300    

Click here for diff

Commit a2a8acd152 introduced a platform-dependent mechanism to prevent  
developers from referencing errno in the argument list of  
elog()/ereport(), but didn't use the right macro to detect FreeBSD, so  
it didn't actually work there.  
  
Reported-by: Japin Li <japinli@hotmail.com>  
Discussion: https://postgr.es/m/MEYP282MB16693AAEEF84F47D8F7CA007B6E69%40MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM  

M src/include/utils/elog.h

Remove pessimistic cost penalization from Incremental Sort

commit   : 4a29eabd1d91c5484426bc5836e0a7143b064f5a    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Fri, 16 Dec 2022 15:22:23 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Fri, 16 Dec 2022 15:22:23 +1300    

Click here for diff

When incremental sorts were added in v13 a 1.5x pessimism factor was added  
to the cost modal.  Seemingly this was done because the cost modal only  
has an estimate of the total number of input rows and the number of  
presorted groups.  It assumes that the input rows will be evenly  
distributed throughout the presorted groups.  The 1.5x pessimism factor  
was added to slightly reduce the likelihood of incremental sorts being  
used in the hope to avoid performance regressions where an incremental  
sort plan was picked and turned out slower due to a large skew in the  
number of rows in the presorted groups.  
  
An additional quirk with the path generation code meant that we could  
consider both a sort and an incremental sort on paths with presorted keys.  
This meant that with the pessimism factor, it was possible that we opted  
to perform a sort rather than an incremental sort when the given path had  
presorted keys.  
  
Here we remove the 1.5x pessimism factor to allow incremental sorts to  
have a fairer chance at being chosen against a full sort.  
  
Previously we would generally create a sort path on the cheapest input  
path (if that wasn't sorted already) and incremental sort paths on any  
path which had presorted keys.  This meant that if the cheapest input path  
wasn't completely sorted but happened to have presorted keys, we would  
create a full sort path *and* an incremental sort path on that input path.  
Here we change this logic so that if there are presorted keys, we only  
create an incremental sort path, and create sort paths only when a full  
sort is required.  
  
Both the removal of the cost pessimism factor and the changes made to the  
path generation make it more likely that incremental sorts will now be  
chosen.  That, of course, as with teaching the planner any new tricks,  
means an increased likelihood that the planner will perform an incremental  
sort when it's not the best method.  Our standard escape hatch for these  
cases is an enable_* GUC.  enable_incremental_sort already exists for  
this.  
  
This came out of a report by Pavel Luzanov where he mentioned that the  
master branch was choosing to perform a Seq Scan -> Sort -> Group  
Aggregate for his query with an ORDER BY aggregate function.  The v15 plan  
for his query performed an Index Scan -> Group Aggregate, of course, the  
aggregate performed the final sort internally in nodeAgg.c for the  
aggregate's ORDER BY.  The ideal plan would have been to use the index,  
which provided partially sorted input then use an incremental sort to  
provide the aggregate with the sorted input.  This was not being chosen  
due to the pessimism in the incremental sort cost modal, so here we remove  
that and rationalize the path generation so that sort and incremental sort  
plans don't have to needlessly compete.  We assume that it's senseless  
to ever use a full sort on a given input path where an incremental sort  
can be performed.  
  
Reported-by: Pavel Luzanov  
Reviewed-by: Richard Guo  
Discussion: https://postgr.es/m/9f61ddbf-2989-1536-b31e-6459370a6baa%40postgrespro.ru  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/sql/postgres_fdw.sql
M src/backend/optimizer/path/allpaths.c
M src/backend/optimizer/path/costsize.c
M src/backend/optimizer/plan/planner.c
M src/test/regress/expected/incremental_sort.out
M src/test/regress/expected/partition_join.out
M src/test/regress/sql/incremental_sort.sql

Re-adjust drop-index-concurrently-1 isolation test

commit   : 8b6b043ceef29a0a7a462b748da398511832efcf    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Fri, 16 Dec 2022 11:39:40 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Fri, 16 Dec 2022 11:39:40 +1300    

Click here for diff

It seems that drop-index-concurrently-1 has started to forget what it was  
originally meant to be testing.  d2d8a229b, which added incremental sorts  
changed the expected plan to be an Index Scan plan instead of a Seq Scan  
plan.  This occurred as the primary key index of the table in question  
provided presorted input and, because that index happened to be the  
cheapest input path due to enable_seqscan being disabled, the incremental  
sort changes just added a Sort on top of that.  It seems based on the name  
of the PREPAREd statement that the intention here is that the query  
produces a seqscan plan.  
  
The reason this test has become broken seems to be due to how the test was  
originally coded.  The test was trying to force a seqscan plan by  
performing some casting to make it so the test_dc index couldn't be used  
to perform the required filtering.  Trying to coax the planner into using  
a plan which has costed in a disable_cost seems like it's always going to  
be flakey as small changes in costs are drowned out by the large  
disable_cost combined with add_path's STD_FUZZ_FACTOR.  Here we get rid of  
the casts that we're using to try to trick the planner into a seqscan and  
instead toggle enable_seqscan as and when required to get the desired  
plan.  
  
Additionally, rename a few things in the test and add some additional  
wording to the comments to try and make it more clear in the future what  
we expect this test to be doing.  
  
Discussion: https://postgr.es/m/CAApHDvrbDhObhLV+=U_K_-t+2Av2av1aL9d+2j_3AO-XndaviA@mail.gmail.com  
Backpatch-through: 13, where d2d8a229b changed the expected test output  

M src/test/isolation/expected/drop-index-concurrently-1.out
M src/test/isolation/expected/drop-index-concurrently-1_2.out
M src/test/isolation/specs/drop-index-concurrently-1.spec

Speed up creation of command completion tags

commit   : ac998020802b742303979a13692afa7b2084d0e9    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Fri, 16 Dec 2022 10:31:25 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Fri, 16 Dec 2022 10:31:25 +1300    

Click here for diff

The building of command completion tags could often be seen showing up in  
profiles when running high tps workloads.  
  
The query completion tags were being built with snprintf, which is slow at  
the best of times when compared with more manual ways of formatting  
strings.  Here we introduce BuildQueryCompletionString() to do this job  
for us.  We also now store the completion tag's strlen in the  
CommandTagBehavior struct so that we can quickly memcpy this number of  
bytes into the completion tag string.  Appending the rows affected is done  
via pg_ulltoa_n.  BuildQueryCompletionString returns the length of the  
built string.  This saves us having to call strlen to figure out how many  
bytes to pass to pq_putmessage().  
  
Author: David Rowley, Andres Freund  
Reviewed-by: Andres Freund  
Discussion: https://postgr.es/m/CAHoyFK-Xwqc-iY52shj0G+8K9FJpse+FuZ36XBKy78wDVnd=Qg@mail.gmail.com  

M src/backend/tcop/cmdtag.c
M src/backend/tcop/dest.c
M src/include/tcop/cmdtag.h
M src/include/tcop/dest.h

Convert range_in and multirange_in to report errors softly.

commit   : d35a1af468162f510b6139bf81a7a41fd8ba8500    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 15 Dec 2022 12:18:36 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Thu, 15 Dec 2022 12:18:36 -0500    

Click here for diff

This is mostly straightforward, except that if the range type  
has a canonical function, that might throw an error during range  
input.  (Such errors probably only occur for edge cases: in the  
in-core canonical functions, it happens only if a bound has the  
maximum valid value for the underlying type.)  Hence, this patch  
extends the soft-error regime to allow canonical functions to  
return errors softly as well.  Extensions implementing range  
canonical functions will need modification anyway because of the  
API change for range_serialize(); while at it, they might want  
to do something similar to what's been done here in the in-core  
canonical functions.  
  
Discussion: https://postgr.es/m/3284599.1671075185@sss.pgh.pa.us  

M src/backend/utils/adt/multirangetypes.c
M src/backend/utils/adt/multirangetypes_selfuncs.c
M src/backend/utils/adt/rangetypes.c
M src/backend/utils/adt/rangetypes_gist.c
M src/backend/utils/adt/rangetypes_selfuncs.c
M src/backend/utils/adt/rangetypes_spgist.c
M src/backend/utils/adt/rangetypes_typanalyze.c
M src/include/utils/rangetypes.h
M src/test/regress/expected/multirangetypes.out
M src/test/regress/expected/rangetypes.out
M src/test/regress/sql/multirangetypes.sql
M src/test/regress/sql/rangetypes.sql

Static assertions cleanup

commit   : 75f49221c22286104f032827359783aa5f4e6646    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 8 Dec 2022 14:30:01 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 8 Dec 2022 14:30:01 +0100    

Click here for diff

Because we added StaticAssertStmt() first before StaticAssertDecl(),  
some uses as well as the instructions in c.h are now a bit backwards  
from the "native" way static assertions are meant to be used in C.  
This updates the guidance and moves some static assertions to better  
places.  
  
Specifically, since the addition of StaticAssertDecl(), we can put  
static assertions at the file level.  This moves a number of static  
assertions out of function bodies, where they might have been stuck  
out of necessity, to perhaps better places at the file level or in  
header files.  
  
Also, when the static assertion appears in a position where a  
declaration is allowed, then using StaticAssertDecl() is more native  
than StaticAssertStmt().  
  
Reviewed-by: John Naylor <john.naylor@enterprisedb.com>  
Discussion: https://www.postgresql.org/message-id/flat/941a04e7-dd6f-c0e4-8cdf-a33b3338cbda%40enterprisedb.com  

M src/backend/access/heap/heapam.c
M src/backend/access/nbtree/nbtutils.c
M src/backend/access/transam/clog.c
M src/backend/access/transam/xlog.c
M src/backend/backup/basebackup.c
M src/backend/catalog/dependency.c
M src/backend/executor/execExprInterp.c
M src/backend/libpq/auth-scram.c
M src/backend/libpq/hba.c
M src/backend/port/atomics.c
M src/backend/storage/lmgr/lwlock.c
M src/backend/storage/page/itemptr.c
M src/backend/utils/adt/numeric.c
M src/backend/utils/adt/tsginidx.c
M src/backend/utils/adt/xid8funcs.c
M src/backend/utils/cache/syscache.c
M src/backend/utils/mmgr/aset.c
M src/backend/utils/mmgr/generation.c
M src/backend/utils/mmgr/slab.c
M src/common/checksum_helper.c
M src/common/controldata_utils.c
M src/common/encnames.c
M src/include/access/gin.h
M src/include/access/htup_details.h
M src/include/access/nbtree.h
M src/include/c.h
M src/include/catalog/pg_control.h
M src/include/common/int128.h
M src/include/storage/lwlock.h

Move provariadic sanity check to a more appropriate place

commit   : 2613dec4ed67c4a963d987cbd29284e0634b65c9    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 15 Dec 2022 07:49:30 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Thu, 15 Dec 2022 07:49:30 +0100    

Click here for diff

35f059e9bdfb3b14ac9d22a9e159d36ec0ccf804 put the provariadic sanity  
check into type_sanity.sql, even though it's not about types, and  
moreover in the middle of some connected test group, which makes it  
all very confusing.  Move it to opr_sanity.sql, where it is in better  
company.  

M src/test/regress/expected/opr_sanity.out
M src/test/regress/expected/type_sanity.out
M src/test/regress/sql/opr_sanity.sql
M src/test/regress/sql/type_sanity.sql

Convert a few more datatype input functions to report errors softly.

commit   : 3b9d2deb67a0d5ee681561fc0e07c2dca4e26e96    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 14 Dec 2022 19:42:05 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 14 Dec 2022 19:42:05 -0500    

Click here for diff

Convert the remaining string-category input functions  
(bpcharin, varcharin, byteain) to the new style.  
  
Discussion: https://postgr.es/m/3038346.1671060258@sss.pgh.pa.us  

M src/backend/utils/adt/encode.c
M src/backend/utils/adt/varchar.c
M src/backend/utils/adt/varlena.c
M src/include/utils/builtins.h
M src/test/regress/expected/char.out
M src/test/regress/expected/char_1.out
M src/test/regress/expected/char_2.out
M src/test/regress/expected/strings.out
M src/test/regress/expected/varchar.out
M src/test/regress/expected/varchar_1.out
M src/test/regress/expected/varchar_2.out
M src/test/regress/sql/char.sql
M src/test/regress/sql/strings.sql
M src/test/regress/sql/varchar.sql

Convert a few more datatype input functions to report errors softly.

commit   : 90161dad4dd719f44255474f4471af916f2a28f0    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 14 Dec 2022 18:03:11 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 14 Dec 2022 18:03:11 -0500    

Click here for diff

Convert cash_in and uuid_in to the new style.  
  
Amul Sul, minor mods by me  
  
Discussion: https://postgr.es/m/CAAJ_b97KeDWUdpTKGOaFYPv0OicjOu6EW+QYWj-Ywrgj_aEy1g@mail.gmail.com  

M src/backend/utils/adt/cash.c
M src/backend/utils/adt/uuid.c
M src/test/regress/expected/money.out
M src/test/regress/expected/uuid.out
M src/test/regress/sql/money.sql
M src/test/regress/sql/uuid.sql

Convert a few more datatype input functions to report errors softly.

commit   : 47f3f97fcdee28e3eb70cd2ebfd7b4899570b018    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 14 Dec 2022 17:50:24 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 14 Dec 2022 17:50:24 -0500    

Click here for diff

Convert assorted internal-ish datatypes, namely aclitemin,  
int2vectorin, oidin, oidvectorin, pg_lsn_in, pg_snapshot_in,  
and tidin to the new style.  
  
(Some others you might expect to find in this group, such as  
cidin and xidin, need no changes because they never throw  
errors at all.  That seems a little cheesy ... but it is not in  
the charter of this patch series to add new error conditions.)  
  
Amul Sul, minor mods by me  
  
Discussion: https://postgr.es/m/CAAJ_b97KeDWUdpTKGOaFYPv0OicjOu6EW+QYWj-Ywrgj_aEy1g@mail.gmail.com  

M src/backend/utils/adt/acl.c
M src/backend/utils/adt/int.c
M src/backend/utils/adt/oid.c
M src/backend/utils/adt/pg_lsn.c
M src/backend/utils/adt/tid.c
M src/backend/utils/adt/xid8funcs.c
M src/test/regress/expected/int2.out
M src/test/regress/expected/oid.out
M src/test/regress/expected/pg_lsn.out
M src/test/regress/expected/privileges.out
M src/test/regress/expected/tid.out
M src/test/regress/expected/xid.out
M src/test/regress/sql/int2.sql
M src/test/regress/sql/oid.sql
M src/test/regress/sql/pg_lsn.sql
M src/test/regress/sql/privileges.sql
M src/test/regress/sql/tid.sql
M src/test/regress/sql/xid.sql

Convert the geometric input functions to report errors softly.

commit   : 332741e73980401895e027eb697bb472860036fb    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 14 Dec 2022 16:10:20 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 14 Dec 2022 16:10:20 -0500    

Click here for diff

Convert box_in, circle_in, line_in, lseg_in, path_in, point_in,  
and poly_in to the new style.  
  
line_in still throws hard errors for overflows/underflows that can occur  
when the input is specified as two points rather than in the canonical  
"Ax + By + C = 0" style.  I'm not too concerned about that: it won't be  
reached in normal dump/restore cases, and it's fairly debatable that  
such conversion should ever have been made part of a type input function  
in the first place.  But in any case, I don't want to extend the soft  
error conventions into float.h without more discussion than this patch  
has had.  
  
Amul Sul, minor mods by me  
  
Discussion: https://postgr.es/m/CAAJ_b97KeDWUdpTKGOaFYPv0OicjOu6EW+QYWj-Ywrgj_aEy1g@mail.gmail.com  

M src/backend/utils/adt/geo_ops.c
M src/test/regress/expected/box.out
M src/test/regress/expected/geometry.out
M src/test/regress/expected/line.out
M src/test/regress/expected/lseg.out
M src/test/regress/expected/path.out
M src/test/regress/expected/point.out
M src/test/regress/expected/polygon.out
M src/test/regress/sql/box.sql
M src/test/regress/sql/geometry.sql
M src/test/regress/sql/line.sql
M src/test/regress/sql/lseg.sql
M src/test/regress/sql/path.sql
M src/test/regress/sql/point.sql
M src/test/regress/sql/polygon.sql

Convert a few more datatype input functions to report errors softly.

commit   : 17407a8eaa2afa8ac0de4b0a494f33d8eb7a98bd    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 14 Dec 2022 13:22:08 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Wed, 14 Dec 2022 13:22:08 -0500    

Click here for diff

Convert bit_in, varbit_in, inet_in, cidr_in, macaddr_in, and  
macaddr8_in to the new style.  
  
Amul Sul, minor mods by me  
  
Discussion: https://postgr.es/m/CAAJ_b97KeDWUdpTKGOaFYPv0OicjOu6EW+QYWj-Ywrgj_aEy1g@mail.gmail.com  

M src/backend/utils/adt/mac.c
M src/backend/utils/adt/mac8.c
M src/backend/utils/adt/network.c
M src/backend/utils/adt/varbit.c
M src/test/regress/expected/bit.out
M src/test/regress/expected/inet.out
M src/test/regress/expected/macaddr.out
M src/test/regress/expected/macaddr8.out
M src/test/regress/sql/bit.sql
M src/test/regress/sql/inet.sql
M src/test/regress/sql/macaddr.sql
M src/test/regress/sql/macaddr8.sql

Rearrange some static assertions for consistency

commit   : b18c2decd76eeffbd483c041c02bb0fb01b0f124    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Wed, 14 Dec 2022 16:08:13 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Wed, 14 Dec 2022 16:08:13 +0100    

Click here for diff

Put lengthof first.  
  
Reported-by: Peter Smith <smithpb2250@gmail.com>  
Discussion: https://www.postgresql.org/message-id/CAHut+PsUDMySVRuRc=h+P5N3+=TGvj4W_mi32XXg9dt4o-BXbA@mail.gmail.com  

M src/backend/executor/execExprInterp.c
M src/backend/utils/cache/syscache.c

Non-decimal integer literals

commit   : 6fcda9aba83449082124825b6d375c0a61e21c42    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Wed, 14 Dec 2022 05:40:38 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Wed, 14 Dec 2022 05:40:38 +0100    

Click here for diff

Add support for hexadecimal, octal, and binary integer literals:  
  
    0x42F  
    0o273  
    0b100101  
  
per SQL:202x draft.  
  
This adds support in the lexer as well as in the integer type input  
functions.  
  
Reviewed-by: John Naylor <john.naylor@enterprisedb.com>  
Reviewed-by: Zhihong Yu <zyu@yugabyte.com>  
Reviewed-by: David Rowley <dgrowleyml@gmail.com>  
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>  
Discussion: https://www.postgresql.org/message-id/flat/b239564c-cad0-b23e-c57e-166d883cb97d@enterprisedb.com  

M doc/src/sgml/syntax.sgml
M src/backend/catalog/information_schema.sql
M src/backend/catalog/sql_features.txt
M src/backend/parser/parse_node.c
M src/backend/parser/scan.l
M src/backend/utils/adt/numutils.c
M src/fe_utils/psqlscan.l
M src/interfaces/ecpg/preproc/pgc.l
M src/test/regress/expected/int2.out
M src/test/regress/expected/int4.out
M src/test/regress/expected/int8.out
M src/test/regress/expected/numerology.out
M src/test/regress/sql/int2.sql
M src/test/regress/sql/int4.sql
M src/test/regress/sql/int8.sql
M src/test/regress/sql/numerology.sql

Add grantable MAINTAIN privilege and pg_maintain role.

commit   : 60684dd834a222fefedd49b19d1f0a6189c1632e    
  
author   : Jeff Davis <jdavis@postgresql.org>    
date     : Tue, 13 Dec 2022 17:33:28 -0800    
  
committer: Jeff Davis <jdavis@postgresql.org>    
date     : Tue, 13 Dec 2022 17:33:28 -0800    

Click here for diff

Allows VACUUM, ANALYZE, REINDEX, REFRESH MATERIALIZED VIEW, CLUSTER,  
and LOCK TABLE.  
  
Effectively reverts 4441fc704d. Instead of creating separate  
privileges for VACUUM, ANALYZE, and other maintenance commands, group  
them together under a single MAINTAIN privilege.  
  
Author: Nathan Bossart  
Discussion: https://postgr.es/m/20221212210136.GA449764@nathanxps13  
Discussion: https://postgr.es/m/45224.1670476523@sss.pgh.pa.us  

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/parser/gram.y
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/nodes/parsenodes.h
M src/include/utils/acl.h
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/expected/vacuum.out
M src/test/regress/sql/dependency.sql
M src/test/regress/sql/privileges.sql

Remove SHA256_HMAC_B from scram-common.h

commit   : c6f6646bb0bef315c3836f3f6909c24a985a8621    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Wed, 14 Dec 2022 09:51:19 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Wed, 14 Dec 2022 09:51:19 +0900    

Click here for diff

This referred to the size of the buffers for k_ipad and k_opad in HMAC  
computations.  This is unused since e6bdfd9, where SCRAM has switched to  
the cryptohash routines for its HMAC calculations rather than its own  
maths.  
  
Reviewed-by: Jacob Champion  
Discussion: https://postgr.es/m/Y5gGMjXhyp0oK0mH@paquier.xyz  

M src/include/common/scram-common.h

Rethink handling of [Prevent|Is]InTransactionBlock in pipeline mode.

commit   : 20432f8731404d2cef2a155144aca5ab3ae98e95    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 13 Dec 2022 14:23:58 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Tue, 13 Dec 2022 14:23:58 -0500    

Click here for diff

Commits f92944137 et al. made IsInTransactionBlock() set the  
XACT_FLAGS_NEEDIMMEDIATECOMMIT flag before returning "false",  
on the grounds that that kept its API promises equivalent to those of  
PreventInTransactionBlock().  This turns out to be a bad idea though,  
because it allows an ANALYZE in a pipelined series of commands to  
cause an immediate commit, which is unexpected.  
  
Furthermore, if we return "false" then we have another issue,  
which is that ANALYZE will decide it's allowed to do internal  
commit-and-start-transaction sequences, thus possibly unexpectedly  
committing the effects of previous commands in the pipeline.  
  
To fix the latter situation, invent another transaction state flag  
XACT_FLAGS_PIPELINING, which explicitly records the fact that we  
have executed some extended-protocol command and not yet seen a  
commit for it.  Then, require that flag to not be set before allowing  
InTransactionBlock() to return "false".  
  
Having done that, we can remove its setting of NEEDIMMEDIATECOMMIT  
without fear of causing problems.  This means that the API guarantees  
of IsInTransactionBlock now diverge from PreventInTransactionBlock,  
which is mildly annoying, but it seems OK given the very limited usage  
of IsInTransactionBlock.  (In any case, a caller preferring the old  
behavior could always set NEEDIMMEDIATECOMMIT for itself.)  
  
For consistency also require XACT_FLAGS_PIPELINING to not be set  
in PreventInTransactionBlock.  This too is meant to prevent commands  
such as CREATE DATABASE from silently committing previous commands  
in a pipeline.  
  
Per report from Peter Eisentraut.  As before, back-patch to all  
supported branches (which sadly no longer includes v10).  
  
Discussion: https://postgr.es/m/65a899dd-aebc-f667-1d0a-abb89ff3abf8@enterprisedb.com  

M doc/src/sgml/libpq.sgml
M doc/src/sgml/protocol.sgml
M src/backend/access/transam/xact.c
M src/backend/tcop/postgres.c
M src/include/access/xact.h

basebackup_to_shell: Add some const qualifiers for consistency

commit   : 4cb65e10722164fd12c6b8d010a39ce0f92e71f9    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Tue, 13 Dec 2022 10:39:44 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Tue, 13 Dec 2022 10:39:44 +0100    

Click here for diff

M contrib/basebackup_to_shell/basebackup_to_shell.c

Refactor ExecGrant_*() functions

commit   : 369f09e420efe27359b06b69c0265f4aec5c2134    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Tue, 13 Dec 2022 07:43:42 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Tue, 13 Dec 2022 07:43:42 +0100    

Click here for diff

Instead of half a dozen of mostly-duplicate ExecGrant_Foo() functions,  
write one common function ExecGrant_generic() that can handle most of  
them.  We already have all the information we need, such as which  
system catalog corresponds to which catalog table and which column is  
the ACL column.  
  
Reviewed-by: Andres Freund <andres@anarazel.de>  
Reviewed-by: Antonin Houska <ah@cybertec.at>  
Discussion: https://www.postgresql.org/message-id/flat/22c7e802-4e7d-8d87-8b71-cba95e6f4bcf%40enterprisedb.com  

M src/backend/catalog/aclchk.c

Fix jsonb subscripting to cope with toasted subscript values.

commit   : b0feda79fdf02710a6039a324299525845a4a9d4    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 12 Dec 2022 16:17:49 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Mon, 12 Dec 2022 16:17:49 -0500    

Click here for diff

jsonb_get_element() was incautious enough to use VARDATA() and  
VARSIZE() directly on an arbitrary text Datum.  That of course  
fails if the Datum is short-header, compressed, or out-of-line.  
The typical result would be failing to match any element of a  
jsonb object, though matching the wrong one seems possible as well.  
  
setPathObject() was slightly brighter, in that it used VARDATA_ANY  
and VARSIZE_ANY_EXHDR, but that only kept it out of trouble for  
short-header Datums.  push_path() had the same issue.  This could  
result in faulty subscripted insertions, though keys long enough to  
cause a problem are likely rare in the wild.  
  
Having seen these, I looked around for unsafe usages in the rest  
of the adt/json* files.  There are a couple of places where it's not  
immediately obvious that the Datum can't be compressed or out-of-line,  
so I added pg_detoast_datum_packed() to cope if it is.  Also, remove  
some other usages of VARDATA/VARSIZE on Datums we just extracted from  
a text array.  Those aren't actively broken, but they will become so  
if we ever start allowing short-header array elements, which does not  
seem like a terribly unreasonable thing to do.  In any case they are  
not great coding examples, and they could also do with comments  
pointing out that we're assuming we don't need pg_detoast_datum_packed.  
  
Per report from exe-dealer@yandex.ru.  Patch by me, but thanks to  
David Johnston for initial investigation.  Back-patch to v14 where  
jsonb subscripting was introduced.  
  
Discussion: https://postgr.es/m/205321670615953@mail.yandex.ru  

M src/backend/utils/adt/jsonb_gin.c
M src/backend/utils/adt/jsonb_op.c
M src/backend/utils/adt/jsonfuncs.c
M src/test/regress/expected/jsonb.out
M src/test/regress/sql/jsonb.sql

Disable clang 16's -Wcast-function-type-strict.

commit   : 101c37cd342a3ae134bb3e5e0abb14ae46692b56    
  
author   : Thomas Munro <tmunro@postgresql.org>    
date     : Tue, 13 Dec 2022 10:03:28 +1300    
  
committer: Thomas Munro <tmunro@postgresql.org>    
date     : Tue, 13 Dec 2022 10:03:28 +1300    

Click here for diff

Clang 16 is still in development, but seawasp reveals that it has  
started warning about many of our casts of function pointers (those  
introduced by commit 1c27d16e, and some older ones).  Disable the new  
warning for now, since otherwise buildfarm animal seawasp fails, and we  
have no current plans to change our strategy for these callback function  
types.  
  
May be back-patched with other Clang/LLVM 16 changes around release  
time.  
  
Discussion: https://postgr.es/m/CA%2BhUKGJvX%2BL3aMN84ksT-cGy08VHErRNip3nV-WmTx7f6Pqhyw%40mail.gmail.com  

M configure
M configure.ac
M meson.build

Better document logical replication parameters

commit   : a8500750ca0acf6bb95cf9d1ac7f421749b22db7    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 12 Dec 2022 20:18:56 +0100    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 12 Dec 2022 20:18:56 +0100    

Click here for diff

Add some cross-links between chapter "20. Server Parameters" and  
"31. Logical Replication" regarding the available configuration  
parameters, for easier navigation; and some more explanatory text too.  
  
I (Álvaro) chose to duplicate max_replication_slots in Chapter 20,  
because it has completely different meanings at each side of the  
replication link.  
  
Author: Peter Smith <smithpb2250@gmail.com>  
Reviewed-by: vignesh C <vignesh21@gmail.com>  
Reviewed-by: samay sharma <smilingsamay@gmail.com>  
Discussion: https://postgr.es/m/CAHut+PsESqpy7w3Y6cX98c255ZuCjvipkhKjy6hZBjOv4E6iJA@mail.gmail.com  

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

Remove extra space from dumped ALTER DEFAULT PRIVILEGES.

commit   : 2af33369e7940770cb81c0a9b7d3ec874ee8cb22    
  
author   : Jeff Davis <jdavis@postgresql.org>    
date     : Mon, 12 Dec 2022 09:25:50 -0800    
  
committer: Jeff Davis <jdavis@postgresql.org>    
date     : Mon, 12 Dec 2022 09:25:50 -0800    

Click here for diff

Author: Nathan Bossart  
Discussion: https://postgr.es/m/20221206232744.GA3560301@nathanxps13  

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

Fix failure to advance content pointer in sendFileWithContent.

commit   : 45f5c81ad2bc2cd4e6a4fa0ba13b34f5c6048d44    
  
author   : Robert Haas <rhaas@postgresql.org>    
date     : Mon, 12 Dec 2022 10:17:02 -0500    
  
committer: Robert Haas <rhaas@postgresql.org>    
date     : Mon, 12 Dec 2022 10:17:02 -0500    

Click here for diff

If sendFileWithContent were used to send a file larger than the  
bbsink buffer size, this would result in corruption. The only  
files that are sent via sendFileWithContent are the backup label  
file, the tablespace map file, and .done files for WAL segments  
included in the backup. Of these, it seems that only the  
tablespace_map file can become large enough to cause a problem,  
and then only if you have a lot of tablespaces. If you do have  
that situation, you might end up with a corrupted  
tablespace_map file, which would be bad.  
  
My commit bef47ff85df18bf4a3a9b13bd2a54820e27f3614 introduced  
this problem.  
  
Report and patch by Antonin Houska.  
  
Discussion: http://postgr.es/m/15764.1670528645@antos  

M src/backend/backup/basebackup.c

Order getopt arguments

commit   : df8b8968d4095f44acd6de03b4add65f9709b79d    
  
author   : Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 12 Dec 2022 14:33:41 +0100    
  
committer: Peter Eisentraut <peter@eisentraut.org>    
date     : Mon, 12 Dec 2022 14:33:41 +0100    

Click here for diff

Order the letters in the arguments of getopt() and getopt_long(), as  
well as in the subsequent switch statements.  In most cases, I used  
alphabetical with lower case first.  In a few cases, existing  
different orders (e.g., upper case first) was kept to reduce the diff  
size.  
  
Discussion: https://www.postgresql.org/message-id/flat/3efd0fe8-351b-f836-9122-886002602357%40enterprisedb.com  

M src/backend/bootstrap/bootstrap.c
M src/backend/postmaster/postmaster.c
M src/backend/tcop/postgres.c
M src/bin/pg_amcheck/pg_amcheck.c
M src/bin/pg_archivecleanup/pg_archivecleanup.c
M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_basebackup/pg_receivewal.c
M src/bin/pg_basebackup/pg_recvlogical.c
M src/bin/pg_checksums/pg_checksums.c
M src/bin/pg_upgrade/option.c
M src/bin/pgbench/pgbench.c
M src/bin/scripts/clusterdb.c
M src/bin/scripts/createdb.c
M src/bin/scripts/dropdb.c
M src/bin/scripts/dropuser.c
M src/bin/scripts/reindexdb.c
M src/bin/scripts/vacuumdb.c
M src/interfaces/ecpg/preproc/ecpg.c
M src/test/modules/libpq_pipeline/libpq_pipeline.c

Get rid of recursion-marker values in enum AlterTableType

commit   : 840ff5f451cd9a391d237fc60894fea7ad82a189    
  
author   : Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 12 Dec 2022 11:13:26 +0100    
  
committer: Alvaro Herrera <alvherre@alvh.no-ip.org>    
date     : Mon, 12 Dec 2022 11:13:26 +0100    

Click here for diff

During ALTER TABLE execution, when prep-time handling of subcommands of  
certain types determine that execution-time handling requires recursion,  
they signal this by changing the subcommand type to a special value.  
This can be done in a simpler way by using a separate flag introduced by  
commit ec0925c22a3d, so do that.  
  
Catversion bumped.  It's not clear to me that ALTER TABLE subcommands  
are stored anywhere in catalogs (CREATE FUNCTION rejects it in BEGIN  
ATOMIC function bodies), but we do have both write and read support for  
them, so be safe.  
  
Discussion: https://postgr.es/m/20220929090033.zxuaezcdwh2fgfjb@alvherre.pgsql  

M src/backend/commands/tablecmds.c
M src/backend/parser/parse_utilcmd.c
M src/include/catalog/catversion.h
M src/include/nodes/parsenodes.h
M src/test/modules/test_ddl_deparse/test_ddl_deparse.c

Add support for GRANT SET in psql tab completion

commit   : 9d0cf574920f1d5e6c260815d242b6691d37d5dc    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Mon, 12 Dec 2022 16:47:24 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Mon, 12 Dec 2022 16:47:24 +0900    

Click here for diff

3d14e17 has added support for this query but psql was not able to  
complete it.  Spotted while working on a different patch in the same  
area.  
  
Reviewed-by: Robert Haas  
Discussion: https://postgr.es/m/Y3hw7yvG0VwpC1jq@paquier.xyz  

M src/bin/psql/tab-complete.c

Remove direct call to GetNewObjectId() for pg_auth_members.oid

commit   : eae7fe485998ac493a3d9dadf254a89c9265891e    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Mon, 12 Dec 2022 09:01:39 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Mon, 12 Dec 2022 09:01:39 +0900    

Click here for diff

This routine should not be called directly as mentioned at its top, so  
replace it by GetNewOidWithIndex().  Issue introduced by 6566133 when  
pg_auth_members.oid got added, so no backpatch is needed.  
  
Author: Maciek Sakrejda  
Discussion: https://postgr.es/m/CAOtHd0Ckbih7Ur7XeVyLAJ26VZOfTNcq9qV403bNF4uTGtAN+Q@mail.gmail.com  

M src/backend/commands/user.c

Convert domain_in to report errors softly.

commit   : b8c0ffbd2c8038fbebe76b48616860a7efec66ae    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 11 Dec 2022 12:56:54 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 11 Dec 2022 12:56:54 -0500    

Click here for diff

This is straightforward as far as it goes.  However, it does not  
attempt to trap errors occurring during the execution of domain  
CHECK constraints.  Since those are general user-defined  
expressions, the only way to do that would involve starting up a  
subtransaction for each check.  Of course the entire point of  
the soft-errors feature is to not need subtransactions, so that  
would be self-defeating.  For now, we'll rely on the assumption  
that domain checks are written to avoid throwing errors.  
  
Discussion: https://postgr.es/m/1181028.1670635727@sss.pgh.pa.us  

M doc/src/sgml/ref/create_domain.sgml
M src/backend/utils/adt/domains.c
M src/test/regress/expected/domain.out
M src/test/regress/sql/domain.sql

Convert json_in and jsonb_in to report errors softly.

commit   : c60c9badba9b4db3155eef081ae0b923f983168c    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 11 Dec 2022 11:28:15 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 11 Dec 2022 11:28:15 -0500    

Click here for diff

This requires a bit of further infrastructure-extension to allow  
trapping errors reported by numeric_in and pg_unicode_to_server,  
but otherwise it's pretty straightforward.  
  
In the case of jsonb_in, we are only capturing errors reported  
during the initial "parse" phase.  The value-construction phase  
(JsonbValueToJsonb) can also throw errors if assorted implementation  
limits are exceeded.  We should improve that, but it seems like a  
separable project.  
  
Andrew Dunstan and Tom Lane  
  
Discussion: https://postgr.es/m/3bac9841-fe07-713d-fa42-606c225567d6@dunslane.net  

M src/backend/utils/adt/json.c
M src/backend/utils/adt/jsonb.c
M src/backend/utils/adt/jsonfuncs.c
M src/backend/utils/fmgr/fmgr.c
M src/backend/utils/mb/mbutils.c
M src/common/jsonapi.c
M src/include/common/jsonapi.h
M src/include/fmgr.h
M src/include/mb/pg_wchar.h
M src/include/utils/jsonfuncs.h
M src/test/regress/expected/json.out
M src/test/regress/expected/json_encoding.out
M src/test/regress/expected/json_encoding_1.out
M src/test/regress/expected/jsonb.out
M src/test/regress/sql/json.sql
M src/test/regress/sql/json_encoding.sql
M src/test/regress/sql/jsonb.sql

Change JsonSemAction to allow non-throw error reporting.

commit   : 50428a301d5ad46316cac2192f2ca8d91898aa3c    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 11 Dec 2022 10:39:05 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sun, 11 Dec 2022 10:39:05 -0500    

Click here for diff

Formerly, semantic action functions for the JSON parser returned void,  
so that there was no way for them to affect the parser's behavior.  
That means in particular that they can't force an error exit except by  
longjmp'ing.  That won't do in the context of our project to make input  
functions return errors softly.  Hence, change them to return the same  
JsonParseErrorType enum value as the parser itself uses.  If an action  
function returns anything besides JSON_SUCCESS, the parse is abandoned  
and that error code is returned.  
  
Action functions can thus easily return the same error conditions that  
the parser already knows about.  As an escape hatch for expansion, also  
invent a code JSON_SEM_ACTION_FAILED that the core parser does not know  
the exact meaning of.  When returning this code, an action function  
must use some out-of-band mechanism for reporting the error details.  
  
This commit simply makes the API change and causes all the existing  
action functions to return JSON_SUCCESS, so that there is no actual  
change in behavior here.  This is long enough and boring enough that  
it seemed best to commit it separately from the changes that make  
real use of the new mechanism.  
  
In passing, remove a duplicate assignment of  
transform_string_values_scalar.  
  
Discussion: https://postgr.es/m/1436686.1670701118@sss.pgh.pa.us  

M src/backend/utils/adt/jsonb.c
M src/backend/utils/adt/jsonfuncs.c
M src/bin/pg_verifybackup/parse_manifest.c
M src/common/jsonapi.c
M src/include/common/jsonapi.h

Standardize error reports in unimplemented I/O functions.

commit   : d02ef65bce6575e10ac0b4e7b8552ff67687c944    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 10 Dec 2022 18:26:43 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 10 Dec 2022 18:26:43 -0500    

Click here for diff

We chose a specific wording of the not-implemented errors for  
pseudotype I/O functions and other cases where there's little  
value in implementing input and/or output.  gtsvectorin never  
got that memo though, nor did most of contrib.  Make these all  
fall in line, mostly because I'm a neatnik but also to remove  
unnecessary translatable strings.  
  
gbtreekey_in needs a bit of extra love since it supports  
multiple SQL types.  Sadly, gbtreekey_out doesn't have the  
ability to do that, but I think it's unreachable anyway.  
  
Noted while surveying datatype input functions to see what we  
have left to fix.  

M contrib/btree_gist/btree_gist.c
M contrib/hstore/hstore_gist.c
M contrib/intarray/_intbig_gist.c
M contrib/ltree/ltree_gist.c
M contrib/pg_trgm/trgm_gist.c
M src/backend/utils/adt/tsgistidx.c

Use the macro, not handwritten code, to construct anymultirange_in().

commit   : e730718072bdc8379f3d099c64455c20d6a6d1ad    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 10 Dec 2022 17:22:16 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Sat, 10 Dec 2022 17:22:16 -0500    

Click here for diff

Apparently anymultirange_in was written before we converted all  
these pseudotype input functions to use a common macro, and it didn't  
get fixed before committing.  Sloppy merging probably explains its  
unintuitive ordering, too, so rearrange.  
  
Noted while surveying datatype input functions to see what we  
have left to fix.  I'm inclined to leave the pseudotypes as  
throwing hard errors, because it's difficult to see a reason why  
anyone would need something else.  But in any case, if we want  
to change that, we shouldn't have to change multiple copies of  
the code.  

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

Add subquery pullup handling for WindowClause runCondition

commit   : 94985c21020aa4a40d0dda1a26ac3e35a57e4681    
  
author   : David Rowley <drowley@postgresql.org>    
date     : Sat, 10 Dec 2022 19:27:20 +1300    
  
committer: David Rowley <drowley@postgresql.org>    
date     : Sat, 10 Dec 2022 19:27:20 +1300    

Click here for diff

9d9c02ccd added code to allow WindowAgg to take some shortcuts when a  
monotonic WindowFunc reached some value that it could never come back  
from due to the function's monotonic nature.  That commit added a  
runCondition field to WindowClause to store the condition which, when it  
becomes false we can start taking shortcuts in nodeWindowAgg.c.  
  
Here we fix an issue where subquery pullups didn't properly update the  
runCondition to update the Vars to properly reference the new query level.  
  
Here we also add a missing call to preprocess_expression() for the  
WindowClause's runCondtion.  The WindowFuncs in the targetlist will have  
had this process done, so we must also do it for the WindowFuncs in the  
runCondition so that they can be correctly found in the targetlist  
during setrefs.c  
  
Bug: #17709  
Reported-by: Alexey Makhmutov  
Author: Richard Guo, David Rowley  
Discussion: https://postgr.es/m/17709-4f557160e3e8ee9a@postgresql.org  
Backpatch-through: 15, where 9d9c02ccd was introduced  

M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/prep/prepjointree.c

Fix macro definitions in pgstatfuncs.c

commit   : 66dcb09246b49b2cd0421251221e07c388de9c4f    
  
author   : Michael Paquier <michael@paquier.xyz>    
date     : Sat, 10 Dec 2022 13:28:02 +0900    
  
committer: Michael Paquier <michael@paquier.xyz>    
date     : Sat, 10 Dec 2022 13:28:02 +0900    

Click here for diff

Buildfarm member wrasse has been complaining about empty declarations  
as an effect of 8018ffb and 83a1a1b due to extra semicolons.  
  
While on it, remove also the last backslash of the macros definitions,  
causing more lines to be eaten in it than necessary, per comment from  
Tom Lane.  
  
Reported-by: Tom Lane, and buildfarm member wrasse  
Author: Nathan Bossart, Michael Paquier  
Discussion: https://postgr.es/m/1188769.1670640236@sss.pgh.pa.us  

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

Restructure soft-error handling in formatting.c.

commit   : 4dd687502d9eb0b2984c36579c2fcf5283adfa7c    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 9 Dec 2022 20:15:56 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 9 Dec 2022 20:15:56 -0500    

Click here for diff

Replace the error trapping scheme introduced in 5bc450629 with our  
shiny new errsave/ereturn mechanism.  This doesn't have any real  
functional impact (although I think that the new coding is able  
to report a few more errors softly than v15 did).  And I doubt  
there's any measurable performance difference either.  But this  
gets rid of an ad-hoc, one-of-a-kind design in favor of a mechanism  
that will be widely used going forward, so it should be a net win  
for code readability.  
  
Discussion: https://postgr.es/m/3bbbb0df-7382-bf87-9737-340ba096e034@postgrespro.ru  

M src/backend/utils/adt/formatting.c
M src/backend/utils/adt/jsonpath_exec.c
M src/include/utils/formatting.h

Convert datetime input functions to use "soft" error reporting.

commit   : c60488b4748b4316f1c92d62457671046e5c8994    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 9 Dec 2022 16:07:49 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 9 Dec 2022 16:07:49 -0500    

Click here for diff

This patch converts the input functions for date, time, timetz,  
timestamp, timestamptz, and interval to the new soft-error style.  
There's some related stuff in formatting.c that remains to be  
cleaned up, but that seems like a separable project.  
  
Discussion: https://postgr.es/m/3bbbb0df-7382-bf87-9737-340ba096e034@postgrespro.ru  

M src/backend/utils/adt/date.c
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/formatting.c
M src/backend/utils/adt/timestamp.c
M src/include/utils/datetime.h
M src/test/regress/expected/date.out
M src/test/regress/expected/interval.out
M src/test/regress/expected/time.out
M src/test/regress/expected/timestamp.out
M src/test/regress/expected/timestamptz.out
M src/test/regress/expected/timetz.out
M src/test/regress/sql/date.sql
M src/test/regress/sql/interval.sql
M src/test/regress/sql/time.sql
M src/test/regress/sql/timestamp.sql
M src/test/regress/sql/timestamptz.sql
M src/test/regress/sql/timetz.sql

Allow DateTimeParseError to handle bad-timezone error messages.

commit   : 2661469d862239ea8b9e3a1cf5352d833f6f0fec    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 9 Dec 2022 13:30:43 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 9 Dec 2022 13:30:43 -0500    

Click here for diff

Pay down some ancient technical debt (dating to commit 022fd9966):  
fix a couple of places in datetime parsing that were throwing  
ereport's immediately instead of returning a DTERR code that could be  
interpreted by DateTimeParseError.  The reason for that was that there  
was no mechanism for passing any auxiliary data (such as a zone name)  
to DateTimeParseError, and these errors seemed to really need it.  
Up to now it didn't matter that much just where the error got thrown,  
but now we'd like to have a hard policy that datetime parse errors  
get thrown from just the one place.  
  
Hence, invent a "DateTimeErrorExtra" struct that can be used to  
carry any extra values needed for specific DTERR codes.  Perhaps  
in the future somebody will be motivated to use this to improve  
the specificity of other DateTimeParseError messages, but for now  
just deal with the timezone-error cases.  
  
This is on the way to making the datetime input functions report  
parse errors softly; but it's really an independent change, so  
commit separately.  
  
Discussion: https://postgr.es/m/3bbbb0df-7382-bf87-9737-340ba096e034@postgrespro.ru  

M contrib/adminpack/adminpack.c
M src/backend/access/transam/xlogrecovery.c
M src/backend/utils/adt/date.c
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/formatting.c
M src/backend/utils/adt/timestamp.c
M src/include/utils/datetime.h

meson: Improve PG_VERSION_STR generation

commit   : fc7852c6cb89a5384e0b4ad30874de92f63f88be    
  
author   : Andres Freund <andres@anarazel.de>    
date     : Fri, 9 Dec 2022 08:53:23 -0800    
  
committer: Andres Freund <andres@anarazel.de>    
date     : Fri, 9 Dec 2022 08:53:23 -0800    

Click here for diff

Previously the host operating system and 32/64 bit were not included and the  
build machine's cpu was used, which is potentially wrong for cross builds.  
  
Author: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>  
Author: Andres Freund <andres@anarazel.de>  
Discussion: https://postgr.es/m/CAC+AXB16gwYhKCdS+t0pk3U7kKtpVj5L-ynmhK3Gbea330At3w@mail.gmail.com  

M meson.build

Const-ify a couple of datetime parsing subroutines.

commit   : bad5116957eea2dc360c6c233be08284bd3d5364    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 9 Dec 2022 10:43:45 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 9 Dec 2022 10:43:45 -0500    

Click here for diff

More could be done in this line, but I just grabbed some low-hanging  
fruit.  Principal objective was to remove the need for several ugly  
unconstify() usages in formatting.c.  

M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/formatting.c
M src/include/utils/datetime.h

Convert a few datatype input functions to use "soft" error reporting.

commit   : ccff2d20ed9622815df2a7deffce8a7b14830965    
  
author   : Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 9 Dec 2022 10:14:53 -0500    
  
committer: Tom Lane <tgl@sss.pgh.pa.us>    
date     : Fri, 9 Dec 2022 10:14:53 -0500    

Click here for diff

This patch converts the input functions for bool, int2, int4, int8,  
float4, float8, numeric, and contrib/cube to the new soft-error style.  
array_in and record_in are also converted.  There's lots more to do,  
but this is enough to provide proof-of-concept that the soft-error  
API is usable, as well as reference examples for how to convert  
input functions.  
  
This patch is mostly by me, but it owes very substantial debt to  
earlier work by Nikita Glukhov, Andrew Dunstan, and Amul Sul.  
Thanks to Andres Freund for review.  
  
Discussion: https://postgr.es/m/3bbbb0d