PostgreSQL 18.0 (upcoming) commit log

Bump PGSTAT_FILE_FORMAT_ID

commit   : ce9a74707d4cf7768cff06298d09c7f7e823341d    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 14 Jan 2025 15:17:22 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 14 Jan 2025 15:17:22 +0900    

Click here for diff

Oversight in f92c854cf406, that has changed the definition of  
PgStat_BktypeIO, impacting PgStat_IO which is the on-disk data for IO  
pgstats data.  

M src/include/pgstat.h

Fix potential integer overflow in bringetbitmap()

commit   : 720e529840d5a1087a34db445f624c5ece46eb38    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 14 Jan 2025 15:12:56 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 14 Jan 2025 15:12:56 +0900    

Click here for diff

This function expects an "int64" as result and stores the number of  
pages to add to the index scan bitmap as an "int", multiplying its final  
result by 10.  For a relation large enough, this can theoretically  
overflow if counting more than (INT32_MAX / 10) pages, knowing that the  
number of pages is upper-bounded by MaxBlockNumber.  
  
To avoid the overflow, this commit redefines "totalpages", used to  
calculate the result, to be an "int64" rather than an "int".  
  
Reported-by: Evgeniy Gorbanyov  
Author: James Hunter  
Discussion: https://www.postgresql.org/message-id/[email protected]  
Backpatch-through: 13  

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

Move information about pgstats kinds into its own header pgstat_kind.h

commit   : d35ea27e51c05cbe3575d50a6b99d64f20a3a742    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 14 Jan 2025 12:43:07 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 14 Jan 2025 12:43:07 +0900    

Click here for diff

This includes all the definitions for the various PGSTAT_KIND_* values,  
the range allowed for custom stats kinds and some macros related all  
that.  
  
One use-case behind this split is the possibility to use this  
information for frontend tools, without having to rely on pgstat.h and a  
backend footprint.  
  
Author: Michael Paquier  
Reviewed-by: Bertrand Drouvot  
Discussion: https://postgr.es/m/[email protected]  

M src/include/pgstat.h
A src/include/utils/pgstat_kind.h

Remove assertion in pgstat_count_io_op()

commit   : d2181b321852d4dbea8a909d2f039ebdcbf0e009    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 14 Jan 2025 12:19:51 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 14 Jan 2025 12:19:51 +0900    

Click here for diff

An equivalent check is done with pgstat_is_ioop_tracked_in_bytes(), so  
there is no need for this extra one.  Small cleanup that should have  
been included in f92c854cf406.  
  
Author: Nazir Bilal Yavuz  
Reviewed-by: Bertrand Drouvot  
Discussion: https://postgr.es/m/CAN55FZ0oqxBaaHAEsj=xFqkzE3n5P=3RA1V_igXwL-RV7QRzyw@mail.gmail.com  

M src/backend/utils/activity/pgstat_io.c

Make pg_stat_io count IOs as bytes instead of blocks for some operations

commit   : f92c854cf406a5ad34c9aa92416d578819704aa2    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 14 Jan 2025 12:14:29 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 14 Jan 2025 12:14:29 +0900    

Click here for diff

Currently in pg_stat_io view, IOs are counted as blocks of size  
BLCKSZ.  There are two limitations with this design:  
* The actual number of I/O requests sent to the kernel is lower because  
I/O requests may be merged before being sent.  Additionally, it gives  
the impression that all I/Os are done in block size, which shadows the  
benefits of merging I/O requests.  
* Some patches are under work to extend pg_stat_io for the tracking of  
operations that may not be linked to the block size.  For example, WAL  
read IOs are done in variable bytes and it is not possible to correctly  
show these IOs in pg_stat_io view, and we want to keep all this data in  
a single system view rather than spread it across multiple relations to  
ease monitoring.  
  
WaitReadBuffers() can now be tracked as a single read operation  
worth N blocks.  Same for ExtendBufferedRelShared() and  
ExtendBufferedRelLocal() for extensions.  
  
Three columns are added to pg_stat_io for reads, writes and extensions  
for the byte calculations.  op_bytes, which was always hardcoded to  
BLCKSZ, is removed.  IO backend statistics are updated to reflect these  
changes.  
  
Bump catalog version.  
  
Author: Nazir Bilal Yavuz  
Reviewed-by: Bertrand Drouvot, Melanie Plageman  
Discussion: https://postgr.es/m/CAN55FZ0oqxBaaHAEsj=xFqkzE3n5P=3RA1V_igXwL-RV7QRzyw@mail.gmail.com  

M doc/src/sgml/monitoring.sgml
M src/backend/catalog/system_views.sql
M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/buffer/localbuf.c
M src/backend/storage/smgr/md.c
M src/backend/utils/activity/pgstat_backend.c
M src/backend/utils/activity/pgstat_io.c
M src/backend/utils/adt/pgstatfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.dat
M src/include/pgstat.h
M src/test/regress/expected/rules.out

Revert "TupleHashTable: store additional data along with tuple."

commit   : b4a07f532b40a64fb4714a3f7ab6063435411edb    
  
author   : Jeff Davis <[email protected]>    
date     : Mon, 13 Jan 2025 14:14:07 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Mon, 13 Jan 2025 14:14:07 -0800    

Click here for diff

This reverts commit e0ece2a981ee9068f50c4423e303836c2585eb02 due to  
performance regressions.  
  
Reported-by: David Rowley  

M src/backend/executor/execGrouping.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeSetOp.c
M src/backend/executor/nodeSubplan.c
M src/include/executor/executor.h
M src/include/nodes/execnodes.h

Reorder vacuum GUCs in postgresql.conf.sample to match docs

commit   : af2317652d5daf8b382cc65936731c4a3c0aaa4c    
  
author   : Melanie Plageman <[email protected]>    
date     : Mon, 13 Jan 2025 15:21:04 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Mon, 13 Jan 2025 15:21:04 -0500    

Click here for diff

ca9c6a5680d consolidated most of vacuum-related GUCs' documentation into  
a new subsection. It neglected, however, to reorganize  
postgresql.conf.sample to match the new order. Do this now.  
  
Reported-by: Álvaro Herrera  
Discussion: https://postgr.es/m/202501110902.5banlseavz7c%40alvherre.pgsql  

M src/backend/utils/misc/postgresql.conf.sample

Add BTOPTIONS_PROC comments to nbtree.h.

commit   : 1c854eb8931a8ce2ba8e2cc4d0a209a45d836de5    
  
author   : Peter Geoghegan <[email protected]>    
date     : Mon, 13 Jan 2025 15:02:14 -0500    
  
committer: Peter Geoghegan <[email protected]>    
date     : Mon, 13 Jan 2025 15:02:14 -0500    

Click here for diff

Add comments explaining the purpose of B-Tree support function 5 to  
nbtree.h for consistency (all other support functions were already  
described by nearby comments).  
  
This fixes what was arguably an oversight in commit 911e702077, or in  
follow-up doc commit 15cb2bd2 (which documented support function 5 in  
btree.sgml, but neglected to add anything to nbtree.h).  

M src/include/access/nbtree.h

Move nbtree preprocessing into new .c file.

commit   : 597b1ffbf12352a3863a894f16741864aaf2242f    
  
author   : Peter Geoghegan <[email protected]>    
date     : Mon, 13 Jan 2025 12:15:00 -0500    
  
committer: Peter Geoghegan <[email protected]>    
date     : Mon, 13 Jan 2025 12:15:00 -0500    

Click here for diff

Quite a bit of code within nbtutils.c is only called during nbtree  
preprocessing.  Move that code into a new .c file, nbtpreprocesskeys.c.  
Also reorder some of the functions within the new file for clarity.  
  
This commit has no functional impact.  It is strictly mechanical.  
  
Author: Peter Geoghegan <[email protected]>  
Suggested-by: Heikki Linnakangas <[email protected]>  
Discussion: https://postgr.es/m/CAH2-WznwNn1BDOpWxHBUK1f3Rdw8pO9UCenWXnvT=n9GO8GnLA@mail.gmail.com  
Discussion: https://postgr.es/m/86930045-5df5-494a-b4f1-815bc3fbcce0%40iki.fi  

M src/backend/access/nbtree/Makefile
M src/backend/access/nbtree/meson.build
A src/backend/access/nbtree/nbtpreprocesskeys.c
M src/backend/access/nbtree/nbtutils.c
M src/include/access/nbtree.h

Add commit 6e826278f1 to .git-blame-ignore-revs.

commit   : a8a762bc46e43bfaf4c03fc50f805fdf53f11888    
  
author   : Nathan Bossart <[email protected]>    
date     : Mon, 13 Jan 2025 09:37:32 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Mon, 13 Jan 2025 09:37:32 -0600    

Click here for diff

M .git-blame-ignore-revs

Fix pgindent damage

commit   : 6e826278f1ebd9967c0f8adda29c8960a812e344    
  
author   : Richard Guo <[email protected]>    
date     : Mon, 13 Jan 2025 11:27:32 +0900    
  
committer: Richard Guo <[email protected]>    
date     : Mon, 13 Jan 2025 11:27:32 +0900    

Click here for diff

Oversight in commit e0ece2a98.  

M src/backend/executor/execGrouping.c
M src/include/nodes/execnodes.h

Fix HBA option count

commit   : 97698cc517c75d3cbb9c680aab3afd36e471b83a    
  
author   : Daniel Gustafsson <[email protected]>    
date     : Sun, 12 Jan 2025 23:44:39 +0100    
  
committer: Daniel Gustafsson <[email protected]>    
date     : Sun, 12 Jan 2025 23:44:39 +0100    

Click here for diff

Commit 27a1f8d108 missed updating the max HBA option count to  
account for the new option added.  Fix by bumping the counter  
and adjust the relevant comment to match.  Backpatch down to  
all supported branches like the erroneous commit.  
  
Reported-by: Tom Lane <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: v13  

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

Fix JsonExpr deparsing to quote variable names in the PASSING clause.

commit   : a93e2a1e25a6d5410abb1446637c4d9a4f24e35d    
  
author   : Dean Rasheed <[email protected]>    
date     : Sun, 12 Jan 2025 13:35:12 +0000    
  
committer: Dean Rasheed <[email protected]>    
date     : Sun, 12 Jan 2025 13:35:12 +0000    

Click here for diff

When deparsing a JsonExpr, variable names in the PASSING clause were  
not quoted. However, since they are parsed as ColLabel tokens, some  
variable names require double quotes to ensure that they are properly  
interpreted. Fix by using quote_identifier() in the deparsing code.  
  
This oversight was limited to the SQL/JSON query functions  
JSON_EXISTS(), JSON_QUERY(), and JSON_VALUE().  
  
Back-patch to v17, where these functions were added.  
  
Dean Rasheed, reviewed by Tom Lane.  
  
Discussion: https://postgr.es/m/CAEZATCXTpAS%3DncfLNTZ7YS6O5puHeLg_SUYAit%2Bcs7wsrd9Msg%40mail.gmail.com  

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

Fix XMLTABLE() deparsing to quote namespace names if necessary.

commit   : d673eefd410cd7f5f95e418990146189f44811af    
  
author   : Dean Rasheed <[email protected]>    
date     : Sun, 12 Jan 2025 12:54:32 +0000    
  
committer: Dean Rasheed <[email protected]>    
date     : Sun, 12 Jan 2025 12:54:32 +0000    

Click here for diff

When deparsing an XMLTABLE() expression, XML namespace names were not  
quoted. However, since they are parsed as ColLabel tokens, some names  
require double quotes to ensure that they are properly interpreted.  
Fix by using quote_identifier() in the deparsing code.  
  
Back-patch to all supported versions.  
  
Dean Rasheed, reviewed by Tom Lane.  
  
Discussion: https://postgr.es/m/CAEZATCXTpAS%3DncfLNTZ7YS6O5puHeLg_SUYAit%2Bcs7wsrd9Msg%40mail.gmail.com  

M src/backend/utils/adt/ruleutils.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

Repair memory leaks in plpython.

commit   : 29dfffae0a6db6cb880ae873169f5512ddab703d    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 11 Jan 2025 11:45:56 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 11 Jan 2025 11:45:56 -0500    

Click here for diff

PLy_spi_execute_plan (PLyPlan.execute) and PLy_cursor_plan  
(plpy.cursor) use PLy_output_convert to convert Python values  
into Datums that can be passed to the query-to-execute.  But they  
failed to pay much attention to its warning that it can leave "cruft  
generated along the way" behind.  Repeated use of these methods can  
result in a substantial memory leak for the duration of the calling  
plpython function.  
  
To fix, make a temporary memory context to invoke PLy_output_convert  
in.  This also lets us get rid of the rather fragile code that was  
here for retail pfree's of the converted Datums.  Indeed, we don't  
need the PLyPlanObject.values field anymore at all, though I left it  
in place in the back branches in the name of ABI stability.  
  
Mat Arye and Tom Lane, per report from Mat Arye.  Back-patch to all  
supported branches.  
  
Discussion: https://postgr.es/m/CADsUR0DvVgnZYWwnmKRK65MZg7YLUSTDLV61qdnrwtrAJgU6xw@mail.gmail.com  

M src/pl/plpython/plpy_cursorobject.c
M src/pl/plpython/plpy_planobject.c
M src/pl/plpython/plpy_planobject.h
M src/pl/plpython/plpy_spi.c

Add support for NOT ENFORCED in CHECK constraints

commit   : ca87c415e2fccf81cec6fd45698dde9fae0ab570    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 11 Jan 2025 10:45:17 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 11 Jan 2025 10:45:17 +0100    

Click here for diff

This adds support for the NOT ENFORCED/ENFORCED flag for constraints,  
with support for check constraints.  
  
The plan is to eventually support this for foreign key constraints,  
where it is typically more useful.  
  
Note that CHECK constraints do not currently support ALTER operations,  
so changing the enforceability of an existing constraint isn't  
possible without dropping and recreating it.  This could be added  
later.  
  
Author: Amul Sul <[email protected]>  
Reviewed-by: Peter Eisentraut <[email protected]>  
Reviewed-by: jian he <[email protected]>  
Tested-by: Triveni N <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CAAJ_b962c5AcYW9KUt_R_ER5qs3fUGbe4az-SP-vuwPS-w-AGA@mail.gmail.com  

M doc/src/sgml/catalogs.sgml
M doc/src/sgml/information_schema.sgml
M doc/src/sgml/ref/alter_table.sgml
M doc/src/sgml/ref/create_foreign_table.sgml
M doc/src/sgml/ref/create_table.sgml
M src/backend/access/common/tupdesc.c
M src/backend/catalog/heap.c
M src/backend/catalog/index.c
M src/backend/catalog/information_schema.sql
M src/backend/catalog/pg_constraint.c
M src/backend/catalog/sql_features.txt
M src/backend/commands/tablecmds.c
M src/backend/commands/trigger.c
M src/backend/commands/typecmds.c
M src/backend/executor/execMain.c
M src/backend/nodes/makefuncs.c
M src/backend/optimizer/util/plancat.c
M src/backend/parser/gram.y
M src/backend/parser/parse_utilcmd.c
M src/backend/utils/adt/ruleutils.c
M src/backend/utils/cache/relcache.c
M src/include/access/tupdesc.h
M src/include/catalog/catversion.h
M src/include/catalog/heap.h
M src/include/catalog/pg_constraint.h
M src/include/nodes/parsenodes.h
M src/include/parser/kwlist.h
M src/test/regress/expected/alter_table.out
M src/test/regress/expected/constraints.out
M src/test/regress/expected/create_table_like.out
M src/test/regress/expected/domain.out
M src/test/regress/expected/inherit.out
M src/test/regress/sql/alter_table.sql
M src/test/regress/sql/constraints.sql
M src/test/regress/sql/create_table_like.sql
M src/test/regress/sql/domain.sql
M src/test/regress/sql/inherit.sql

Fix a compiler warning in initStringInfo().

commit   : 72ceb21b029433dd82f29182894dce63e639b4d4    
  
author   : Tatsuo Ishii <[email protected]>    
date     : Sat, 11 Jan 2025 15:52:37 +0900    
  
committer: Tatsuo Ishii <[email protected]>    
date     : Sat, 11 Jan 2025 15:52:37 +0900    

Click here for diff

Fix a compiler warning found by Cfbot. This was caused by commit  
bb86e85e442.  

M src/common/stringinfo.c

Fix redefinition of type in commit e0ece2a981.

commit   : ceb2855522940d5aaae4c6e5eed493d60e3196ce    
  
author   : Jeff Davis <[email protected]>    
date     : Fri, 10 Jan 2025 17:45:27 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Fri, 10 Jan 2025 17:45:27 -0800    

Click here for diff

M src/backend/executor/execGrouping.c

TupleHashTable: store additional data along with tuple.

commit   : e0ece2a981ee9068f50c4423e303836c2585eb02    
  
author   : Jeff Davis <[email protected]>    
date     : Fri, 10 Jan 2025 17:14:37 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Fri, 10 Jan 2025 17:14:37 -0800    

Click here for diff

Previously, the caller needed to allocate the memory and the  
TupleHashTable would store a pointer to it. That wastes space for the  
palloc overhead as well as the size of the pointer itself.  
  
Now, the TupleHashTable relies on the caller to correctly specify the  
additionalsize, and allocates that amount of space. The caller can  
then request a pointer into that space.  
  
Discussion: https://postgr.es/m/[email protected]  
Reviewed-by: Heikki Linnakangas  

M src/backend/executor/execGrouping.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeSetOp.c
M src/backend/executor/nodeSubplan.c
M src/include/executor/executor.h
M src/include/nodes/execnodes.h

Make verify_compact_attribute available in non-assert builds

commit   : 34c6e652425fde42c2746f749e31d196fc0d5538    
  
author   : David Rowley <[email protected]>    
date     : Sat, 11 Jan 2025 13:45:54 +1300    
  
committer: David Rowley <[email protected]>    
date     : Sat, 11 Jan 2025 13:45:54 +1300    

Click here for diff

6f3820f37 adjusted the assert-enabled validation of the CompactAttribute  
to call a new external function to perform the validation.  That commit  
made it so the function was only available when building with  
USE_ASSERT_CHECKING, and because TupleDescCompactAttr() is a static  
inline function, the call to verify_compact_attribute() was compiled  
into any extension which uses TupleDescCompactAttr().  This caused issues  
for such extensions when loading the assert-enabled extension into  
PostgreSQL versions without asserts enabled due to that function being  
unavailable in core.  
  
To fix this, make verify_compact_attribute() available unconditionally,  
but make it do nothing unless building with USE_ASSERT_CHECKING.  
  
Author: Andrew Kane <[email protected]>  
Reviewed-by: David Rowley <[email protected]>  
Reviewed-by: Tom Lane <[email protected]>  
Discussion: https://postgr.es/m/CAOdR5yHfMEMW00XGo=v1zCVUS6Huq2UehXdvKnwtXPTcZwXhmg@mail.gmail.com  

M src/backend/access/common/tupdesc.c
M src/include/access/tupdesc.h

Add new StringInfo APIs to allow callers to specify the buffer size.

commit   : a9dcbb4d5c00b703e727e14055ed70c525a86418    
  
author   : Tatsuo Ishii <[email protected]>    
date     : Sat, 11 Jan 2025 08:02:56 +0900    
  
committer: Tatsuo Ishii <[email protected]>    
date     : Sat, 11 Jan 2025 08:02:56 +0900    

Click here for diff

Previously StringInfo APIs allocated buffers with fixed initial  
allocation size of 1024 bytes. This may be too large and inappropriate  
for some callers that can do with smaller memory buffers. To fix this,  
introduce new APIs that allow callers to specify initial buffer size.  
  
extern StringInfo makeStringInfoExt(int initsize);  
extern void initStringInfoExt(StringInfo str, int initsize);  
  
Existing APIs (makeStringInfo() and initStringInfo()) are changed to  
call makeStringInfoExt and initStringInfoExt respectively (via inline  
helper functions makeStringInfoInternal and initStringInfoInternal),  
with the default buffer size of 1024.  
  
Reviewed-by: Nathan Bossart, David Rowley, Michael Paquier, Gurjeet Singh  
Discussion: https://postgr.es/m/20241225.123704.1194662271286702010.ishii%40postgresql.org  

M src/common/stringinfo.c
M src/include/lib/stringinfo.h

commit   : ca9c6a5680d7c7dece0f7209ee7ce20c9dfe0840    
  
author   : Melanie Plageman <[email protected]>    
date     : Fri, 10 Jan 2025 18:20:16 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Fri, 10 Jan 2025 18:20:16 -0500    

Click here for diff

GUCs related to vacuum's freezing behavior were documented in a  
subsection of the Client Connection Defaults documentation. These GUCs  
don't belong there, as they affect the freezing behavior of all vacuums  
-- including autovacuums.  
  
There wasn't a clear alternative location, so this commit makes a new  
"Server Configuration" docs subsection, "Vacuuming", with a subsection  
for "Freezing". It also moves the "Automatic Vacuuming" subsection and  
the docs on GUCs controlling cost-based vacuum delay under the new  
"Vacuuming" subsection.  
  
The other vacuum-related GUCs under the "Resource Consumption"  
subsection have been left in their current location, as they seem to fit  
there.  
  
The GUCs' documentation was largely lifted and shifted. The only  
modification made was the addition of a few missing <literal> tags.  
  
Reviewed-by: Daniel Gustafsson <[email protected]>  
Discussion: https://postgr.es/m/flat/CAAKRu_aQUOaMYrcjNuXeSkJtaX9oRUzKP57bsYbC0gVVWS%2BcbA%40mail.gmail.com  

M doc/src/sgml/config.sgml

Fix missing ldapscheme option in pg_hba_file_rules()

commit   : 27a1f8d108114ec463101a812f83542c257f8169    
  
author   : Daniel Gustafsson <[email protected]>    
date     : Fri, 10 Jan 2025 22:02:58 +0100    
  
committer: Daniel Gustafsson <[email protected]>    
date     : Fri, 10 Jan 2025 22:02:58 +0100    

Click here for diff

The ldapscheme option was missed when inspecing the HbaLine for  
assembling rows for the pg_hba_file_rules function.  Backpatch  
to all supported versions.  
  
Author: Laurenz Albe <[email protected]>  
Reported-by: Laurenz Albe <[email protected]>  
Reviewed-by: Daniel Gustafsson <[email protected]>  
Bug: 18769  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: v13  

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

commit   : 5b14ec0a48cca3addfc7262c86e60475b7d84c02    
  
author   : Peter Geoghegan <[email protected]>    
date     : Fri, 10 Jan 2025 15:42:17 -0500    
  
committer: Peter Geoghegan <[email protected]>    
date     : Fri, 10 Jan 2025 15:42:17 -0500    

Click here for diff

Oversight in commit 1bd4bc85, which made nbtree backwards scans operate  
off of a copy of each page's left link as of the time of its call to  
_bt_readpage.  

M src/backend/access/nbtree/README

Use a non-locking initial test in TAS_SPIN on AArch64.

commit   : 3d0b4b1068018f624d5ef7c9f90b536ed58345b5    
  
author   : Nathan Bossart <[email protected]>    
date     : Fri, 10 Jan 2025 13:18:04 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Fri, 10 Jan 2025 13:18:04 -0600    

Click here for diff

Our testing showed that this is helpful at sufficiently high  
contention levels and doesn't hurt performance on smaller machines.  
The new TAS_SPIN macro for AArch64 is identical to the ones added  
for PPC and x86_64 (see commits bc2a050d40 and b03d196be0).  
  
Reported-by: Salvatore Dipietro  
Reviewed-by: Jingtang Zhang, Andres Freund  
Tested-by: Tom Lane  
Discussion: https://postgr.es/m/ZxgDEb_VpWyNZKB_%40nathan  

M src/include/storage/s_lock.h

commit   : 28e7a9968e183a6b8dddaff5b513b0656ba349aa    
  
author   : Andres Freund <[email protected]>    
date     : Fri, 10 Jan 2025 11:08:17 -0500    
  
committer: Andres Freund <[email protected]>    
date     : Fri, 10 Jan 2025 11:08:17 -0500    

Click here for diff

The previous names weren't particularly clear. Future patches will add more  
shutdown phases, making it even more important to have understandable shutdown  
phases.  
  
Suggested-by: Heikki Linnakangas <[email protected]>  
Reviewed-by: Nazir Bilal Yavuz <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/postmaster/postmaster.c
M src/backend/replication/README

postmaster: Make btmask_add() variadic

commit   : e84712c73820839abfaa29c20cee0d3cabbf8f1c    
  
author   : Andres Freund <[email protected]>    
date     : Fri, 10 Jan 2025 11:08:17 -0500    
  
committer: Andres Freund <[email protected]>    
date     : Fri, 10 Jan 2025 11:08:17 -0500    

Click here for diff

Suggested-by: Heikki Linnakangas <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/postmaster/postmaster.c

postmaster: Introduce variadic btmask_all_except()

commit   : 7e957cbb50aa425ef10a2fd0903595ae9e256d5f    
  
author   : Andres Freund <[email protected]>    
date     : Fri, 10 Jan 2025 11:08:17 -0500    
  
committer: Andres Freund <[email protected]>    
date     : Fri, 10 Jan 2025 11:08:17 -0500    

Click here for diff

Upcoming patches would otherwise need btmask_all_except3().  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Discussion: https://postgr.es/m/w3z6w3g4aovivs735nk4pzjhmegntecesm3kktpebchegm5o53@aonnq2kn27xi  

M src/backend/postmaster/postmaster.c

postmaster: Improve logging of signals sent by postmaster

commit   : 40d4031abd0da3d84543b050e1ced2da775a3274    
  
author   : Andres Freund <[email protected]>    
date     : Fri, 10 Jan 2025 11:08:17 -0500    
  
committer: Andres Freund <[email protected]>    
date     : Fri, 10 Jan 2025 11:08:17 -0500    

Click here for diff

Previously many, in some cases important, signals we never logged. In other  
cases the signal name was only included numerically.  
  
As part of this, change the debug log level the signal is logged at to DEBUG3,  
previously some where DEBUG2, some DEBUG4.  
  
Also move from direct use of kill() to signal the av launcher to  
signal_child(). There doesn't seem to be a reason for directly using kill().  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Reviewed-by: Bertrand Drouvot <[email protected]>  
Reviewed-by: Nazir Bilal Yavuz <[email protected]>  
Discussion: https://postgr.es/m/kgng5nrvnlv335evmsuvpnh354rw7qyazl73kdysev2cr2v5zu@m3cfzxicm5kp  

M src/backend/postmaster/postmaster.c

postmaster: Update pmState via a wrapper function

commit   : 7148cbbdc65d68167967e67ed155c7f1635bc8e7    
  
author   : Andres Freund <[email protected]>    
date     : Fri, 10 Jan 2025 11:08:17 -0500    
  
committer: Andres Freund <[email protected]>    
date     : Fri, 10 Jan 2025 11:08:17 -0500    

Click here for diff

This makes logging of state changes easier - state transitions are now logged  
at DEBUG1. Without that logging it was surprisingly hard to understand the  
current state of the system while debugging.  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Reviewed-by: Bertrand Drouvot <[email protected]>  
Reviewed-by: Nazir Bilal Yavuz <[email protected]>  
Discussion: https://postgr.es/m/kgng5nrvnlv335evmsuvpnh354rw7qyazl73kdysev2cr2v5zu@m3cfzxicm5kp  

M src/backend/postmaster/postmaster.c

Adjust signature of cluster_rel() and its subroutines

commit   : cc811f92bac5c80253c8a22e43409722cab4c05b    
  
author   : Álvaro Herrera <[email protected]>    
date     : Fri, 10 Jan 2025 13:09:38 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Fri, 10 Jan 2025 13:09:38 +0100    

Click here for diff

cluster_rel() receives the OID of the relation to process, which it  
opens and locks; but then its subroutine copy_table_data() also receives  
the relation OID and opens it by itself.  This is a bit wasteful.  It's  
better to have cluster_rel() receive the relation already open, and pass  
it down to its subroutines as necessary; then cluster_rel closes the rel  
before returning.  This simplifies things.  
  
But a better motivation to make this change is that a future command to  
do logical-decoding-based "concurrent VACUUM FULL" will need to release  
all locks on the relation (and possibly on the clustering index) at some  
point.  Since it makes little sense to keep the relation reference  
without the lock, the cluster_rel() function will also close it (and  
the index).  With this arrangement, neither the function nor its  
subroutines need open extra references, which, again, makes things simpler.  
  
Author: Antonin Houska <[email protected]>  
Discussion: https://postgr.es/m/82651.1720540558@antos  

M src/backend/commands/cluster.c
M src/backend/commands/matview.c
M src/backend/commands/vacuum.c
M src/include/commands/cluster.h

Fix UNION planner datatype issue

commit   : 23100645104f63bf7c35304f36f8a7d91f5ddd73    
  
author   : David Rowley <[email protected]>    
date     : Fri, 10 Jan 2025 14:30:25 +1300    
  
committer: David Rowley <[email protected]>    
date     : Fri, 10 Jan 2025 14:30:25 +1300    

Click here for diff

66c0185a3 gave the planner the ability to have union child queries  
provide the union planner with pre-sorted input so that UNION queries  
could be more efficiently implemented using Merge Append.  
  
That commit overlooked checking that the UNION target list and the union  
child target list's types all match.  In some corner cases, this could  
result in the planner producing sorts using the sort operator of the  
top-level UNION's target list type rather than of the union child's  
target list's type.  The implications of this range from silently  
working correctly, despite using the wrong sort operator all the way up  
to a segmentation fault.  
  
Here we fix by adjusting the planner so it makes no attempt to have the  
subquery produce pre-sorted results when the data type of the UNION  
target list and the types from the subquery target list don't match  
exactly.  
  
Backpatch to 17, where 66c0185a3 was introduced.  
  
Reported-by: Jason Smith <[email protected]>  
Diagnosed-by: Tom Lane <[email protected]>  
Bug: 18764  
Discussion: https://postgr.es/m/18764-63ad667ea26e877a%40postgresql.org  
Backpatch-through: 17  

M src/backend/optimizer/plan/planner.c

Merge pgstat_count_io_op_n() and pgstat_count_io_op()

commit   : f0bf7857befefa3ff00c7d2ac5c611c525f5cd3e    
  
author   : Michael Paquier <[email protected]>    
date     : Fri, 10 Jan 2025 09:57:27 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Fri, 10 Jan 2025 09:57:27 +0900    

Click here for diff

The pgstat_count_io_op() function, which counts a single I/O operation,  
wraps pgstat_count_io_op_n() with a counter value of 1.  The latter is  
declared in pgstat.h and used nowhere in the code, so let's remove it in  
favor of the former.  
  
This change makes also the code more symmetric with  
pgstat_count_io_op_time(), that already uses a similar set of arguments,  
except that it counts also the I/O time.  This will ease a bit the  
integration of a follow-up patch that adds byte-level tracking in  
pg_stat_io for some of its attributes, lifting the current restriction  
based on BLCKSZ as all I/O operations are assumed to be block-based.  
  
Author: Nazir Bilal Yavuz  
Reviewed-by: Bertrand Drouvot  
Discussion: https://postgr.es/m/CAN55FZ32ze812=yjyZg1QeXhKvACUM_Nu0_gyPQcUKKuVHL5xA@mail.gmail.com  

M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/buffer/localbuf.c
M src/backend/utils/activity/pgstat_io.c
M src/include/pgstat.h

commit   : 2c14037bb57c091b9f0bcbd36fa62138601beb55    
  
author   : Michael Paquier <[email protected]>    
date     : Fri, 10 Jan 2025 09:00:48 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Fri, 10 Jan 2025 09:00:48 +0900    

Click here for diff

This commit changes the way pending backend statistics are tracked by  
moving them into a new structure called PgStat_BackendPending, removing  
PgStat_BackendPendingIO.  PgStat_BackendPending currently only includes  
PgStat_PendingIO for the pending I/O stats.  
  
pgstat_flush_backend() is extended with a "flags" argument to control  
which parts of the stats of a backend should be flushed.  
  
With this refactoring, it becomes easier to plug into backend statistics  
more data.  A patch to add information related to WAL in this stats kind  
is under discussion.  
  
Author: Bertrand Drouvot  
Discussion: https://postgr.es/m/Z3zqc4o09dM/[email protected]  

M src/backend/utils/activity/pgstat.c
M src/backend/utils/activity/pgstat_backend.c
M src/backend/utils/activity/pgstat_io.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
M src/tools/pgindent/typedefs.list

Fix an ALTER GROUP ... DROP USER error message.

commit   : 39e3bcae44868734504c3decbb6708c36a5a84b2    
  
author   : Nathan Bossart <[email protected]>    
date     : Thu, 9 Jan 2025 17:10:13 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Thu, 9 Jan 2025 17:10:13 -0600    

Click here for diff

This error message stated the privileges required to add a member  
to a group even if the user was trying to drop a member:  
  
	postgres=> alter group a drop user b;  
	ERROR:  permission denied to alter role  
	DETAIL:  Only roles with the ADMIN option on role "a" may add members.  
  
Since the required privileges for both operations are the same, we  
can fix this by modifying the message to mention both adding and  
dropping members:  
  
	postgres=> alter group a drop user b;  
	ERROR:  permission denied to alter role  
	DETAIL:  Only roles with the ADMIN option on role "a" may add or drop members.  
  
Author: ChangAo Chen  
Reviewed-by: Tom Lane  
Discussion: https://postgr.es/m/tencent_FAA0D00E3514AAF0BBB6322542A6094FEF05%40qq.com  
Backpatch-through: 16  

M src/backend/commands/user.c
M src/test/regress/expected/privileges.out
M src/test/regress/sql/privileges.sql

Use @extschema:name@ notation in contrib transform modules.

commit   : bebe9040388bb2292585eab712fe4d29a71843fb    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 9 Jan 2025 15:16:56 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 9 Jan 2025 15:16:56 -0500    

Click here for diff

Harden hstore_plperl, hstore_plpython, and ltree_plpython  
against search-path-based attacks by using @extschema:name@  
notation to refer to the underlying hstore or ltree data type.  
  
This allows removal of the previous documentation warning  
suggesting that they must be installed in the same schema as  
the underlying data type.  In passing, also improve a para in  
extend.sgml to suggest using @extschema:name@ for such purposes.  
  
Discussion: https://postgr.es/m/[email protected]  

M contrib/hstore_plperl/hstore_plperl–1.0.sql
M contrib/hstore_plperl/hstore_plperlu–1.0.sql
M contrib/hstore_plpython/hstore_plpython3u–1.0.sql
M contrib/ltree_plpython/ltree_plpython3u–1.0.sql
M doc/src/sgml/extend.sgml
M doc/src/sgml/hstore.sgml
M doc/src/sgml/ltree.sgml

Simplify signature of RewriteTable

commit   : ebd8fc7e47fdad6adb68aad341d95c541d7325c3    
  
author   : Álvaro Herrera <[email protected]>    
date     : Thu, 9 Jan 2025 14:17:12 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Thu, 9 Jan 2025 14:17:12 +0100    

Click here for diff

This function doesn't need the lockmode to be passed: it was being used  
to lock the new heap, but that's bogus, because the only caller has  
already obtained the appropriate lock on the new heap (which is  
unimportant anyway, because the relation's creation is not yet committed  
and so no other session can see it).  
  
Noticed while reviewed Antonin Houska's patch to add VACUUM FULL  
CONCURRENTLY.  

M src/backend/commands/tablecmds.c

doc: Clarify synchronous_standby_names parameter.

commit   : 6313a76b355e3640aba4cc80456a65c2bbc55a80    
  
author   : Fujii Masao <[email protected]>    
date     : Thu, 9 Jan 2025 21:04:49 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Thu, 9 Jan 2025 21:04:49 +0900    

Click here for diff

The synchronous_standby_names GUC allows specifying num_sync,  
the number of synchronous standbys transactions must wait for  
replies from. This value must be an integer greater than zero.  
This commit updates the documentation to clarify this requirement.  
  
Reported-by: Asphator <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/config.sgml

Fix SLRU bank selection code

commit   : 69ab44651422c49a6256d1b6cca6c20b5060ad92    
  
author   : Álvaro Herrera <[email protected]>    
date     : Thu, 9 Jan 2025 07:33:52 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Thu, 9 Jan 2025 07:33:52 +0100    

Click here for diff

The originally submitted code (using bit masking) was correct when the  
number of slots was restricted to be a power of two -- but that  
limitation was removed during development that led to commit  
53c2a97a9266, which made the bank selection code incorrect.  This led to  
always using a smaller number of banks than available.  Change said code  
to use integer modulo instead, which works correctly with an arbitrary  
number of banks.  
  
It's likely that we could improve on this to avoid runtime use of  
integer division.  But with this change we're, at least, not wasting  
memory on unused banks, and more banks mean less contention, which is  
likely to have a much higher performance impact than a single  
instruction's latency.  
  
Author: Yura Sokolov <[email protected]>  
Reviewed-by: Andrey Borodin <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/access/transam/slru.c
M src/include/access/slru.h

Fix off_t overflow in pg_basebackup on Windows.

commit   : 970b97eeb8f036e534abe183fd41604671f7674d    
  
author   : Thomas Munro <[email protected]>    
date     : Thu, 9 Jan 2025 13:17:36 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Thu, 9 Jan 2025 13:17:36 +1300    

Click here for diff

walmethods.c used off_t to navigate around a pg_wal.tar file that could  
exceed 2GB, which doesn't work on Windows and would fail with misleading  
errors.  Use pgoff_t instead.  
  
Back-patch to all supported branches.  
  
Author: Davinder Singh <[email protected]>  
Reported-by: Jakub Wartak <[email protected]>  
Discussion: https://postgr.es/m/CAKZiRmyM4YnokK6Oenw5JKwAQ3rhP0YTz2T-tiw5dAQjGRXE3Q%40mail.gmail.com  

M src/bin/pg_basebackup/receivelog.c
M src/bin/pg_basebackup/walmethods.c
M src/bin/pg_basebackup/walmethods.h

Provide 64-bit ftruncate() and lseek() on Windows.

commit   : 026762dae39d6efcbfa99a18a15fdfeecbd5b9cc    
  
author   : Thomas Munro <[email protected]>    
date     : Thu, 9 Jan 2025 12:10:26 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Thu, 9 Jan 2025 12:10:26 +1300    

Click here for diff

Change our ftruncate() macro to use the 64-bit variant of chsize(), and  
add a new macro to redirect lseek() to _lseeki64().  
  
Back-patch to all supported releases, in preparation for a bug fix.  
  
Tested-by: Davinder Singh <[email protected]>  
Discussion: https://postgr.es/m/CAKZiRmyM4YnokK6Oenw5JKwAQ3rhP0YTz2T-tiw5dAQjGRXE3Q%40mail.gmail.com  

M src/include/port.h
M src/include/port/win32_port.h
M src/pl/plperl/plperl_system.h

Fix duplicate typedef from commit a2f17f004d.

commit   : 229e7793d96954739d3fb9b37e2ccf77c2803f07    
  
author   : Jeff Davis <[email protected]>    
date     : Wed, 8 Jan 2025 15:25:05 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Wed, 8 Jan 2025 15:25:05 -0800    

Click here for diff

Reported-by: Thomas Munro  

M src/include/utils/pg_locale.h

Control collation behavior with a method table.

commit   : a2f17f004d229f69a32cfa80904b95edcbc68f95    
  
author   : Jeff Davis <[email protected]>    
date     : Wed, 8 Jan 2025 14:26:33 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Wed, 8 Jan 2025 14:26:33 -0800    

Click here for diff

Previously, behavior branched based on the provider. A method table is  
less error-prone and more flexible.  
  
The ctype behavior will be addressed in an upcoming commit.  
  
Reviewed-by: Andreas Karlsson  
Discussion: https://postgr.es/m/2830211e1b6e6a2e26d845780b03e125281ea17b.camel%40j-davis.com  

M src/backend/utils/adt/pg_locale.c
M src/backend/utils/adt/pg_locale_icu.c
M src/backend/utils/adt/pg_locale_libc.c
M src/include/utils/pg_locale.h

Move code for collation version into provider-specific files.

commit   : 4f5cef2607c1f8804d4b54250642aaf586745b0e    
  
author   : Jeff Davis <[email protected]>    
date     : Wed, 8 Jan 2025 13:54:07 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Wed, 8 Jan 2025 13:54:07 -0800    

Click here for diff

Author: Andreas Karlsson  
Discussion: https://postgr.es/m/4548a168-62cd-457b-8d06-9ba7b985c477%40proxel.se  

M src/backend/utils/adt/pg_locale.c
M src/backend/utils/adt/pg_locale_builtin.c
M src/backend/utils/adt/pg_locale_icu.c
M src/backend/utils/adt/pg_locale_libc.c

Disallow NAMEDTUPLESTORE RTEs in stored views, rules, etc.

commit   : 3c49d462dbcfaff7bb77b1fec2c73c1079d25433    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 8 Jan 2025 16:35:54 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 8 Jan 2025 16:35:54 -0500    

Click here for diff

A named tuplestore is necessarily a transient object, so it makes  
no sense to reference one in a persistent object such as a view.  
We didn't previously prevent that, with the result that if you  
tried you would get some weird failure about how the executor  
couldn't find the tuplestore.  
  
We can mechanize a check for this case cheaply by making dependency  
extraction complain if it comes across such an RTE.  This is a  
plausible way of dealing with it since part of the problem is that we  
have no way to make a pg_depend representation of a named tuplestore.  
  
Report and fix by Yugo Nagata.  Although this is an old problem,  
it's a very weird corner case and there have been no reports from  
end users.  So it seems sufficient to fix it in master.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/catalog/dependency.c
M src/test/regress/expected/triggers.out
M src/test/regress/sql/triggers.sql

Set exit status for pgindent if pg_bsd_indent fails

commit   : b20fe54c9c2194fec65db73b2778a014e7823ae0    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 8 Jan 2025 10:56:12 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 8 Jan 2025 10:56:12 -0500    

Click here for diff

Also document the exit codes in the script.  
  
The new exit code is 3, and is not overridden by the exit code set in  
--check mode.  
  
Author: Ashutosh Bapat  
  
Discussion: https://postgr.es/m/CAExHW5sPRSiFeLdP-u1Fa5ba7YS2f0gvLjmKOobopKadJwQ_GQ@mail.gmail.com  

M src/tools/pgindent/pgindent

plpgsql: pure parser and reentrant scanner

commit   : 7b27f5fd36cb3270e8ac25aefd73b552663d1392    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 8 Jan 2025 09:20:01 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 8 Jan 2025 09:20:01 +0100    

Click here for diff

The plpgsql scanner is a wrapper around the core scanner, which  
already uses the flex %option reentrant.  This patch only pushes up a  
few levels the place where the scanner handle is allocated.  Before,  
it was allocated in pl_scanner.c in a global variable, so to the  
outside the scanner was not reentrant.  Now, it is allocated in  
pl_comp.c and is passed as an argument to yyparse(), similar to how it  
is handled in other reentrant scanners.  
  
Also use flex yyextra to handle context information, instead of global  
variables.  Again, this uses the existing yyextra support in the core  
scanner.  This complements the other changes to make the scanner  
reentrant.  
  
The bison option %pure-parser is used to make the generated parser  
pure.  This happens in the usual way, since plpgsql has its own bison  
parser definition.  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M src/pl/plpgsql/src/nls.mk
M src/pl/plpgsql/src/pl_comp.c
M src/pl/plpgsql/src/pl_gram.y
M src/pl/plpgsql/src/pl_scanner.c
M src/pl/plpgsql/src/plpgsql.h

Remove useless function declaration

commit   : b18464fad4af6ab3e115fd0e377ac7dce706a81e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 8 Jan 2025 08:21:05 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 8 Jan 2025 08:21:05 +0100    

Click here for diff

This function apparently never existed.  

M src/pl/plpgsql/src/plpgsql.h

pg_freespacemap: Fix declaration of pg_freespace(regclass)

commit   : e0c3d5122e6a4114af3092b7938c9b43d619e62c    
  
author   : Michael Paquier <[email protected]>    
date     : Wed, 8 Jan 2025 13:16:43 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Wed, 8 Jan 2025 13:16:43 +0900    

Click here for diff

This function called generate_series() without enforcing its input  
argument types, making possible for an attacker to catch this call, by  
defining for example a generate_series(int,bigint).  
  
The internals of pg_freespace(regclass) are changed to force the use of  
bigint for the inputs of generate_series().  A more consistent style is  
applied for all its hardcoded values, while on it.  
  
Issue introduced in 3f323eba89fb.  
  
Reported-by: Noah Misch  
Reviewed-by: Noah Misch  
Discussion: https://postgr.es/m/[email protected]  

M contrib/pg_freespacemap/pg_freespacemap–1.2–1.3.sql

ExecInitAgg: update aggstate->numaggs and ->numtrans earlier.

commit   : 3f482940dbcbd15834a67894f4d9efdf5ceb7e16    
  
author   : Jeff Davis <[email protected]>    
date     : Tue, 7 Jan 2025 15:13:50 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Tue, 7 Jan 2025 15:13:50 -0800    

Click here for diff

Functions hash_agg_entry_size() and build_hash_tables() make use of  
those values for memory size estimates.  
  
Because this change only affects memory estimates, don't backpatch.  
  
Discussion: https://postgr.es/m/7530bd8783b1a78d53a3c70383e38d8da0a5ffe5.camel%40j-davis.com  

M src/backend/executor/nodeAgg.c

nodeSetOp.c: missing additionalsize for BuildTupleHashTable().

commit   : 32ddfaffd1493b27f200afb3919d3fd2e6a200ef    
  
author   : Jeff Davis <[email protected]>    
date     : Tue, 7 Jan 2025 14:55:53 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Tue, 7 Jan 2025 14:55:53 -0800    

Click here for diff

Provide additionalsize argument, which can affect the calculations for  
'nbuckets'. Also, future work for Hash Aggregation will rely on the  
correct additionalsize.  
  
Discussion: https://postgr.es/m/7530bd8783b1a78d53a3c70383e38d8da0a5ffe5.camel%40j-davis.com  

M src/backend/executor/nodeSetOp.c

Remove unused TupleHashTableData->entrysize.

commit   : 8a96faedc408b447acd1570d2f51300bcec34959    
  
author   : Jeff Davis <[email protected]>    
date     : Tue, 7 Jan 2025 14:49:18 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Tue, 7 Jan 2025 14:49:18 -0800    

Click here for diff

Discussion: https://postgr.es/m/7530bd8783b1a78d53a3c70383e38d8da0a5ffe5.camel%40j-davis.com  

M src/backend/executor/execGrouping.c
M src/include/nodes/execnodes.h

Add missing typedefs.list entry for AggStatePerGroupData.

commit   : 834c9e807cf12e355f06479a8b1f7a82aba77315    
  
author   : Jeff Davis <[email protected]>    
date     : Tue, 7 Jan 2025 14:32:37 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Tue, 7 Jan 2025 14:32:37 -0800    

Click here for diff

Discussion: https://postgr.es/m/7530bd8783b1a78d53a3c70383e38d8da0a5ffe5.camel%40j-davis.com  

M src/include/executor/nodeAgg.h
M src/tools/pgindent/typedefs.list

Use PqMsg_* macros in postgres.c.

commit   : 4a68d5008869afd819b03075d69bf102dd2f1bda    
  
author   : Nathan Bossart <[email protected]>    
date     : Tue, 7 Jan 2025 15:34:19 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Tue, 7 Jan 2025 15:34:19 -0600    

Click here for diff

Commit f4b54e1ed9, which introduced macros for protocol characters,  
missed updating a couple of places in postgres.c.  
  
Author: Dave Cramer  
Reviewed-by: Fabrízio de Royes Mello  
Discussion: https://postgr.es/m/CADK3HHJUVBPoVOmFesPB-fN8_dYt%2BQELV2UB6jxOW2Z40qF-qw%40mail.gmail.com  
Backpatch-through: 17  

M src/backend/tcop/postgres.c

Add passwordcheck.min_password_length.

commit   : f7e1b3828a930639aefb5746a214cb5ddf734361    
  
author   : Nathan Bossart <[email protected]>    
date     : Tue, 7 Jan 2025 15:06:40 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Tue, 7 Jan 2025 15:06:40 -0600    

Click here for diff

This new parameter can be used to change the minimum allowed  
password length (in bytes).  Note that it has no effect if a user  
supplies a pre-encrypted password.  
  
Author: Emanuele Musella, Maurizio Boriani  
Reviewed-by: Tomas Vondra, Bertrand Drouvot, Japin Li  
Discussion: https://postgr.es/m/CA%2BugDNyYtHOtWCqVD3YkSVYDWD_1fO8Jm_ahsDGA5dXhbDPwrQ%40mail.gmail.com  

M contrib/passwordcheck/expected/passwordcheck.out
M contrib/passwordcheck/expected/passwordcheck_1.out
M contrib/passwordcheck/passwordcheck.c
M contrib/passwordcheck/sql/passwordcheck.sql
M doc/src/sgml/passwordcheck.sgml

Lower default value of autovacuum_worker_slots in initdb as needed.

commit   : 6d01541960e2a42c92ef67be9a1c4842cd4458d6    
  
author   : Nathan Bossart <[email protected]>    
date     : Tue, 7 Jan 2025 14:38:55 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Tue, 7 Jan 2025 14:38:55 -0600    

Click here for diff

Commit c758119e5b increased the default number of semaphores  
required for autovacuum workers from 3 to 16.  Unfortunately, some  
systems have very low default settings for SEMMNS, and this change  
moved the minimum required for Postgres well beyond that limit (see  
commit 38da053463 for more details).  
  
With this commit, initdb will lower the default value for  
autovacuum_worker_slots as needed, just like it already does for  
parameters such as max_connections and shared_buffers.  We test  
for (max_connections / 6) slots, which conveniently has the  
following properties:  
  
* For the initial max_connections default of 100, the default of  
  autovacuum_worker_slots will be 16, which is its initial default  
  value specified in the documentation and in guc_tables.c.  
  
* For the lowest possible max_connections default of 25, the  
  default of autovacuum_worker_slots will be 4, which means we only  
  need one additional semaphore for autovacuum workers (as compared  
  to before commit c758119e5b).  This leaves some wiggle room for  
  new auxiliary workers, etc. on systems with low SEMMNS, and it  
  ensures that the default number of slots will be greater than or  
  equal to the default value of autovacuum_max_workers (3).  
  
Reported-by: Tom Lane  
Suggested-by: Andres Freund  
Reviewed-by: Tom Lane  
Discussion: https://postgr.es/m/1346002.1736198977%40sss.pgh.pa.us  

M doc/src/sgml/config.sgml
M src/bin/initdb/initdb.c

Fix error message wording

commit   : 0e5b14410e2bb54d191bbb7bb21a674ccabe768e    
  
author   : Álvaro Herrera <[email protected]>    
date     : Tue, 7 Jan 2025 20:07:32 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Tue, 7 Jan 2025 20:07:32 +0100    

Click here for diff

The originals are ambiguous and a bit out of style.  
  
Reviewed-by: Amit Langote <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/parser/parse_expr.c
M src/interfaces/ecpg/test/expected/sql-sqljson.stderr
M src/test/regress/expected/sqljson.out

Fix meson detection of a couple of 64 bit builtins.

commit   : c4782c44101ef9e50daa9e1d69821d98f58057fd    
  
author   : Thomas Munro <[email protected]>    
date     : Wed, 8 Jan 2025 07:15:28 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Wed, 8 Jan 2025 07:15:28 +1300    

Click here for diff

A couple of checks were missed by commit 962da900, so we would fail to  
detect the features.  
  
Reported-by: Юрий Соколов <[email protected]>  
Discussion: https://postgr.es/m/42C25E2A-6519-4549-9F47-6B0686E83836%40postgrespro.ru  

M meson.build

Remove unnecessary code to handle CONSTR_NOTNULL

commit   : 5b291d1c9c09d75982c3270bfa61d4e822087b6a    
  
author   : Álvaro Herrera <[email protected]>    
date     : Tue, 7 Jan 2025 16:49:41 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Tue, 7 Jan 2025 16:49:41 +0100    

Click here for diff

Commit 14e87ffa5c54 needlessly added support for CONSTR_NOTNULL entries  
to StoreConstraints.  It's dead code, so remove it.  
  
To make the situation regarding constraint creation clearer, change  
comments in heap_create_with_catalog, StoreConstraints, MergeAttributes  
to explain which types of constraint are used on each.  
  
Author: 何建 (Jian He) <[email protected]>  
Discussion: https://postgr.es/m/CACJufxFxzqrCiUNfjJ0tQU+=nKQkQCGtGzUBude=SMOwj5VNjQ@mail.gmail.com  

M src/backend/catalog/heap.c
M src/backend/commands/tablecmds.c

Improve nbtree unsatisfiable RowCompare detection.

commit   : ec986020decff322723cf7b3a2696803d082ad17    
  
author   : Peter Geoghegan <[email protected]>    
date     : Tue, 7 Jan 2025 10:38:30 -0500    
  
committer: Peter Geoghegan <[email protected]>    
date     : Tue, 7 Jan 2025 10:38:30 -0500    

Click here for diff

Move nbtree's detection of RowCompare quals that are unsatisfiable due  
to having a NULL in their first row element: rather than detecting these  
cases at the point where _bt_first builds its insertion scan key, do so  
earlier, during preprocessing proper.  This brings the RowCompare case  
in line every other case involving an unsatisfiable-due-to-NULL qual.  
  
nbtree now consistently detects such unsatisfiable quals -- even when  
they happen to involve a key that isn't examined by _bt_first at all.  
Affected cases thereby avoid useless full index scans that cannot  
possibly return any matching rows.  
  
Author: Peter Geoghegan <[email protected]>  
Reviewed-By: Matthias van de Meent <[email protected]>  
Discussion: https://postgr.es/m/CAH2-WzmySVXst2hFrOATC-zw1Byg1XC-jYUS314=mzuqsNwk+Q@mail.gmail.com  

M src/backend/access/nbtree/nbtsearch.c
M src/backend/access/nbtree/nbtutils.c
M src/test/regress/expected/btree_index.out
M src/test/regress/expected/create_index.out
M src/test/regress/sql/btree_index.sql
M src/test/regress/sql/create_index.sql

nbtree: Simplify _bt_first parallel scan handling.

commit   : 428a99b58960a2772c3a29235eb694054f666a28    
  
author   : Peter Geoghegan <[email protected]>    
date     : Tue, 7 Jan 2025 10:29:46 -0500    
  
committer: Peter Geoghegan <[email protected]>    
date     : Tue, 7 Jan 2025 10:29:46 -0500    

Click here for diff

This new structure relieves _bt_first from having separate calls to  
_bt_start_array_keys for the serial case and parallel case.  This saves  
code, and seems clearer.  
  
Follow-up to work from commits 4e6e375b and b5ee4e52.  
  
Author: Peter Geoghegan <[email protected]>  
Reviewed-By: Matthias van de Meent <[email protected]>  
Discussion: https://postgr.es/m/CAH2-Wz=XjUZjBjHJdhTvuH5MwoJObWGoM2RG2LyFg5WUdWyk=A@mail.gmail.com  

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

Remove unused parameter in lookup_var_attr_stats

commit   : 2f8b4007dbbac5aa9605414974c802e415176df4    
  
author   : Richard Guo <[email protected]>    
date     : Tue, 7 Jan 2025 11:24:14 +0900    
  
committer: Richard Guo <[email protected]>    
date     : Tue, 7 Jan 2025 11:24:14 +0900    

Click here for diff

The parameter 'rel' in lookup_var_attr_stats was once used to draw an  
ERROR when ANALYZE failed to acquire sufficient data to build extended  
statistics.  bf2a691e0 changed the logic to raise a WARNING in the  
caller instead.  As a result, this parameter is no longer needed and  
can be removed.  Since this is a static function, we can always easily  
reintroduce the parameter if it's ever needed in the future.  
  
Author: Ilia Evdokimov  
Reviewed-by: Fabrízio de Royes Mello  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/statistics/extended_stats.c

Allow changing autovacuum_max_workers without restarting.

commit   : c758119e5bfb47b38cf957f9a5a37ceae96fa9b3    
  
author   : Nathan Bossart <[email protected]>    
date     : Mon, 6 Jan 2025 15:01:22 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Mon, 6 Jan 2025 15:01:22 -0600    

Click here for diff

This commit introduces a new parameter named  
autovacuum_worker_slots that controls how many autovacuum worker  
slots to reserve during server startup.  Modifying this new  
parameter's value does require a server restart, but it should  
typically be set to the upper bound of what you might realistically  
need to set autovacuum_max_workers.  With that new parameter in  
place, autovacuum_max_workers can now be changed with a SIGHUP  
(e.g., pg_ctl reload).  
  
If autovacuum_max_workers is set higher than  
autovacuum_worker_slots, a WARNING is emitted, and the server will  
only start up to autovacuum_worker_slots workers at a given time.  
If autovacuum_max_workers is set to a value less than the number of  
currently-running autovacuum workers, the existing workers will  
continue running, but no new workers will be started until the  
number of running autovacuum workers drops below  
autovacuum_max_workers.  
  
Reviewed-by: Sami Imseih, Justin Pryzby, Robert Haas, Andres Freund, Yogesh Sharma  
Discussion: https://postgr.es/m/20240410212344.GA1824549%40nathanxps13  

M doc/src/sgml/config.sgml
M doc/src/sgml/runtime.sgml
M src/backend/access/transam/xlog.c
M src/backend/postmaster/autovacuum.c
M src/backend/postmaster/pmchild.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/postmaster/autovacuum.h
M src/test/perl/PostgreSQL/Test/Cluster.pm

Remove duplicate definitions in proc.h

commit   : 5e68f6119268d8c76b860bb56014335697c687db    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 6 Jan 2025 11:56:03 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 6 Jan 2025 11:56:03 +0200    

Click here for diff

These are also present in procnumber.h  
  
Reported-by: Peter Eisentraut  
Discussion: https://www.postgresql.org/message-id/[email protected]  

M src/include/storage/proc.h

flex code modernization: Replace YY_EXTRA_TYPE define with flex option

commit   : b1ef48980ddd082a90ed39aa5914af45e53059e6    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 6 Jan 2025 09:47:58 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 6 Jan 2025 09:47:58 +0100    

Click here for diff

Replace #define YY_EXTRA_TYPE with %option extra-type.  The latter is  
the way recommended by the flex manual (available since flex 2.5.34).  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M src/backend/parser/scan.l
M src/backend/replication/repl_scanner.l
M src/backend/replication/syncrep_scanner.l
M src/backend/utils/adt/jsonpath_scan.l
M src/bin/psql/psqlscanslash.l
M src/fe_utils/psqlscan.l

doc: Clarify log level for VERBOSE messages in maintenance commands.

commit   : 632384d0eb142f243fdd6059fde715319cfd05c9    
  
author   : Fujii Masao <[email protected]>    
date     : Mon, 6 Jan 2025 17:24:10 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Mon, 6 Jan 2025 17:24:10 +0900    

Click here for diff

VERBOSE messages from ANALYZE, CLUSTER, REINDEX, and VACUUM are logged  
at the INFO level, but this detail was missing from the documentation.  
This commit updates the docs to mention the log level for these messages.  
  
Author: Masahiro Ikeda  
Reviewed-by: Yugo Nagata  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/ref/analyze.sgml
M doc/src/sgml/ref/cluster.sgml
M doc/src/sgml/ref/reindex.sgml
M doc/src/sgml/ref/vacuum.sgml

Always use the caller-provided context for radix tree leaves

commit   : 3e70da2781e86d07cd88f568ebeb38ddf7da8e8e    
  
author   : John Naylor <[email protected]>    
date     : Fri, 20 Dec 2024 14:48:24 +0700    
  
committer: John Naylor <[email protected]>    
date     : Fri, 20 Dec 2024 14:48:24 +0700    

Click here for diff

Previously, it would not have worked for a caller to pass a slab  
context, since it would have been used for other things which likely  
had incompatible size. In an attempt to be helpful and avoid possible  
space wastage due to aset's power-of-two rounding, RT_CREATE would  
create an additional slab context if the value type was fixed-length  
and larger than pointer size. The problem was, we have since added  
the bump context type, and the generation context was a possibility as  
well, so silently overriding the caller's choice may actually be worse.  
  
Commit e8a6f1f908d arranged so that the caller-provided context is  
used only for leaves, so it's safe for the caller to use slab here  
if they wish. As demonstration, use slab in one of the radix tree  
regression tests.  
  
Reviewed by Masahiko Sawada  
  
Discussion: https://postgr.es/m/CANWCAZZDCo4k5oURg_pPxM6+WZ1oiG=sqgjmQiELuyP0Vtrwig@mail.gmail.com  

M src/include/lib/radixtree.h
M src/test/modules/test_radixtree/test_radixtree.c

Get rid of radix tree's general purpose memory context

commit   : e8a6f1f908d03b836c8b5379b449346ad32c1ba1    
  
author   : John Naylor <[email protected]>    
date     : Fri, 20 Dec 2024 13:04:18 +0700    
  
committer: John Naylor <[email protected]>    
date     : Fri, 20 Dec 2024 13:04:18 +0700    

Click here for diff

Previously, this was notionally used only for the entry point of the  
tree and as a convenient parent for other contexts.  
  
For shared memory, the creator previously allocated the entry point  
in this context, but attaching backends didn't have access to that,  
so they just used the caller's context. For the sake of consistency,  
allocate every instance of an entry point in the caller's context.  
  
For local memory, allocate the control object in the caller's context  
as well. This commit also makes the "leaf context" the notional parent  
of the child contexts used for nodes, so it's a bit of a misnomer,  
but a future commit will make the node contexts independent rather  
than children, so leave it this way for now to avoid code churn.  
  
The memory context parameter for RT_CREATE is now unused in the case  
of shared memory, so remove it and adjust callers to match.  
  
In passing, remove unused "context" member from struct TidStore,  
which seems to have been an oversight.  
  
Reviewed by Masahiko Sawada  
  
Discussion: https://postgr.es/m/CANWCAZZDCo4k5oURg_pPxM6+WZ1oiG=sqgjmQiELuyP0Vtrwig@mail.gmail.com  

M src/backend/access/common/tidstore.c
M src/include/lib/radixtree.h
M src/test/modules/test_radixtree/test_radixtree.c

Use caller's memory context for radix tree iteration state

commit   : 960013f2a1f9e51aad85c91aceeb442508be6032    
  
author   : John Naylor <[email protected]>    
date     : Sat, 21 Dec 2024 10:55:31 +0700    
  
committer: John Naylor <[email protected]>    
date     : Sat, 21 Dec 2024 10:55:31 +0700    

Click here for diff

Typically only one iterator is present at any time, so it's overkill  
to devote an entire context for this. Get rid of it and use the  
caller's context.  
  
This is tidy-up work, so no backpatch in this form. However, a  
hypothetical extension to v17 that tried to start iteration from  
an attaching backend would result in a crash, so that'll be fixed  
separately in a way that doesn't change behavior in core.  
  
Patch by me, reported and reviewed by Masahiko Sawada  
  
Discussion: https://postgr.es/m/CAD21AoBB2U47V=F+wQRB1bERov_of5=BOZGaybjaV8FLQyqG3Q@mail.gmail.com  

M src/include/lib/radixtree.h

Remove useless configure check

commit   : 9a8313dabe5ebb6a99d9a165d3c9bc3fa0213088    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 5 Jan 2025 11:30:48 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 5 Jan 2025 11:30:48 +0100    

Click here for diff

The test for "decltype" as a variant of "typeof" apparently never  
worked (see also commit 3582b223d49), so remove it.  
  
Discussion: https://www.postgresql.org/message-id/flat/795b1c54-c64a-47f9-8fa3-880dcab59975%40eisentraut.org  

M config/c-compiler.m4
M configure
M meson.build

meson: Fix missing name arguments of cc.compiles() calls

commit   : 6549a02a51e88960cccb938999a43203e335d0cc    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sun, 5 Jan 2025 11:30:48 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sun, 5 Jan 2025 11:30:48 +0100    

Click here for diff

Without it, the check won't show up in the meson setup/configure  
output.  
  
Discussion: https://www.postgresql.org/message-id/flat/795b1c54-c64a-47f9-8fa3-880dcab59975%40eisentraut.org  

M meson.build

Document strange jsonb sort order for empty top level arrays

commit   : 30f017626308a06cf0c0c82a706a1ba1b07df34a    
  
author   : Andrew Dunstan <[email protected]>    
date     : Fri, 3 Jan 2025 09:23:46 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Fri, 3 Jan 2025 09:23:46 -0500    

Click here for diff

Slightly faulty logic in the original jsonb code (commit d9134d0a355)  
results in an empty top level array sorting less than a json null. We  
can't change the sort order now since it would affect btree indexes over  
jsonb, so document the anomaly.  
  
Backpatch to all live branches (13 .. 17)  
  
In master, also add a code comment noting the anomaly.  
  
Reported-by: Yan Chengpen  
Reviewed-by: Jian He  
  
Discussion: https://postgr.es/m/OSBPR01MB45199DD8DA2D1CECD50518188E272@OSBPR01MB4519.jpnprd01.prod.outlook.com  

M doc/src/sgml/json.sgml
M src/backend/utils/adt/jsonb_util.c

Ignore nullingrels when looking up statistics

commit   : e28033fe1af8037e0fec8bb3a32fabbe18ac06b1    
  
author   : Richard Guo <[email protected]>    
date     : Thu, 2 Jan 2025 17:56:59 +0900    
  
committer: Richard Guo <[email protected]>    
date     : Thu, 2 Jan 2025 17:56:59 +0900    

Click here for diff

When looking up statistical data about an expression, we do not need  
to concern ourselves with the outer joins that could null the  
Vars/PHVs contained in the expression.  Accounting for nullingrels in  
the expression could cause estimate_num_groups to count the same Var  
multiple times if it's marked with different nullingrels.  This is  
incorrect, and could lead to "ERROR:  corrupt MVNDistinct entry" when  
searching for multivariate n-distinct.  
  
Furthermore, the nullingrels could prevent us from matching an  
expression to expressional index columns or to the expressions in  
extended statistics, leading to inaccurate estimates.  
  
To fix, strip out all the nullingrels from the expression before we  
look up statistical data about it.  There is one ensuing plan change  
in the regression tests, but it looks reasonable and does not  
compromise its original purpose.  
  
This patch could result in plan changes, but it fixes an actual bug,  
so back-patch to v16 where the outer-join-aware-Var infrastructure was  
introduced.  
  
Author: Richard Guo  
Discussion: https://postgr.es/m/CAMbWs4-2Z4k+nFTiZe0Qbu5n8juUWenDAtMzi98bAZQtwHx0-w@mail.gmail.com  

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

Fix outdated CHUNKHDRSZ value in nodeAgg.c

commit   : d93bb8163c9cdbaa922ce6b1f3d044fc589d0fa6    
  
author   : David Rowley <[email protected]>    
date     : Thu, 2 Jan 2025 22:04:09 +1300    
  
committer: David Rowley <[email protected]>    
date     : Thu, 2 Jan 2025 22:04:09 +1300    

Click here for diff

CHUNKHDRSZ was defined as 16 bytes, which was true when that code went in,  
but since c6e0fe1f2, 8 is a more accurate value.  Here we adjust it to use  
sizeof(MemoryChunk), which is normally 8, or 16 for cassert builds.  
  
c6e0fe1f2 first appeared in v16, so this is technically wrong in v16 up  
to master, but let's apply this only to master as adjusting this does  
influence the estimated number of batches in the aggregate costing code  
and we don't want to cause plan instability in released versions.  
  
Reviewed-by: Tom Lane  
Discussion: https://postgr.es/m/CAApHDvpMpRQvsTqZo3FinXkgytwxwF8sCyZm83xDj-1s_hLe+w@mail.gmail.com  

M src/backend/executor/nodeAgg.c

Fix an assortment of spelling mistakes and typos

commit   : 11012c503759f8018d8831bc6eb1f998eba7ad25    
  
author   : David Rowley <[email protected]>    
date     : Thu, 2 Jan 2025 12:42:01 +1300    
  
committer: David Rowley <[email protected]>    
date     : Thu, 2 Jan 2025 12:42:01 +1300    

Click here for diff

Author: Alexander Lakhin <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/access/heap/heapam.c
M src/backend/access/heap/pruneheap.c
M src/backend/access/nbtree/nbtutils.c
M src/backend/access/transam/xlog.c
M src/backend/catalog/pg_constraint.c
M src/backend/catalog/pg_depend.c
M src/backend/catalog/storage.c
M src/backend/commands/explain.c
M src/backend/optimizer/path/indxpath.c
M src/backend/postmaster/postmaster.c
M src/backend/replication/logical/decode.c
M src/backend/statistics/attribute_stats.c
M src/backend/statistics/stat_utils.c
M src/backend/storage/lmgr/lock.c
M src/backend/utils/adt/cash.c
M src/bin/pg_dump/pg_dump.c
M src/bin/pg_rewind/parsexlog.c
M src/include/catalog/reformat_dat_file.pl
M src/include/commands/copyfrom_internal.h
M src/include/jit/SectionMemoryManager.h
M src/test/postmaster/t/002_start_stop.pl

commit   : 50e6eb731d98ab6d0e625a0b87fb327b172bbebd    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 1 Jan 2025 11:21:55 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 1 Jan 2025 11:21:55 -0500    

Click here for diff

Backpatch-through: 13  

M COPYRIGHT
M config/check_modules.pl
M configure
M configure.ac
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/t/004_verify_nbtree_unique.pl
M contrib/amcheck/t/005_pitr.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/daitch_mokotoff.c
M contrib/fuzzystrmatch/daitch_mokotoff_header.pl
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/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_logicalinspect/meson.build
M contrib/pg_logicalinspect/pg_logicalinspect.c
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_stat_statements/t/010_restart.pl
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_visibility/t/001_concurrent_transaction.pl
M contrib/pg_visibility/t/002_corrupt_vm.pl
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/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/generate-targets-meson.pl
M doc/src/sgml/legal.sgml
M doc/src/sgml/lobj.sgml
M doc/src/sgml/meson.build
M doc/src/sgml/targets-meson.txt
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/tidstore.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/heapam_xlog.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/rmgrdesc_utils.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/sequence/meson.build
M src/backend/access/sequence/sequence.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/archive/meson.build
M src/backend/archive/shell_archive.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_incremental.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/backup/walsummary.c
M src/backend/backup/walsummaryfuncs.c
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/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/outfuncs.c
M src/backend/nodes/params.c
M src/backend/nodes/print.c
M src/backend/nodes/queryjumblefuncs.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_jsontable.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/launch_backend.c
M src/backend/postmaster/meson.build
M src/backend/postmaster/pgarch.c
M src/backend/postmaster/pmchild.c
M src/backend/postmaster/postmaster.c
M src/backend/postmaster/startup.c
M src/backend/postmaster/syslogger.c
M src/backend/postmaster/walsummarizer.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/applyparallelworker.c
M src/backend/replication/logical/conflict.c
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/slotsync.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_create.pl
M src/backend/snowball/snowball_func.sql.in
M src/backend/statistics/attribute_stats.c
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/statistics/relation_stats.c
M src/backend/statistics/stat_utils.c
M src/backend/storage/aio/meson.build
M src/backend/storage/aio/read_stream.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/dsm_registry.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/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/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/bulk_write.c
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/backend_startup.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_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/generate-wait_event_types.pl
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_backend.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_io.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/activity/wait_event_funcs.c
M src/backend/utils/activity/wait_event_names.txt
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_locale_builtin.c
M src/backend/utils/adt/pg_locale_icu.c
M src/backend/utils/adt/pg_locale_libc.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/pseudorandomfuncs.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/waitfuncs.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/init/usercontext.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/injection_point.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/rls.c
M src/backend/utils/misc/sampling.c
M src/backend/utils/misc/stack_depth.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/bump.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/astreamer_inject.c
M src/bin/pg_basebackup/astreamer_inject.h
M src/bin/pg_basebackup/meson.build
M src/bin/pg_basebackup/pg_basebackup.c
M src/bin/pg_basebackup/pg_createsubscriber.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/011_in_place_tablespace.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/t/040_pg_createsubscriber.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_combinebackup/Makefile
M src/bin/pg_combinebackup/backup_label.c
M src/bin/pg_combinebackup/backup_label.h
M src/bin/pg_combinebackup/copy_file.c
M src/bin/pg_combinebackup/copy_file.h
M src/bin/pg_combinebackup/load_manifest.c
M src/bin/pg_combinebackup/load_manifest.h
M src/bin/pg_combinebackup/meson.build
M src/bin/pg_combinebackup/pg_combinebackup.c
M src/bin/pg_combinebackup/po/meson.build
M src/bin/pg_combinebackup/reconstruct.c
M src/bin/pg_combinebackup/reconstruct.h
M src/bin/pg_combinebackup/t/001_basic.pl
M src/bin/pg_combinebackup/t/002_compare_backups.pl
M src/bin/pg_combinebackup/t/003_timeline.pl
M src/bin/pg_combinebackup/t/004_manifest.pl
M src/bin/pg_combinebackup/t/005_integrity.pl
M src/bin/pg_combinebackup/t/006_db_file_copy.pl
M src/bin/pg_combinebackup/t/007_wal_level_minimal.pl
M src/bin/pg_combinebackup/t/008_promote.pl
M src/bin/pg_combinebackup/t/009_no_full_file.pl
M src/bin/pg_combinebackup/write_manifest.c
M src/bin/pg_combinebackup/write_manifest.h
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_gzip.c
M src/bin/pg_dump/compress_gzip.h
M src/bin/pg_dump/compress_io.c
M src/bin/pg_dump/compress_io.h
M src/bin/pg_dump/compress_lz4.c
M src/bin/pg_dump/compress_lz4.h
M src/bin/pg_dump/compress_none.c
M src/bin/pg_dump/compress_none.h
M src/bin/pg_dump/compress_zstd.c
M src/bin/pg_dump/compress_zstd.h
M src/bin/pg_dump/dumputils.c
M src/bin/pg_dump/dumputils.h
M src/bin/pg_dump/filter.c
M src/bin/pg_dump/filter.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/004_pg_dump_parallel.pl
M src/bin/pg_dump/t/005_pg_dump_filterfile.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/010_keep_recycled_wals.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/pg_test_fsync.c
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/t/001_basic.pl
M src/bin/pg_upgrade/t/002_pg_upgrade.pl
M src/bin/pg_upgrade/t/003_logical_slots.pl
M src/bin/pg_upgrade/t/004_subscription.pl
M src/bin/pg_upgrade/tablespace.c
M src/bin/pg_upgrade/task.c
M src/bin/pg_upgrade/util.c
M src/bin/pg_upgrade/version.c
M src/bin/pg_verifybackup/astreamer_verify.c
M src/bin/pg_verifybackup/meson.build
M src/bin/pg_verifybackup/pg_verifybackup.c
M src/bin/pg_verifybackup/pg_verifybackup.h
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/pg_walsummary/Makefile
M src/bin/pg_walsummary/meson.build
M src/bin/pg_walsummary/pg_walsummary.c
M src/bin/pg_walsummary/po/meson.build
M src/bin/pg_walsummary/t/001_basic.pl
M src/bin/pg_walsummary/t/002_blocks.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/gen_tabcomplete.pl
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.h
M src/bin/psql/tab-complete.in.c
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/binaryheap.c
M src/common/blkreftable.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/parse_manifest.c
M src/common/percentrepl.c
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/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/case_test.c
M src/common/unicode/category_test.c
M src/common/unicode/generate-norm_test_table.pl
M src/common/unicode/generate-unicode_case_table.pl
M src/common/unicode/generate-unicode_category_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/generate-unicode_version.pl
M src/common/unicode/meson.build
M src/common/unicode/norm_test.c
M src/common/unicode_case.c
M src/common/unicode_category.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/astreamer_file.c
M src/fe_utils/astreamer_gzip.c
M src/fe_utils/astreamer_lz4.c
M src/fe_utils/astreamer_tar.c
M src/fe_utils/astreamer_zstd.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/rmgrdesc_utils.h
M src/include/access/rmgrlist.h
M src/include/access/sdir.h
M src/include/access/sequence.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/tidstore.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/archive/archive_module.h
M src/include/archive/shell_archive.h
M src/include/backup/backup_manifest.h
M src/include/backup/basebackup.h
M src/include/backup/basebackup_incremental.h
M src/include/backup/basebackup_sink.h
M src/include/backup/basebackup_target.h
M src/include/backup/walsummary.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/blkreftable.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/hashfn_unstable.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/parse_manifest.h
M src/include/common/percentrepl.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_case.h
M src/include/common/unicode_case_table.h
M src/include/common/unicode_category.h
M src/include/common/unicode_category_table.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/unicode_version.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/astreamer.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/radixtree.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-fe-helpers.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/protocol.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/queryjumble.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-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/walsummarizer.h
M src/include/postmaster/walwriter.h
M src/include/regex/regexport.h
M src/include/replication/conflict.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/slotsync.h
M src/include/replication/snapbuild.h
M src/include/replication/snapbuild_internal.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/stat_utils.h
M src/include/statistics/statistics.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/bulk_write.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/dsm_registry.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/lwlocklist.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/procnumber.h
M src/include/storage/procsignal.h
M src/include/storage/read_stream.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/backend_startup.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/injection_point.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/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/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/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/varatt.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/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-cancel.c
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/t/003_load_balance_host_list.pl
M src/interfaces/libpq/t/004_load_balance_dns.pl
M src/interfaces/libpq/t/005_negotiate_encryption.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/plperl_system.h
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/plpython_system.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_loongarch.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_popcount_avx512.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/pthread_barrier_wait.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/win32common.c
M src/port/win32dlopen.c
M src/port/win32env.c
M src/port/win32error.c
M src/port/win32fdatasync.c
M src/port/win32fseek.c
M src/port/win32gai_strerror.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/authentication/t/005_sspi.pl
M src/test/authentication/t/006_login_trigger.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/LdapServer.pm
M src/test/ldap/Makefile
M src/test/ldap/meson.build
M src/test/ldap/t/001_auth.pl
M src/test/ldap/t/002_bindpasswd.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/gin/meson.build
M src/test/modules/injection_points/injection_points.c
M src/test/modules/injection_points/injection_stats.c
M src/test/modules/injection_points/injection_stats.h
M src/test/modules/injection_points/injection_stats_fixed.c
M src/test/modules/injection_points/meson.build
M src/test/modules/injection_points/t/001_stats.pl
M src/test/modules/ldap_password_func/Makefile
M src/test/modules/ldap_password_func/ldap_password_func.c
M src/test/modules/ldap_password_func/t/001_mutated_bindpasswd.pl
M src/test/modules/libpq_pipeline/libpq_pipeline.c
M src/test/modules/libpq_pipeline/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/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_dsa/meson.build
M src/test/modules/test_dsa/test_dsa.c
M src/test/modules/test_dsm_registry/meson.build
M src/test/modules/test_dsm_registry/test_dsm_registry.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_json_parser/meson.build
M src/test/modules/test_json_parser/t/001_test_json_parser_incremental.pl
M src/test/modules/test_json_parser/t/002_inline.pl
M src/test/modules/test_json_parser/t/003_test_semantic.pl
M src/test/modules/test_json_parser/t/004_test_parser_perf.pl
M src/test/modules/test_json_parser/test_json_parser_incremental.c
M src/test/modules/test_json_parser/test_json_parser_perf.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_misc/t/002_tablespace.pl
M src/test/modules/test_misc/t/003_check_guc.pl
M src/test/modules/test_misc/t/004_io_direct.pl
M src/test/modules/test_misc/t/005_timeouts.pl
M src/test/modules/test_misc/t/006_signal_autovacuum.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_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_radixtree/meson.build
M src/test/modules/test_radixtree/test_radixtree.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_resowner/meson.build
M src/test/modules/test_resowner/test_resowner_basic.c
M src/test/modules/test_resowner/test_resowner_many.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/t/001_multixact.pl
M src/test/modules/test_slru/test_multixact.c
M src/test/modules/test_slru/test_slru.c
M src/test/modules/test_tidstore/meson.build
M src/test/modules/test_tidstore/test_tidstore.c
M src/test/modules/typcache/meson.build
M src/test/modules/unsafe_tests/meson.build
M src/test/modules/worker_spi/meson.build
M src/test/modules/worker_spi/t/001_worker_spi.pl
M src/test/modules/worker_spi/worker_spi.c
M src/test/modules/xid_wraparound/meson.build
M src/test/modules/xid_wraparound/t/001_emergency_vacuum.pl
M src/test/modules/xid_wraparound/t/002_limits.pl
M src/test/modules/xid_wraparound/t/003_wraparounds.pl
M src/test/modules/xid_wraparound/xid_wraparound.c
M src/test/perl/Makefile
M src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
M src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
M src/test/perl/PostgreSQL/Test/Cluster.pm
M src/test/perl/PostgreSQL/Test/Kerberos.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/postmaster/Makefile
M src/test/postmaster/meson.build
M src/test/postmaster/t/001_connection_limits.pl
M src/test/postmaster/t/002_start_stop.pl
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/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/027_stream_regress.pl
M src/test/recovery/t/028_pitr_timelines.pl
M src/test/recovery/t/029_stats_restart.pl
M src/test/recovery/t/030_stats_cleanup_replica.pl
M src/test/recovery/t/031_recovery_conflict.pl
M src/test/recovery/t/032_relfilenode_reuse.pl
M src/test/recovery/t/033_replay_tsp_drops.pl
M src/test/recovery/t/034_create_database.pl
M src/test/recovery/t/035_standby_logical_decoding.pl
M src/test/recovery/t/036_truncated_dropped.pl
M src/test/recovery/t/037_invalid_database.pl
M src/test/recovery/t/038_save_logical_slots_shutdown.pl
M src/test/recovery/t/039_end_of_wal.pl
M src/test/recovery/t/040_standby_failover_slots_sync.pl
M src/test/recovery/t/041_checkpoint_at_promote.pl
M src/test/recovery/t/042_low_level_backup.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/032_subscribe_use_index.pl
M src/test/subscription/t/033_run_as_table_owner.pl
M src/test/subscription/t/034_temporal.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/add_commit_links.pl
M src/tools/check_bison_recursion.pl
M src/tools/copyright.pl
M src/tools/fix-old-flex-code.pl
M src/tools/gen_export.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_gendef.pl
M src/tools/pg_bsd_indent/Makefile
M src/tools/pg_bsd_indent/meson.build
M src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl
M src/tools/pginclude/headerscheck
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

Update obsolete reference to plpgsql's gram.y file.

commit   : 98b1efd6ef6a1612019ef9ed6e44b79c132352ce    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 30 Dec 2024 14:33:45 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 30 Dec 2024 14:33:45 -0500    

Click here for diff

This was evidently missed in 05346c131, which renamed that  
file to pl_gram.y.  
  
Japin Li  
  
Discussion: https://postgr.es/m/ME0P300MB0445F7CA7456C2AC67D37A01B6092@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM  

M src/pl/plpgsql/src/plpgsql.h

injection_points: Tweak variable-numbered stats to work with pending data

commit   : b757abefc0419c9b742222e1dfe70c73aff67364    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 30 Dec 2024 18:48:18 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 30 Dec 2024 18:48:18 +0900    

Click here for diff

As coded, the module was not using pending entries to store its data  
locally before doing a flush to the central dshash with a timed  
pgstat_report_stat() call.  Hence, the flush callback was defined, but  
finished by being not used.  As a template, this is more efficient than  
the original logic of updating directly the shared memory entries as  
this reduces the interactions that need to be done with the pgstats  
hash table in shared memory.  
  
injection_stats_flush_cb() was also missing a pgstat_unlock_entry(), so  
add one, while on it.  
  
Reviewed-by: Bertrand Drouvot  
Discussion: https://postgr.es/m/[email protected]  

M src/test/modules/injection_points/injection_stats.c

Fix memory leak in pgoutput with relation attribute map

commit   : c9b3d4909bbfcaa8cc2ed434d12a562fb30fe422    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 30 Dec 2024 13:33:09 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 30 Dec 2024 13:33:09 +0900    

Click here for diff

pgoutput caches the attribute map of a relation, that is free()'d only  
when validating a RelationSyncEntry.  However, this code path is not  
taken when calling any of the SQL functions able to do some logical  
decoding, like pg_logical_slot_{get,peek}_changes(), leaking some memory  
into CacheMemoryContext on repeated calls.  
  
To address this, a relation's attribute map is allocated in  
PGOutputData's cachectx, free()'d at the end of the execution of these  
SQL functions when logical decoding ends.  This is available down to 15.  
v13 and v14 have a similar leak, which will be dealt with later.  
  
Reported-by: Masahiko Sawada  
Author: Vignesh C  
Reviewed-by: Hou Zhijie  
Discussion: https://postgr.es/m/CAD21AoDkAhQVSukOfH3_reuF-j4EU0-HxMqU3dU+bSTxsqT14Q@mail.gmail.com  
Discussion: https://postgr.es/m/CALDaNm1hewNAsZ_e6FF52a=9drmkRJxtEPrzCB6-9mkJyeBBqA@mail.gmail.com  
Backpatch-through: 15  

M src/backend/replication/pgoutput/pgoutput.c

Remove redundant wording in pg_statistic.h

commit   : ebf2ab40e5e1b0545257e8b27a1d48e9488c23f4    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 30 Dec 2024 12:18:45 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 30 Dec 2024 12:18:45 +0900    

Click here for diff

Author: Junwang Zhao  
Discussion: https://postgr.es/m/CAEG8a3JbMCHna=N5ZSx6huLnTDfW34kw7Pf2n8+3M-9UrrwesA@mail.gmail.com  

M src/include/catalog/pg_statistic.h

Fix failures with incorrect epoch handling for 2PC files at recovery

commit   : 7e125b20eed65e61b07e2e9ef6901467e4f14272    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 30 Dec 2024 09:58:02 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 30 Dec 2024 09:58:02 +0900    

Click here for diff

At the beginning of recovery, an orphaned two-phase file in an epoch  
different than the one defined in the checkpoint record could not be  
removed based on the assumptions that AdjustToFullTransactionId() relies  
on, assuming that all files would be either from the current epoch or  
from the previous epoch.  
  
If the checkpoint epoch was 0 while the 2PC file was orphaned and in the  
future, AdjustToFullTransactionId() would underflow the epoch used to  
build the 2PC file path.  In non-assert builds, this would create a  
WARNING message referring to a 2PC file with an epoch of "FFFFFFFF" (or  
UINT32_MAX), as an effect of the underflow calculation, leaving the  
orphaned file around.  
  
Some tests are added with dummy 2PC files in the past and the future,  
checking that these are properly removed.  
  
Issue introduced by 5a1dfde8334b, that has switched two-phase state  
files to use FullTransactionIds.  
  
Reported-by: Vitaly Davydov  
Author: Michael Paquier  
Reviewed-by: Vitaly Davydov  
Discussion: https://postgr.es/m/13b5b6-676c3080-4d-531db900@47931709  
Backpatch-through: 17  

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

Fix handling of orphaned 2PC files in the future at recovery

commit   : e3584258154fac40e16f757fadd3361688a166d2    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 30 Dec 2024 08:06:07 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 30 Dec 2024 08:06:07 +0900    

Click here for diff

Before 728bd991c3c4, that has improved the support for 2PC files during  
recovery, the initial logic scanning files in pg_twophase was done so as  
files in the future of the transaction ID horizon were checked first,  
followed by a check if a transaction ID is aborted or committed which  
could involve a pg_xact lookup.  After this commit, these checks have  
been done in reverse order.  
  
Files detected as in the future do not have a state that can be checked  
in pg_xact, hence this caused recovery to fail abruptly should an  
orphaned 2PC file in the future of the transaction ID horizon exist in  
pg_twophase at the beginning of recovery.  
  
A test is added to check for this scenario, using an empty 2PC with a  
transaction ID large enough to be in the future when running the test.  
This test is added in 16 and older versions for now.  17 and newer  
versions are impacted by a second bug caused by the addition of the  
epoch in the 2PC file names.  An equivalent test will be added in these  
branches in a follow-up commit, once the second set of issues reported  
are fixed.  
  
Author: Vitaly Davydov, Michael Paquier  
Discussion: https://postgr.es/m/11e597-676ab680-8d-374f23c0@145466129  
Backpatch-through: 13  

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

contrib/pageinspect: Use SQL-standard function bodies.

commit   : 68ff25eef125a5eaf49a52ec794a0bf55a917b27    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 29 Dec 2024 14:58:05 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 29 Dec 2024 14:58:05 -0500    

Click here for diff

In the same spirit as 969bbd0fa, 13e3796c9, 3f323eba8.  
  
Tom Lane and Ronan Dunklau  
  
Discussion: https://postgr.es/m/3316564.aeNJFYEL58@aivenlaptop  

M contrib/pageinspect/Makefile
M contrib/pageinspect/meson.build
A contrib/pageinspect/pageinspect–1.12–1.13.sql
M contrib/pageinspect/pageinspect.control

contrib/xml2: Use SQL-standard function bodies.

commit   : 667368fd26de5846d6f6b8ab889ea9489b9b22bc    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 29 Dec 2024 13:53:00 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 29 Dec 2024 13:53:00 -0500    

Click here for diff

In the same spirit as 969bbd0fa, 13e3796c9, 3f323eba8.  
  
Tom Lane and Ronan Dunklau  
  
Discussion: https://postgr.es/m/3316564.aeNJFYEL58@aivenlaptop  

M contrib/xml2/Makefile
M contrib/xml2/meson.build
A contrib/xml2/xml2–1.1–1.2.sql
M contrib/xml2/xml2.control

contrib/citext: Use SQL-standard function bodies.

commit   : 97a5a16849eb4642e38d9447ab40708d3f302e17    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 29 Dec 2024 13:37:35 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 29 Dec 2024 13:37:35 -0500    

Click here for diff

In the same spirit as 969bbd0fa, 13e3796c9, 3f323eba8.  
  
Tom Lane and Ronan Dunklau  
  
Discussion: https://postgr.es/m/3316564.aeNJFYEL58@aivenlaptop  

M contrib/citext/Makefile
A contrib/citext/citext–1.7–1.8.sql
M contrib/citext/citext.control
M contrib/citext/meson.build

Fix overly large values/nulls arrays

commit   : eb53ff5517e50018539747d75a02d493abc2d232    
  
author   : David Rowley <[email protected]>    
date     : Sun, 29 Dec 2024 23:57:43 +1300    
  
committer: David Rowley <[email protected]>    
date     : Sun, 29 Dec 2024 23:57:43 +1300    

Click here for diff

These arrays were sized with Natts_pg_trigger (19) when they should have  
been sized with Natts_pg_event_trigger (7).  We'd better fix this as  
it's clearly a mistake and it could become problematic if  
pg_event_trigger were to gain a dozen or so more columns in the future.  
  
No backpatch as there's no actual bug and the column count on those  
tables isn't going to change in released versions.  
  
Author: Xin Zhang <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/commands/event_trigger.c

Replace PGPROC.isBackgroundWorker with isRegularBackend.

commit   : 508a97ee4984597ea60c383f52adefd47178189f    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 28 Dec 2024 16:21:54 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 28 Dec 2024 16:21:54 -0500    

Click here for diff

Commit 34486b609 effectively redefined isBackgroundWorker as meaning  
"not a regular backend", whereas before it had the narrower  
meaning of AmBackgroundWorkerProcess().  For clarity, rename the  
field to isRegularBackend and invert its sense.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/access/transam/twophase.c
M src/backend/storage/ipc/procarray.c
M src/backend/storage/lmgr/proc.c
M src/include/storage/proc.h

Exclude parallel workers from connection privilege/limit checks.

commit   : 34486b6092e700089d22586df211c4e8b0412136    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 28 Dec 2024 16:08:50 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 28 Dec 2024 16:08:50 -0500    

Click here for diff

Cause parallel workers to not check datallowconn, rolcanlogin, and  
ACL_CONNECT privileges.  The leader already checked these things  
(except for rolcanlogin which might have been checked for a different  
role).  Re-checking can accomplish little except to induce unexpected  
failures in applications that might not even be aware that their query  
has been parallelized.  We already had the principle that parallel  
workers rely on their leader to pass a valid set of authorization  
information, so this change just extends that a bit further.  
  
Also, modify the ReservedConnections, datconnlimit and rolconnlimit  
logic so that these limits are only enforced against regular backends,  
and only regular backends are counted while checking if the limits  
were already reached.  Previously, background processes that had an  
assigned database or role were subject to these limits (with rather  
random exclusions for autovac workers and walsenders), and the set of  
existing processes that counted against each limit was quite haphazard  
as well.  The point of these limits, AFAICS, is to ensure the  
availability of PGPROC slots for regular backends.  Since all other  
types of processes have their own separate pools of PGPROC slots, it  
makes no sense either to enforce these limits against them or to count  
them while enforcing the limit.  
  
While edge-case failures of these sorts have been possible for a  
long time, the problem got a good deal worse with commit 5a2fed911  
(CVE-2024-10978), which caused parallel workers to make some of these  
checks using the leader's current role where before we had used its  
AuthenticatedUserId, thus allowing parallel queries to fail after  
SET ROLE.  The previous behavior was fairly accidental and I have  
no desire to return to it.  
  
This patch includes reverting 73c9f91a1, which was an emergency hack  
to suppress these same checks in some cases.  It wasn't complete,  
as shown by a recent bug report from Laurenz Albe.  We can also revert  
fd4d93d26 and 492217301, which hacked around the same problems in one  
regression test.  
  
In passing, remove the special case for autovac workers in  
CheckMyDatabase; it seems cleaner to have AutoVacWorkerMain pass  
the INIT_PG_OVERRIDE_ALLOW_CONNS flag, now that that does what's  
needed.  
  
Like 5a2fed911, back-patch to supported branches (which sadly no  
longer includes v12).  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/access/transam/parallel.c
M src/backend/access/transam/twophase.c
M src/backend/postmaster/autovacuum.c
M src/backend/postmaster/bgworker.c
M src/backend/storage/ipc/procarray.c
M src/backend/storage/lmgr/proc.c
M src/backend/utils/init/miscinit.c
M src/backend/utils/init/postinit.c
M src/include/miscadmin.h
M src/include/storage/proc.h
M src/test/modules/worker_spi/worker_spi.c

Reserve a PGPROC slot and semaphore for the slotsync worker process.

commit   : 2bdf1b2a2efc7bbbe2db3213153c14615485eadd    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 28 Dec 2024 12:30:42 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 28 Dec 2024 12:30:42 -0500    

Click here for diff

The need for this was missed in commit 93db6cbda, with the result  
being that if we launch a slotsync worker it would consume one of  
the PGPROCs in the max_connections pool.  That could lead to inability  
to launch the worker, or to subsequent failures of connection requests  
that should have succeeded according to the configured settings.  
  
Rather than create some one-off infrastructure to support this,  
let's group the slotsync worker with the existing autovac launcher  
in a new category of "special worker" processes.  These are kind of  
like auxiliary processes, but they cannot use that infrastructure  
because they need to be able to run transactions.  
  
For the moment, make these processes share the PGPROC freelist  
used for autovac workers (which previously supplied the autovac  
launcher too).  This is partly to avoid an ABI change in v17,  
and partly because it seems silly to have a freelist with  
at most two members.  This might be worth revisiting if we grow  
enough workers in this category.  
  
Tom Lane and Hou Zhijie.  Back-patch to v17.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/storage/lmgr/proc.c
M src/backend/utils/init/postinit.c
M src/include/miscadmin.h
M src/include/storage/proc.h

In REASSIGN OWNED of a database, lock the tuple as mandated.

commit   : ff90ee61450921e03fe3af4e0f75337a4bbd0584    
  
author   : Noah Misch <[email protected]>    
date     : Sat, 28 Dec 2024 07:16:22 -0800    
  
committer: Noah Misch <[email protected]>    
date     : Sat, 28 Dec 2024 07:16:22 -0800    

Click here for diff

Commit aac2c9b4fde889d13f859c233c2523345e72d32b mandated such locking  
and attempted to fulfill that mandate, but it missed REASSIGN OWNED.  
Hence, it remained possible to lose VACUUM's inplace update of  
datfrozenxid if a REASSIGN OWNED processed that database at the same  
time.  This didn't affect the other inplace-updated catalog, pg_class.  
For pg_class, REASSIGN OWNED calls ATExecChangeOwner() instead of the  
generic AlterObjectOwner_internal(), and ATExecChangeOwner() fulfills  
the locking mandate.  
  
Like in GRANT, implement this by following the locking protocol for any  
catalog subject to the generic AlterObjectOwner_internal().  It would  
suffice to do this for IsInplaceUpdateOid() catalogs only.  Back-patch  
to v13 (all supported versions).  
  
Kirill Reshke.  Reported by Alexander Kukushkin.  
  
Discussion: https://postgr.es/m/CAFh8B=mpKjAy4Cuun-HP-f_vRzh2HSvYFG3rhVfYbfEBUhBAGg@mail.gmail.com  

M src/backend/catalog/objectaddress.c
M src/backend/commands/alter.c
M src/include/catalog/objectaddress.h
M src/test/regress/expected/database.out
M src/test/regress/sql/database.sql

Speedup tuple deformation with additional function inlining

commit   : 58a359e585d0281ecab4d34cab9869e7eb4e4ca3    
  
author   : David Rowley <[email protected]>    
date     : Sat, 28 Dec 2024 12:20:42 +1300    
  
committer: David Rowley <[email protected]>    
date     : Sat, 28 Dec 2024 12:20:42 +1300    

Click here for diff

This adjusts slot_deform_heap_tuple() to add special-case loops to  
eliminate much of the branching that was done within the body of the  
main deform loop.  
  
Previously, while looping over each attribute to deform,  
slot_deform_heap_tuple() would always recheck if the given attribute was  
NULL by looking at HeapTupleHasNulls() and if so, went on to check the  
tuple's NULL bitmap.  Since many tuples won't contain any NULLs, we can  
just check HeapTupleHasNulls() once and when there are no NULLs, use a  
more compact version of the deforming loop which contains no NULL checking  
code at all.  
  
The same is possible for the "slow" mode checking part of the loop.  That  
variable was checked several times for each attribute, once to determine  
if the offset to the attribute value could be taken from the attcacheoff,  
and again to check if the offset could be cached for next time.  
  
These "slow" checks can mostly be eliminated by instead having multiple  
loops.  Initially, we can start in the non-slow loop and break out of  
that loop if and only if we must stop caching the offset.  This  
eliminates branching for both slow and non-slow deforming methods.  The  
amount of code required for the no nulls / non-slow version is very  
small.  It's possible to have separate loops like this due to the fact  
that once we move into slow mode, we never need to switch back into  
non-slow mode for a given tuple.  
  
We have the compiler take care of writing out the multiple required  
loops by having a pg_attribute_always_inline function which gets called  
various times passing in constant values for the "slow" and "hasnulls"  
parameters.  This allows the compiler to eliminate const-false branches  
and remove comparisons for const-true ones.  
  
This commit has shown overall query performance increases of around 5-20%  
in deform-heavy OLAP-type workloads.  
  
Author: David Rowley  
Reviewed-by: Victor Yegorov  
Discussion: https://postgr.es/m/CAGnEbog92Og2CpC2S8=g_HozGsWtt_3kRS1sXjLz0jKSoCNfLw@mail.gmail.com  
Discussion: https://postgr.es/m/CAApHDvo9e0XG71WrefYaRv5n4xNPLK4k8LjD0mSR3c9KR2vi2Q@mail.gmail.com  

M src/backend/executor/execTuples.c

Improve handling of date_trunc() units for infinite input values

commit   : d85ce012f99f63249bb45a78fcecb7a2383920b1    
  
author   : Michael Paquier <[email protected]>    
date     : Fri, 27 Dec 2024 13:32:40 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Fri, 27 Dec 2024 13:32:40 +0900    

Click here for diff

Previously, if an infinite value was passed to date_trunc(), then the  
same infinite value would always be returned regardless of the field  
unit given by the caller.  This commit updates the function so that an  
error is returned when an invalid unit is passed to date_trunc() with an  
infinite value.  
  
This matches the behavior of date_trunc() with a finite value and  
date_part() with an infinite value, making the handling of interval,  
timestamp and timestamptz more consistent across the board for these two  
functions.  
  
Some tests are added to cover all these new failure cases, with an  
unsupported unit and infinite values for the three data types.  There  
were no test cases in core that checked all these patterns up to now.  
  
Author: Joseph Koshakow  
Discussion: https://postgr.es/m/CAAvxfHc4084dGzEJR0_pBZkDuqbPGc5wn7gK_M0XR_kRiCdUJQ@mail.gmail.com  

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

Remove unused totalrows parameter in compute_expr_stats

commit   : 61cac71c23686f47c785dc69d3c15cb4304d106f    
  
author   : David Rowley <[email protected]>    
date     : Fri, 27 Dec 2024 10:51:22 +1300    
  
committer: David Rowley <[email protected]>    
date     : Fri, 27 Dec 2024 10:51:22 +1300    

Click here for diff

The totalrows parameter in compute_expr_stats is unused, so remove it.  
This is a static function, so the parameter can easily be added again if  
it's ever needed.  
  
Author: Ilia Evdokimov <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/statistics/extended_stats.c

plpgsql: Rename a variable for clarity

commit   : 3f2d72b4934945da76f6bc60dfe3fc5ca42e7526    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 26 Dec 2024 11:11:14 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 26 Dec 2024 11:11:14 +0100    

Click here for diff

Rename "core_yy_extra_type core_yy" to "core_yy_extra".  The previous  
name was a bit unclear and confusing.  The new name matches the name  
used elsewhere for the same purpose, for example in  
src/backend/parser/gramparse.h.  

M src/pl/plpgsql/src/pl_scanner.c

Fix typo in comment of compute_return_type() in functioncmds.c

commit   : a86cfcae7c58049c7a3a60118ef3f53afd92b3fa    
  
author   : Michael Paquier <[email protected]>    
date     : Thu, 26 Dec 2024 12:53:55 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Thu, 26 Dec 2024 12:53:55 +0900    

Click here for diff

Author: Japin Li  
Discussion: https://postgr.es/m/ME0P300MB0445D51BCFA8680F0B35FD6EB60C2@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM  

M src/backend/commands/functioncmds.c

meson: Export all libcommon functions in Windows builds

commit   : 07f902bd760791527511be9fc47440039bc86b5c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 25 Dec 2024 19:22:25 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 25 Dec 2024 19:22:25 +0200    

Click here for diff

This fixes "unresolved external symbol" errors with extensions that  
use functions from libpgport that need special CFLAGS to  
compile. Currently, that includes the CRC-32 functions.  
  
Commit 2571c1d5cc did this for libcommon, but I missed that libpqport  
has the same issue.  
  
Reported-by: Tom Lane  
Backpatch-through: 16, where Meson was introduced  
Discussion: https://www.postgresql.org/message-id/CAOdR5yF0krWrxycA04rgUKCgKugRvGWzzGLAhDZ9bzNv8g0Lag@mail.gmail.com  

M src/port/meson.build

Add commit 301de6a6f60 to .git-blame-ignore-revs.

commit   : 4c9b453c91b201264c6d60a3de197115c8feaee0    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 25 Dec 2024 18:17:29 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 25 Dec 2024 18:17:29 +0100    

Click here for diff

M .git-blame-ignore-revs

Partial pgindent of .l and .y files

commit   : 301de6a6f609cb3ad2d9d31fd8db9ae6c71e6dea    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 25 Dec 2024 17:52:42 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 25 Dec 2024 17:52:42 +0100    

Click here for diff

Trying to clean up the code a bit while we're working on these files  
for the reentrant scanner/pure parser patches.  This cleanup only  
touches the code sections after the second '%%' in each file, via a  
manually-supervised and locally hacked up pgindent.  

M contrib/cube/cubeparse.y
M contrib/cube/cubescan.l
M contrib/seg/segscan.l
M src/backend/bootstrap/bootscanner.l
M src/backend/parser/gram.y
M src/backend/parser/scan.l
M src/backend/replication/repl_scanner.l
M src/backend/replication/syncrep_scanner.l
M src/backend/utils/adt/jsonpath_gram.y
M src/backend/utils/adt/jsonpath_scan.l
M src/backend/utils/misc/guc-file.l
M src/bin/pgbench/exprparse.y
M src/bin/psql/psqlscanslash.l
M src/fe_utils/psqlscan.l
M src/interfaces/ecpg/preproc/pgc.l
M src/pl/plpgsql/src/pl_gram.y

meson: Export all libcommon functions in Windows builds

commit   : 2571c1d5cc5ed2620d601a7e12179bd951f2e202    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Wed, 25 Dec 2024 18:14:18 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Wed, 25 Dec 2024 18:14:18 +0200    

Click here for diff

This fixes "unresolved external symbol" errors with extensions that  
use functions from libcommon. This was reported with pgvector.  
  
Reported-by: Andrew Kane  
Author: Vladlen Popolitov  
Backpatch-through: 16, where Meson was introduced  
Discussion: https://www.postgresql.org/message-id/CAOdR5yF0krWrxycA04rgUKCgKugRvGWzzGLAhDZ9bzNv8g0Lag@mail.gmail.com  

M src/common/meson.build

guc: reentrant scanner

commit   : d663f150b5edd5ec4a5a3bbc24f9ad7e40f1abbb    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 25 Dec 2024 14:18:07 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 25 Dec 2024 14:18:07 +0100    

Click here for diff

Use the flex %option reentrant to make the generated scanner  
reentrant, and perhaps eventually thread-safe, but that will require  
additional work.  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Reviewed-by: Andreas Karlsson <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M src/backend/utils/misc/guc-file.l

jsonpath scanner: reentrant scanner

commit   : 2a7425d7eef9b4b848763fb920fefa23c3c43f31    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 24 Dec 2024 23:42:41 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 24 Dec 2024 23:42:41 +0100    

Click here for diff

Use the flex %option reentrant to make the generated scanner  
reentrant and thread-safe.  Note: The parser was already pure.  
  
Simplify flex scan buffer management: Instead of constructing the  
buffer from pieces and then using yy_scan_buffer(), we can just use  
yy_scan_string(), which does the same thing internally.  (Actually, we  
use yy_scan_bytes() here because we already have the length.)  
  
Use flex yyextra to handle context information, instead of global  
variables.  This complements the other changes to make the scanner  
reentrant.  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Reviewed-by: Andreas Karlsson <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M src/backend/nls.mk
M src/backend/utils/adt/jsonpath_gram.y
M src/backend/utils/adt/jsonpath_internal.h
M src/backend/utils/adt/jsonpath_scan.l

Fix nbtree symbol name comment reference.

commit   : 9b254895c367a3b962bcdd3e35f8590005106e8a    
  
author   : Peter Geoghegan <[email protected]>    
date     : Tue, 24 Dec 2024 14:06:16 -0500    
  
committer: Peter Geoghegan <[email protected]>    
date     : Tue, 24 Dec 2024 14:06:16 -0500    

Click here for diff

Oversight in commit 5bf748b86b.  

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

syncrep parser: pure parser and reentrant scanner

commit   : db6856c9913f1af08b5d7bde442fae362913190a    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 2 Dec 2024 10:35:37 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 2 Dec 2024 10:35:37 +0100    

Click here for diff

Use the flex %option reentrant and the bison option %pure-parser to  
make the generated scanner and parser pure, reentrant, and  
thread-safe.  
  
Make the generated scanner use palloc() etc. instead of malloc() etc.  
Previously, we only used palloc() for the buffer, but flex would still  
use malloc() for its internal structures.  Now, all the memory is  
under palloc() control.  
  
Simplify flex scan buffer management: Instead of constructing the  
buffer from pieces and then using yy_scan_buffer(), we can just use  
yy_scan_string(), which does the same thing internally.  
  
The previous code was necessary because we allocated the buffer with  
palloc() and the rest of the state was handled by malloc().  But this  
is no longer the case; everything is under palloc() now.  
  
Use flex yyextra to handle context information, instead of global  
variables.  This complements the other changes to make the scanner  
reentrant.  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Reviewed-by: Andreas Karlsson <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M src/backend/nls.mk
M src/backend/replication/syncrep.c
M src/backend/replication/syncrep_gram.y
M src/backend/replication/syncrep_scanner.l
M src/include/replication/syncrep.h

replication parser: pure parser and reentrant scanner

commit   : e4a8fb8fefb903fe601f7415098a4fe39a14069a    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 2 Dec 2024 10:35:37 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 2 Dec 2024 10:35:37 +0100    

Click here for diff

Use the flex %option reentrant and the bison option %pure-parser to  
make the generated scanner and parser pure, reentrant, and  
thread-safe.  
  
Make the generated scanner use palloc() etc. instead of malloc() etc.  
Previously, we only used palloc() for the buffer, but flex would still  
use malloc() for its internal structures.  As a result, there could be  
some small memory leaks in case of uncaught errors.  Now, all the  
memory is under palloc() control, so there are no more such issues.  
  
Simplify flex scan buffer management: Instead of constructing the  
buffer from pieces and then using yy_scan_buffer(), we can just use  
yy_scan_string(), which does the same thing internally.  
  
The previous code was necessary because we allocated the buffer with  
palloc() and the rest of the state was handled by malloc().  But this  
is no longer the case; everything is under palloc() now.  
  
Use flex yyextra to handle context information, instead of global  
variables.  This complements the other changes to make the scanner  
reentrant.  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Co-authored-by: Andreas Karlsson <[email protected]>  
Reviewed-by: Andreas Karlsson <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M src/backend/nls.mk
M src/backend/replication/repl_gram.y
M src/backend/replication/repl_scanner.l
M src/backend/replication/walsender.c
M src/include/replication/walsender_private.h

Remove pgrminclude and associated scripts

commit   : 5af699066f81547aa75c093544fbd57289d30284    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 24 Dec 2024 14:02:42 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 24 Dec 2024 14:02:42 +0100    

Click here for diff

Per git log, the last time someone tried to do something with  
pgrminclude was around 2011.  And it's always had a tendency of  
causing trouble when it was active.  Also, pgcominclude is redundant  
with headerscheck.  
  
Discussion: https://www.postgresql.org/message-id/flat/2d4dc7b2-cb2e-49b1-b8ca-ba5f7024f05b%40eisentraut.org  

M src/tools/pginclude/README
D src/tools/pginclude/pgcheckdefines
D src/tools/pginclude/pgcompinclude
D src/tools/pginclude/pgdefine
D src/tools/pginclude/pgfixinclude
D src/tools/pginclude/pgrminclude

Remove pgrminclude annotations

commit   : 1eb7cb21c2a2c9091bc4cdf09d37d68559af8a7d    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 24 Dec 2024 11:48:08 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 24 Dec 2024 11:48:08 +0100    

Click here for diff

Per git log, the last time someone tried to do something with  
pgrminclude was around 2011.  Many (not all) of the "pgrminclude  
ignore" annotations are of a newer date but seem to have just been  
copied around during refactorings and file moves and don't seem to  
reflect an actual need anymore.  
  
There have been some parallel experiments with include-what-you-use  
(IWYU) annotations, but these don't seem to correspond very strongly  
to pgrminclude annotations, so there is no value in keeping the  
existing ones even for that kind of thing.  
  
So, wipe them all away.  We can always add new ones in the future  
based on actual needs.  
  
Discussion: https://www.postgresql.org/message-id/flat/2d4dc7b2-cb2e-49b1-b8ca-ba5f7024f05b%40eisentraut.org  

M src/backend/access/brin/brin.c
M src/backend/access/nbtree/nbtsort.c
M src/backend/regex/regerror.c
M src/backend/utils/adt/inet_net_pton.c
M src/bin/initdb/initdb.c
M src/bin/pg_amcheck/pg_amcheck.c
M src/bin/scripts/common.h
M src/include/common/ip.h
M src/include/common/relpath.h
M src/include/libpq/hba.h
M src/include/libpq/ifaddr.h
M src/include/pg_trace.h
M src/include/snowball/header.h
M src/pl/plpgsql/src/pl_comp.c
M src/pl/tcl/pltcl.c

Fix race condition in TupleDescCompactAttr assert code

commit   : 6f3820f37aba94232468365bae7ba5de697fe993    
  
author   : David Rowley <[email protected]>    
date     : Tue, 24 Dec 2024 14:54:24 +1300    
  
committer: David Rowley <[email protected]>    
date     : Tue, 24 Dec 2024 14:54:24 +1300    

Click here for diff

5983a4cff added CompactAttribute as an abbreviated alternative to  
FormData_pg_attribute to allow more cache-friendly processing in tasks  
related to TupleDescs.  That commit contained some assert-only code to  
check that the CompactAttribute had been populated correctly, however,  
the method used to do that checking caused the TupleDesc's  
CompactAttribute to be zeroed before it was repopulated and compared to  
the snapshot taken before the memset call.  This caused issues as the type  
cache caches TupleDescs in shared memory which can be used by multiple  
backend processes at the same time.  There was a window of time between  
the zero and repopulation of the CompactAttribute where another process  
would mistakenly think that the CompactAttribute is invalid due to the  
memset.  
  
To fix this, instead of taking a snapshot of the CompactAttribute and  
calling populate_compact_attribute() and comparing the snapshot to the  
freshly populated TupleDesc's CompactAttribute, refactor things so we  
can just populate a temporary CompactAttribute on the stack.  This way  
we don't touch the TupleDesc's memory.  
  
Reported-by: Alexander Lakhin, SQLsmith  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/access/common/tupdesc.c
M src/include/access/tupdesc.h

commit   : 38da053463bef32adf563ddee5277d16d2b6c5af    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 23 Dec 2024 16:46:07 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 23 Dec 2024 16:46:07 -0500    

Click here for diff

These two platforms have a remarkably tight default limit on the  
number of SysV semaphores in the system: SEMMNS is only 60  
out-of-the-box.  Unless manual action is taken to raise that,  
we'll only be able to allocate 3 sets of 16 usable semaphores  
each, leading to initdb setting max_connections to just 20.  
That's problematic because the core regression tests expect  
to be able to launch 20 concurrent sessions, leaving us with  
no headroom.  This seems to be the cause of intermittent  
buildfarm failures on some machines.  
  
While there's no getting around the fact that you'd better raise  
SEMMNS for production use on these platforms, it does seem desirable  
for "make check" to pass reliably without that.  We can make that  
happen, at least for awhile longer, with two small changes:  
  
* Change sysv_sema.c's SEMAS_PER_SET to 19, so that we can eat up  
all of the available semas not just most of them.  
  
* Change initdb to make the smallest max_connections value it will  
consider be 25 not 20.  
  
As of HEAD this will leave us with four free semaphores (using the  
default values for other relevant parameters such as max_wal_senders).  
So we won't need to consider this again until we've invented five  
more background processes.  Maybe by then we can switch both these  
platforms to some other semaphore API.  
  
For the moment, do this only in master; there've not been field  
complaints that might justify a back-patch.  
  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/runtime.sgml
M src/backend/port/sysv_sema.c
M src/bin/initdb/initdb.c

Reset btpo_cycleid in nbtree VACUUM's REDO routine.

commit   : da9517fb3a0979f8d75823199f7a231e0269963b    
  
author   : Peter Geoghegan <[email protected]>    
date     : Mon, 23 Dec 2024 15:46:00 -0500    
  
committer: Peter Geoghegan <[email protected]>    
date     : Mon, 23 Dec 2024 15:46:00 -0500    

Click here for diff

Reset btpo_cycleid to 0 in btree_xlog_vacuum for consistency with  
_bt_delitems_vacuum (the corresponding original execution code).  This  
makes things neater.  
  
There might be some performance benefit to being consistent like this.  
When btvacuumpage doesn't call _bt_delitems_vacuum, it can still  
proactively reset btpo_cycleid to 0 via a separate hint-like update  
mechanism (it does so whenever it sees that it isn't already set to 0).  
And so it's possible that being consistent about resetting btpo_cycleid  
like this will save work later on, after standby promotion: subsequent  
VACUUMs won't need to clear btpo_cycleid using the hint-like update  
mechanism as often as they otherwise would.  
  
Author: Peter Geoghegan <[email protected]>  
Reviewed-By: Andrey Borodin <[email protected]>  
Discussion: https://postgr.es/m/CAH2-Wz=+LDFxn9NZyEsCo8ifcyKt6+n-VLyygySEHgMz+oynqw@mail.gmail.com  

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

postgres_fdw: re-issue cancel requests a few times if necessary.

commit   : c431986de16cc7e7af8ba3af45d846f279606fd3    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 23 Dec 2024 15:14:30 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 23 Dec 2024 15:14:30 -0500    

Click here for diff

Despite the best efforts of commit 0e5c82380, we're still seeing  
occasional failures of postgres_fdw's query_cancel test in the  
buildfarm.  Investigation suggests that its 100ms timeout is  
still not enough to reliably ensure that the remote side starts  
the query before receiving the cancel request --- and if it  
hasn't, it will just discard the request because it's idle.  
  
We discussed allowing a cancel request to kill the next-received  
query, but that would have wide and perhaps unpleasant side-effects.  
What seems safer is to make postgres_fdw do what a human user would  
likely do, which is issue another cancel request if the first one  
didn't seem to do anything.  We'll keep the same overall 30 second  
grace period before concluding things are broken, but issue additional  
cancel requests after 1 second, then 2 more seconds, then 4, then 8.  
(The next one in series is 16 seconds, but we'll hit the 30 second  
timeout before that.)  
  
Having done that, revert the timeout in query_cancel.sql to 10 ms.  
That will still be enough on most machines, most of the time, for  
the remote query to start; but now we're intentionally risking the  
race condition occurring sometimes in the buildfarm, so that the  
repeat-cancel code path will get some testing.  
  
As before, back-patch to v17.  We might eventually contemplate  
back-patching this further, and/or adding similar logic to dblink.  
But given the lack of field complaints to date, this feels like  
mostly an exercise in test case stabilization, so v17 is enough.  
  
Discussion: https://postgr.es/m/colnv3lzzmc53iu5qoawynr6qq7etn47lmggqr65ddtpjliq5d@glkveb4m6nop  

M contrib/postgres_fdw/connection.c
M contrib/postgres_fdw/expected/query_cancel.out
M contrib/postgres_fdw/sql/query_cancel.sql

Don't allow GetTransactionSnapshot() in logical decoding

commit   : 1585ff7387dbcc5657522b2ed87ffd58fd555ee9    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 23 Dec 2024 12:42:55 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 23 Dec 2024 12:42:55 +0200    

Click here for diff

A historic snapshot should only be used for catalog access, not  
general queries. We never call GetTransactionSnapshot() during logical  
decoding, which is good because it wouldn't be very sensible, so the  
code to deal with that was unreachable and untested. Turn it into an  
error, to avoid doing that in the future either.  
  
Discussion: https://www.postgresql.org/message-id/[email protected]  

M src/backend/utils/time/snapmgr.c

Remove unnecessary GetTransactionSnapshot() calls

commit   : 952365cded635e54c4177399c0280cb7a5e34c11    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 23 Dec 2024 12:42:39 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 23 Dec 2024 12:42:39 +0200    

Click here for diff

In get_database_list() and get_subscription_list(), the  
GetTransactionSnapshot() call is not required because the catalog  
table scans use the catalog snapshot, which is held until the end of  
the scan. See table_beginscan_catalog(), which calls  
RegisterSnapshot(GetCatalogSnapshot(relid)).  
  
In InitPostgres, it's a little less obvious that it's not required,  
but still true I believe. All the catalog lookups in InitPostgres()  
also use the catalog snapshot, and the looked up values are copied  
while still holding the snapshot.  
  
Furthermore, as the removed FIXME comments said, calling  
GetTransactionSnapshot() didn't really prevent MyProc->xmin from being  
reset anyway.  
  
Discussion: https://www.postgresql.org/message-id/[email protected]  

M src/backend/postmaster/autovacuum.c
M src/backend/replication/logical/launcher.c
M src/backend/utils/init/postinit.c

Fix incorrect source filename references

commit   : 7ec4b9ff80d92fee3c41eb1a069cc32d0ec11da1    
  
author   : David Rowley <[email protected]>    
date     : Mon, 23 Dec 2024 19:41:49 +1300    
  
committer: David Rowley <[email protected]>    
date     : Mon, 23 Dec 2024 19:41:49 +1300    

Click here for diff

Jian He reported the src/include/utility/tcop.h one and the remainder  
were found by using a script to look for src/* and check that we have a  
filename or directory of that name.  
  
In passing, fix some out-date comments.  
  
Reported-by: Jian He <[email protected]>  
Reviewed-by: Tom Lane  
Discussion: https://postgr.es/m/CACJufxGoE3H-7VgO02=PrR4SNuVWDVbfTyUnwO0HvS-Lxurnog@mail.gmail.com  

M src/backend/commands/aggregatecmds.c
M src/backend/commands/define.c
M src/backend/commands/functioncmds.c
M src/backend/commands/operatorcmds.c
M src/backend/commands/typecmds.c
M src/backend/tcop/utility.c
M src/backend/utils/misc/guc_internal.h
M src/fe_utils/astreamer_file.c
M src/fe_utils/astreamer_gzip.c
M src/fe_utils/astreamer_lz4.c
M src/fe_utils/astreamer_tar.c
M src/fe_utils/astreamer_zstd.c
M src/include/fe_utils/astreamer.h

commit   : 7f97b4734f937db6f8dab1bbf8bbaab349e6c9b1    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 23 Dec 2024 14:46:49 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 23 Dec 2024 14:46:49 +0900    

Click here for diff

Library unloading has never been supported with its code removed in  
ab02d702ef08, and there were some comments still mentioning that it was  
a possible operation.  
  
ChangAo has noticed the incorrect references in dfmgr.c, while I have  
noticed the other ones while scanning the rest of the tree for similar  
mistakes.  
  
Author: ChangAo Chen, Michael Paquier  
Reviewed-by: Tom Lane  
Discussion: https://postgr.es/m/[email protected]  

M contrib/auto_explain/auto_explain.c
M contrib/passwordcheck/passwordcheck.c
M contrib/pg_stat_statements/pg_stat_statements.c
M contrib/sepgsql/hooks.c
M src/backend/utils/fmgr/dfmgr.c

Update TransactionXmin when MyProc->xmin is updated

commit   : 578a7fe7b6f8484f6d7caa2fda288abb3fe87aa0    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Sat, 21 Dec 2024 23:42:39 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Sat, 21 Dec 2024 23:42:39 +0200    

Click here for diff

GetSnapshotData() set TransactionXmin = MyProc->xmin, but when  
SnapshotResetXmin() advanced MyProc->xmin, it did not advance  
TransactionXmin correspondingly. That meant that TransactionXmin could  
be older than MyProc->xmin, and XIDs between than TransactionXmin and  
the real MyProc->xmin could be vacuumed away. One known consequence is  
in pg_subtrans lookups: we might try to look up the status of an XID  
that was already truncated away.  
  
Back-patch to all supported versions.  
  
Reviewed-by: Andres Freund  
Discussion: https://www.postgresql.org/message-id/[email protected]  

M src/backend/utils/time/snapmgr.c

Optimize alignment calculations in tuple form/deform

commit   : db448ce5ad36a2754e4e75900b180260143aacf8    
  
author   : David Rowley <[email protected]>    
date     : Sat, 21 Dec 2024 09:43:26 +1300    
  
committer: David Rowley <[email protected]>    
date     : Sat, 21 Dec 2024 09:43:26 +1300    

Click here for diff

Here we convert CompactAttribute.attalign from a char, which is directly  
derived from pg_attribute.attalign into a uint8, which stores the number  
of bytes to align the column's value by in the tuple.  
  
This allows tuple deformation and tuple size calculations to move away  
from using the inefficient att_align_nominal() macro, which manually  
checks each TYPALIGN_* char to translate that into the alignment bytes  
for the given type.  Effectively, this commit changes those to TYPEALIGN  
calls, which are branchless and only perform some simple arithmetic with  
some bit-twiddling.  
  
The removed branches were often mispredicted by CPUs, especially so in  
real-world tables which often contain a mishmash of different types  
with different alignment requirements.  
  
Author: David Rowley  
Reviewed-by: Andres Freund, Victor Yegorov  
Discussion: https://postgr.es/m/CAApHDvrBztXP3yx=NKNmo3xwFAFhEdyPnvrDg3=M0RhDs+4vYw@mail.gmail.com  

M contrib/amcheck/verify_heapam.c
M contrib/pageinspect/heapfuncs.c
M src/backend/access/brin/brin_tuple.c
M src/backend/access/common/attmap.c
M src/backend/access/common/heaptuple.c
M src/backend/access/common/indextuple.c
M src/backend/access/common/tupdesc.c
M src/backend/executor/execExprInterp.c
M src/backend/executor/execTuples.c
M src/backend/jit/llvm/llvmjit_deform.c
M src/include/access/tupdesc.h
M src/include/access/tupmacs.h

Mark CatalogSnapshotData static

commit   : 1f81b48a9d567ae9074ab1f3233eae9997b3d7bd    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Thu, 19 Dec 2024 18:02:11 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Thu, 19 Dec 2024 18:02:11 +0200    

Click here for diff

Like CurrentSnapshotData, it should not be accessed directly outside  
snapmgr.c.  

M src/backend/utils/time/snapmgr.c
M src/include/utils/snapmgr.h

Fix variable reference in comment

commit   : d5a7bd5670c4a59bea506f5999101a8e40ef256c    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Fri, 20 Dec 2024 19:36:33 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Fri, 20 Dec 2024 19:36:33 +0200    

Click here for diff

This used to say "nsubxcnt isn't decreased when subtransactions  
abort", but there's no variable called nsubxcnt. Commit 8548ddc61b  
changed it to "subxcnt", among other typo fixes, but that was wrong  
too: the comment actually talks about txn->nsubtxns. That's the field  
that's incremented but never decremented and is used for the  
allocation earlier in the function.  

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

Fix overflow danger in SampleHeapTupleVisible(), take 2

commit   : 94bb6c4410d81ccc019bb60d8aedb73dbc85df76    
  
author   : Melanie Plageman <[email protected]>    
date     : Fri, 20 Dec 2024 09:41:41 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Fri, 20 Dec 2024 09:41:41 -0500    

Click here for diff

28328ec87b45725 addressed one overflow danger in  
SampleHeapTupleVisible() but introduced another, albeit a less likely  
one. Modify the binary search code to remove this danger.  
  
Reported-by: Richard Guo  
Reviewed-by: Richard Guo, Ranier Vilela  
Discussion: https://postgr.es/m/CAMbWs4_bE%2BNscChbKWzw6HZOipCUyXfA5133qvoXQ654D3B2gQ%40mail.gmail.com  

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

Fix corruption when relation truncation fails.

commit   : 38c579b08988e6f1a5bd74241d0a1001421d8015    
  
author   : Thomas Munro <[email protected]>    
date     : Fri, 20 Dec 2024 21:53:25 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Fri, 20 Dec 2024 21:53:25 +1300    

Click here for diff

RelationTruncate() does three things, while holding an  
AccessExclusiveLock and preventing checkpoints:  
  
1. Logs the truncation.  
2. Drops buffers, even if they're dirty.  
3. Truncates some number of files.  
  
Step 2 could previously be canceled if it had to wait for I/O, and step  
3 could and still can fail in file APIs.  All orderings of these  
operations have data corruption hazards if interrupted, so we can't give  
up until the whole operation is done.  When dirty pages were discarded  
but the corresponding blocks were left on disk due to ERROR, old page  
versions could come back from disk, reviving deleted data (see  
pgsql-bugs #18146 and several like it).  When primary and standby were  
allowed to disagree on relation size, standbys could panic (see  
pgsql-bugs #18426) or revive data unknown to visibility management on  
the primary (theorized).  
  
Changes:  
  
 * WAL is now unconditionally flushed first  
 * smgrtruncate() is now called in a critical section, preventing  
   interrupts and causing PANIC on file API failure  
 * smgrtruncate() has a new parameter for existing fork sizes,  
   because it can't call smgrnblocks() itself inside a critical section  
  
The changes apply to RelationTruncate(), smgr_redo() and  
pg_truncate_visibility_map().  That last is also brought up to date with  
other evolutions of the truncation protocol.  
  
The VACUUM FileTruncate() failure mode had been discussed in older  
reports than the ones referenced below, with independent analysis from  
many people, but earlier theories on how to fix it were too complicated  
to back-patch.  The more recently invented cancellation bug was  
diagnosed by Alexander Lakhin.  Other corruption scenarios were spotted  
by me while iterating on this patch and earlier commit 75818b3a.  
  
Back-patch to all supported releases.  
  
Reviewed-by: Michael Paquier <[email protected]>  
Reviewed-by: Robert Haas <[email protected]>  
Reported-by: [email protected]  
Reported-by: Alexander Lakhin <[email protected]>  
Discussion: https://postgr.es/m/18146-04e908c662113ad5%40postgresql.org  
Discussion: https://postgr.es/m/18426-2d18da6586f152d6%40postgresql.org  

M contrib/pg_visibility/pg_visibility.c
M src/backend/catalog/storage.c
M src/backend/storage/smgr/md.c
M src/backend/storage/smgr/smgr.c
M src/include/storage/md.h
M src/include/storage/smgr.h

Remove pg_attribute.attcacheoff column

commit   : 02a8d0c45253eb54e57b1974c8627e5be3e1d852    
  
author   : David Rowley <[email protected]>    
date     : Fri, 20 Dec 2024 23:22:37 +1300    
  
committer: David Rowley <[email protected]>    
date     : Fri, 20 Dec 2024 23:22:37 +1300    

Click here for diff

The column is no longer needed as the offset is now cached in the  
CompactAttribute struct per commit 5983a4cff.  
  
Author: David Rowley  
Reviewed-by: Andres Freund, Victor Yegorov  
Discussion: https://postgr.es/m/CAApHDvrBztXP3yx=NKNmo3xwFAFhEdyPnvrDg3=M0RhDs+4vYw@mail.gmail.com  

M doc/src/sgml/catalogs.sgml
M src/backend/access/common/tupdesc.c
M src/backend/bootstrap/bootstrap.c
M src/backend/catalog/heap.c
M src/backend/catalog/index.c
M src/backend/utils/cache/relcache.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_attribute.h
M src/test/regress/expected/type_sanity.out
M src/test/regress/sql/type_sanity.sql

Relax regression test for fsync check of backend-level stats

commit   : 546371599e767340599cdff3e276728016e560cc    
  
author   : Michael Paquier <[email protected]>    
date     : Fri, 20 Dec 2024 19:00:18 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Fri, 20 Dec 2024 19:00:18 +0900    

Click here for diff

One test added in 9aea73fc61d4 did not take into account that the  
backend may have some fsync even after a checkpoint.  Let's relax it to  
be more flexible.  
  
Per report from buildfarm member grassquit, via Alexander Lakhin.  
  
Author: Bertrand Drouvot  
Discussion: https://postgr.es/m/[email protected]  

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

Introduce CompactAttribute array in TupleDesc, take 2

commit   : 5983a4cffc31640fda6643f10146a5b72b203eaa    
  
author   : David Rowley <[email protected]>    
date     : Fri, 20 Dec 2024 22:31:26 +1300    
  
committer: David Rowley <[email protected]>    
date     : Fri, 20 Dec 2024 22:31:26 +1300    

Click here for diff

The new compact_attrs array stores a few select fields from  
FormData_pg_attribute in a more compact way, using only 16 bytes per  
column instead of the 104 bytes that FormData_pg_attribute uses.  Using  
CompactAttribute allows performance-critical operations such as tuple  
deformation to be performed without looking at the FormData_pg_attribute  
element in TupleDesc which means fewer cacheline accesses.  
  
For some workloads, tuple deformation can be the most CPU intensive part  
of processing the query.  Some testing with 16 columns on a table  
where the first column is variable length showed around a 10% increase in  
transactions per second for an OLAP type query performing aggregation on  
the 16th column.  However, in certain cases, the increases were much  
higher, up to ~25% on one AMD Zen4 machine.  
  
This also makes pg_attribute.attcacheoff redundant.  A follow-on commit  
will remove it, thus shrinking the FormData_pg_attribute struct by 4  
bytes.  
  
Author: David Rowley  
Reviewed-by: Andres Freund, Victor Yegorov  
Discussion: https://postgr.es/m/CAApHDvrBztXP3yx=NKNmo3xwFAFhEdyPnvrDg3=M0RhDs+4vYw@mail.gmail.com  

M contrib/amcheck/verify_heapam.c
M contrib/pageinspect/gistfuncs.c
M contrib/pageinspect/heapfuncs.c
M contrib/postgres_fdw/postgres_fdw.c
M src/backend/access/brin/brin_inclusion.c
M src/backend/access/brin/brin_tuple.c
M src/backend/access/common/attmap.c
M src/backend/access/common/heaptuple.c
M src/backend/access/common/indextuple.c
M src/backend/access/common/tupdesc.c
M src/backend/access/gin/ginbulk.c
M src/backend/access/gin/ginget.c
M src/backend/access/gist/gist.c
M src/backend/access/gist/gistbuild.c
M src/backend/access/heap/heapam.c
M src/backend/access/heap/heapam_handler.c
M src/backend/access/heap/heaptoast.c
M src/backend/access/nbtree/nbtutils.c
M src/backend/access/spgist/spgdoinsert.c
M src/backend/access/spgist/spgutils.c
M src/backend/access/table/toast_helper.c
M src/backend/catalog/index.c
M src/backend/commands/copy.c
M src/backend/commands/tablecmds.c
M src/backend/executor/execExpr.c
M src/backend/executor/execExprInterp.c
M src/backend/executor/execJunk.c
M src/backend/executor/execTuples.c
M src/backend/executor/functions.c
M src/backend/executor/nodeMemoize.c
M src/backend/executor/nodeModifyTable.c
M src/backend/executor/nodeValuesscan.c
M src/backend/executor/tstoreReceiver.c
M src/backend/jit/llvm/llvmjit_deform.c
M src/backend/optimizer/util/plancat.c
M src/backend/replication/pgoutput/pgoutput.c
M src/backend/utils/adt/expandedrecord.c
M src/backend/utils/adt/ri_triggers.c
M src/backend/utils/cache/relcache.c
M src/include/access/htup_details.h
M src/include/access/itup.h
M src/include/access/tupdesc.h
M src/include/access/tupmacs.h
M src/tools/pgindent/typedefs.list

Remove final mention of FREEZE_PAGE from comments

commit   : 8ac0021b6f10928a46b7f3d1b25bc21c0ac7f8c5    
  
author   : Melanie Plageman <[email protected]>    
date     : Thu, 19 Dec 2024 18:52:19 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Thu, 19 Dec 2024 18:52:19 -0500    

Click here for diff

b7493e1ab35 removed leftover mentions of XLOG_HEAP2_FREEZE_PAGE records  
from comments but neglected to remove one mention of FREEZE_PAGE.  
  
Reported off-list by Alexander Lakhin  

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

Get rid of old version of BuildTupleHashTable().

commit   : e0a2721f7c169b50617fed797d7336cd8f10bf77    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 19 Dec 2024 18:07:00 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 19 Dec 2024 18:07:00 -0500    

Click here for diff

It was reasonable to preserve the old API of BuildTupleHashTable()  
in the back branches, but in HEAD we should actively discourage use  
of that version.  There are no remaining callers in core, so just  
get rid of it.  Then rename BuildTupleHashTableExt() back to  
BuildTupleHashTable().  
  
While at it, fix up the miserably-poorly-maintained header comment  
for BuildTupleHashTable[Ext].  It looks like more than one patch in  
this area has had the opinion that updating comments is beneath them.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/executor/execGrouping.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeRecursiveunion.c
M src/backend/executor/nodeSetOp.c
M src/backend/executor/nodeSubplan.c
M src/include/executor/executor.h

Use ExecGetCommonSlotOps infrastructure in more places.

commit   : f0b900086a370e45f730138d55da4f260d24809c    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 19 Dec 2024 17:07:14 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 19 Dec 2024 17:07:14 -0500    

Click here for diff

Append, MergeAppend, and RecursiveUnion can all use the support  
functions added in commit 276279295.  The first two can report a  
fixed result slot type if all their children return the same fixed  
slot type.  That does nothing for the append step itself, but might  
allow optimizations in the parent plan node.  RecursiveUnion can  
optimize tuple hash table operations in the same way as SetOp now  
does.  
  
Patch by me; thanks to Richard Guo and David Rowley for review.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/executor/nodeAppend.c
M src/backend/executor/nodeMergeAppend.c
M src/backend/executor/nodeRecursiveunion.c

Improve planner's handling of SetOp plans.

commit   : 8d96f57d5cc79c0c51050bb707c19bf07d2895eb    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 19 Dec 2024 17:02:25 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 19 Dec 2024 17:02:25 -0500    

Click here for diff

Remove the code for inserting flag columns in the inputs of a SetOp.  
That was the only reason why there would be resjunk columns in a  
set-operations plan tree, so we can get rid of some code that  
supported that, too.  
  
Get rid of choose_hashed_setop() in favor of building Paths for  
the hashed and sorted alternatives, and letting them fight it out  
within add_path().  
  
Remove set_operation_ordered_results_useful(), which was giving wrong  
answers due to examining the wrong ancestor node: we need to examine  
the immediate SetOperationStmt parent not the topmost node.  Instead  
make each caller of recurse_set_operations() pass down the relevant  
parent node.  (This thinko seems to have led only to wasted planning  
cycles and possibly-inferior plans, not wrong query answers.  Perhaps  
we should back-patch it, but I'm not doing so right now.)  
  
Teach generate_nonunion_paths() to consider pre-sorted inputs for  
sorted SetOps, rather than always generating a Sort node.  
  
Patch by me; thanks to Richard Guo and David Rowley for review.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/optimizer/plan/planner.c
M src/backend/optimizer/prep/prepunion.c
M src/backend/optimizer/util/pathnode.c
M src/include/optimizer/prep.h
M src/test/regress/expected/subselect.out
M src/test/regress/expected/union.out
M src/test/regress/sql/subselect.sql
M src/test/regress/sql/union.sql

Convert SetOp to read its inputs as outerPlan and innerPlan.

commit   : 27627929528e24a547d1058a5444b35491057a56    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 19 Dec 2024 16:23:45 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 19 Dec 2024 16:23:45 -0500    

Click here for diff

The original design for set operations involved appending the two  
input relations into one and adding a flag column that allows  
distinguishing which side each row came from.  Then the SetOp node  
pries them apart again based on the flag.  This is bizarre.  The  
only apparent reason to do it is that when sorting, we'd only need  
one Sort node not two.  But since sorting is at least O(N log N),  
sorting all the data is actually worse than sorting each side  
separately --- plus, we have no chance of taking advantage of  
presorted input.  On top of that, adding the flag column frequently  
requires an additional projection step that adds cycles, and then  
the Append node isn't free either.  Let's get rid of all of that  
and make the SetOp node have two separate children, using the  
existing outerPlan/innerPlan infrastructure.  
  
This initial patch re-implements nodeSetop.c and does a bare minimum  
of work on the planner side to generate correctly-shaped plans.  
In particular, I've tried not to change the cost estimates here,  
so that the visible changes in the regression test results will only  
involve removal of useless projection steps and not any changes in  
whether to use sorted vs hashed mode.  
  
For SORTED mode, we combine successive identical tuples from each  
input into groups, and then merge-join the groups.  The tuple  
comparisons now use SortSupport instead of simple equality, but  
the group-formation part should involve roughly the same number of  
tuple comparisons as before.  The cross-comparisons between left and  
right groups probably add to that, but I'm not sure to quantify how  
many more comparisons we might need.  
  
For HASHED mode, nodeSetop's logic is almost the same as before,  
just refactored into two separate loops instead of one loop that  
has an assumption that it will see all the left-hand inputs first.  
  
In both modes, I added early-exit logic to not bother reading the  
right-hand relation if the left-hand input is empty, since neither  
INTERSECT nor EXCEPT modes can produce any output if the left input  
is empty.  This could have been done before in the hashed mode, but  
not in sorted mode.  Sorted mode can also stop as soon as it exhausts  
the left input; any remaining right-hand tuples cannot have matches.  
  
Also, this patch adds some infrastructure for detecting whether  
child plan nodes all output the same type of tuple table slot.  
If they do, the hash table logic can use slightly more efficient  
code based on assuming that that's the input slot type it will see.  
We'll make use of that infrastructure in other plan node types later.  
  
Patch by me; thanks to Richard Guo and David Rowley for review.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/executor/execUtils.c
M src/backend/executor/nodeSetOp.c
M src/backend/optimizer/README
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/prep/prepunion.c
M src/backend/optimizer/util/pathnode.c
M src/include/executor/executor.h
M src/include/nodes/execnodes.h
M src/include/nodes/pathnodes.h
M src/include/nodes/plannodes.h
M src/include/optimizer/pathnode.h
M src/test/regress/expected/subselect.out
M src/test/regress/expected/union.out
M src/test/regress/sql/union.sql
M src/tools/pgindent/typedefs.list

Remove extra prefetch iterator setup for Bitmap Table Scan

commit   : 2128cebcdb2f32303baf200fa2ccb2947366c636    
  
author   : Melanie Plageman <[email protected]>    
date     : Thu, 19 Dec 2024 11:55:18 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Thu, 19 Dec 2024 11:55:18 -0500    

Click here for diff

1a0da347a7ac98db replaced Bitmap Table Scan's separate private and  
shared bitmap iterators with a unified iterator. It accidentally set up  
the prefetch iterator twice for non-parallel bitmap table scans. Remove  
the extra set up call to tbm_begin_iterate().  

M src/backend/executor/nodeBitmapHeapscan.c

Fix bitmap table scan crash on iterator release

commit   : 754c610e13b820370db4c02010a4c8c5dbd1edbd    
  
author   : Melanie Plageman <[email protected]>    
date     : Thu, 19 Dec 2024 11:55:03 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Thu, 19 Dec 2024 11:55:03 -0500    

Click here for diff

1a0da347a7ac98db replaced Bitmap Table Scan's individual private and  
shared iterators with a unified iterator. It neglected, however, to  
check if the iterator had already been cleaned up before doing so on  
rescan. Add this check both on rescan and end scan to be safe.  
  
Reported-by: Richard Guo  
Author: Richard Guo  
Discussion: https://postgr.es/m/CAMbWs48nrhcLY1kcd-u9oD%2B6yiS631F_8Fx8ZGsO-BYDwH%2Bbyw%40mail.gmail.com  

M src/backend/executor/nodeBitmapHeapscan.c
M src/backend/nodes/tidbitmap.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Avoid nbtree index scan SAOP scanBehind confusion.

commit   : 31b0a8f040042c1dfb9ac359fffbb6b8f9375999    
  
author   : Peter Geoghegan <[email protected]>    
date     : Thu, 19 Dec 2024 11:08:55 -0500    
  
committer: Peter Geoghegan <[email protected]>    
date     : Thu, 19 Dec 2024 11:08:55 -0500    

Click here for diff

Consistently reset so->scanBehind at the beginning of nbtree array  
advancement, even during sktrig_required=false calls (calls where array  
advancement is triggered by an unsatisfied non-required array scan key).  
Otherwise, it's possible for queries to fail to return all relevant  
tuples to the scan given a low-order required scan key that was  
previously deemed "satisfied" by a truncated high key attribute value.  
This only happened at the point where a later non-required array scan  
key needed to be "advanced" once on the next leaf page (that is, once  
the right sibling of the truncated high key page was reached).  
  
The underlying issue was that later code within _bt_advance_array_keys  
assumed that the so->scanBehind flag must have been set using the  
current page's high key (not the previous page's high key).  Any later  
successful recheck call to _bt_check_compare would therefore spuriously  
be prevented from making _bt_advance_array_keys return true, based on  
the faulty belief that the truncated attribute must be from the scan's  
current tuple (i.e. the non-pivot tuple at the start of the next page).  
_bt_advance_array_keys would return false for the tuple, ultimately  
resulting in _bt_checkkeys failing to return a matching tuple.  
  
Oversight in commit 5bf748b8, which enhanced nbtree ScalarArrayOp  
execution.  
  
Author: Peter Geoghegan <[email protected]>  
Discussion: https://postgr.es/m/CAH2-WzkJKncfqyAUTeuB5GgRhT1vhsWO2q11dbZNqKmvjopP_g@mail.gmail.com  
Backpatch: 17-, where commit 5bf748b8 first appears.  

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

bootstrap: pure parser and reentrant scanner

commit   : 3e4bacb171001644583ac14e29ae1b09ce818c92    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 19 Dec 2024 15:37:44 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 19 Dec 2024 15:37:44 +0100    

Click here for diff

Use the flex %option reentrant and the bison option %pure-parser to  
make the generated scanner and parser pure, reentrant, and  
thread-safe.  
  
Make the generated scanner use palloc() etc. instead of malloc() etc.  
  
For the bootstrap scanner and parser, reentrancy and memory management  
aren't that important, but we make this change here anyway so that all  
the scanners and parsers in the backend use a similar set of options  
and APIs.  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Reviewed-by: Andreas Karlsson <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M src/backend/bootstrap/bootparse.y
M src/backend/bootstrap/bootscanner.l
M src/backend/bootstrap/bootstrap.c
M src/include/bootstrap/bootstrap.h

Small whitespace improvement

commit   : 399d0f1e11b5438c6dc82e55a22a0f402855b2ac    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 19 Dec 2024 13:00:31 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 19 Dec 2024 13:00:31 +0100    

Click here for diff

Author: Andreas Karlsson <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M src/backend/replication/repl_scanner.l

Prevent redeclaration of typedef yyscan_t

commit   : 382092a0cd2c75613f3df889f7b821577e6773d7    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 19 Dec 2024 11:21:06 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 19 Dec 2024 11:21:06 +0100    

Click here for diff

Fix for 1f0de66ea2a: We need to prevent redeclaration of typedef  
yyscan_t.  (This will work with C11 but not currently with C99.)  The  
generated scanner files provide their own typedef, but we also need to  
provide one for the interfaces that we expose.  So we need to add some  
preprocessor guards to avoid a redefinition.  (This is how the  
generated scanner files do it internally as well.)  This way  
everything now works independent of the order in which things are  
included.  
  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M contrib/cube/cubedata.h
M contrib/seg/segdata.h

Add backend-level statistics to pgstats

commit   : 9aea73fc61d4e77e000724ce0b2f896590a10e03    
  
author   : Michael Paquier <[email protected]>    
date     : Thu, 19 Dec 2024 13:19:22 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Thu, 19 Dec 2024 13:19:22 +0900    

Click here for diff

This adds a new variable-numbered statistics kind in pgstats, where the  
object ID key of the stats entries is based on the proc number of the  
backends.  This acts as an upper-bound for the number of stats entries  
that can exist at once.  The entries are created when a backend starts  
after authentication succeeds, and are removed when the backend exits,  
making the stats entry exist for as long as their backend is up and  
running.  These are not written to the pgstats file at shutdown (note  
that write_to_file is disabled, as a safety measure).  
  
Currently, these stats include only information about the I/O generated  
by a backend, using the same layer as pg_stat_io, except that it is now  
possible to know how much activity is happening in each backend rather  
than an overall aggregate of all the activity.  A function called  
pg_stat_get_backend_io() is added to access this data depending on the  
PID of a backend.  The existing structure could be expanded in the  
future to add more information about other statistics related to  
backends, depending on requirements or ideas.  
  
Auxiliary processes are not included in this set of statistics.  These  
are less interesting to have than normal backends as they have dedicated  
entries in pg_stat_io, and stats kinds of their own.  
  
This commit includes also pg_stat_reset_backend_stats(), function able  
to reset all the stats associated to a single backend.  
  
Bump catalog version and PGSTAT_FILE_FORMAT_ID.  
  
Author: Bertrand Drouvot  
Reviewed-by: Álvaro Herrera, Kyotaro Horiguchi, Michael Paquier, Nazir  
Bilal Yavuz  
Discussion: https://postgr.es/m/ZtXR+CtkEVVE/[email protected]  

M doc/src/sgml/config.sgml
M doc/src/sgml/monitoring.sgml
M src/backend/catalog/system_functions.sql
M src/backend/utils/activity/Makefile
M src/backend/utils/activity/backend_status.c
M src/backend/utils/activity/meson.build
M src/backend/utils/activity/pgstat.c
A src/backend/utils/activity/pgstat_backend.c
M src/backend/utils/activity/pgstat_io.c
M src/backend/utils/activity/pgstat_relation.c
M src/backend/utils/adt/pgstatfuncs.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.dat
M src/include/pgstat.h
M src/include/utils/pgstat_internal.h
M src/test/regress/expected/stats.out
M src/test/regress/sql/stats.sql
M src/tools/pgindent/typedefs.list

Extract logic filling pg_stat_get_io()'s tuplestore into its own routine

commit   : ff7c40d7fd6a218f31fcf6f2c23c544c85934b24    
  
author   : Michael Paquier <[email protected]>    
date     : Thu, 19 Dec 2024 10:16:02 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Thu, 19 Dec 2024 10:16:02 +0900    

Click here for diff

This commit adds pg_stat_io_build_tuples(), a helper routine for  
pg_stat_get_io(), that fills its result tuplestore based on the contents  
of PgStat_BktypeIO.  This will be used in a follow-up commit that uses  
the same structures as pg_stat_io for reporting, including the same  
object types and contexts, but for a different statistics kind.  
  
Author: Bertrand Drouvot, Michael Paquier  
Discussion: https://postgr.es/m/ZtXR+CtkEVVE/[email protected]  

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

Optimize grouping equality checks with virtual slots

commit   : 08cdb079d4a8a82c687321e9ffe0a3d3fbcc0551    
  
author   : David Rowley <[email protected]>    
date     : Thu, 19 Dec 2024 13:57:21 +1300    
  
committer: David Rowley <[email protected]>    
date     : Thu, 19 Dec 2024 13:57:21 +1300    

Click here for diff

8f4ee9626 fixed an old Assert failure that could happen when the slot  
type used to look up the hash table for BuildTupleHashTableExt() users  
wasn't a TTSOpsMinimalTuple slot.  The fix for that in the back branches  
had to be to pass the TupleTableSlotOps as NULL, however in master,  
since we have the inputOps parameter as was added by d96d1d515, we can  
pass that down instead.  
  
At least one caller uses a fixed slot that's always TTSOpsVirtual, so  
passing down inputOps for these cases allows ExecBuildGroupingEqual() to  
skip adding the EEOP_INNER_FETCHSOME ExprEvalStep.  
  
This should increase the performance of hashed subplans very slightly.  
  
Author: Tom Lane, David Rowley  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/executor/execGrouping.c

Fix Assert failure in WITH RECURSIVE UNION queries

commit   : 8f4ee962691ed36302be3333c65422ed9e082743    
  
author   : David Rowley <[email protected]>    
date     : Thu, 19 Dec 2024 13:11:39 +1300    
  
committer: David Rowley <[email protected]>    
date     : Thu, 19 Dec 2024 13:11:39 +1300    

Click here for diff

If the non-recursive part of a recursive CTE ended up using  
TTSOpsBufferHeapTuple as the table slot type, then a duplicate value  
could cause an Assert failure in CheckOpSlotCompatibility() when  
checking the hash table for the duplicate value.  The expected slot type  
for the deform step was TTSOpsMinimalTuple so the Assert failed when the  
TTSOpsBufferHeapTuple slot was used.  
  
This is a long-standing bug which we likely didn't notice because it  
seems much more likely that the non-recursive term would have required  
projection and used a TTSOpsVirtual slot, which CheckOpSlotCompatibility  
is ok with.  
  
There doesn't seem to be any harm done here other than the Assert  
failure.  Both TTSOpsMinimalTuple and TTSOpsBufferHeapTuple slot types  
require tuple deformation, so the EEOP_*_FETCHSOME ExprState step would  
have properly existed in the ExprState.  
  
The solution is to pass NULL for the ExecBuildGroupingEqual's 'lops'  
parameter.  This means the ExprState's EEOP_*_FETCHSOME step won't  
expect a fixed slot type.  This makes CheckOpSlotCompatibility() happy as  
no checking is performed when the ExprEvalStep is not expecting a fixed  
slot type.  
  
Reported-by: Richard Guo  
Reviewed-by: Tom Lane  
Discussion: https://postgr.es/m/CAMbWs4-8U9q2LAtf8+ghV11zeUReA3AmrYkxzBEv0vKnDxwkKA@mail.gmail.com  
Backpatch-through: 13, all supported versions  

M src/backend/executor/execGrouping.c
M src/test/regress/expected/with.out
M src/test/regress/sql/with.sql

Remove leftover mentions of XLOG_HEAP2_FREEZE_PAGE records

commit   : b7493e1ab353349855f553a4b4bee094cda4d9cc    
  
author   : Melanie Plageman <[email protected]>    
date     : Wed, 18 Dec 2024 18:47:21 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Wed, 18 Dec 2024 18:47:21 -0500    

Click here for diff

f83d709760d merged the separate XLOG_HEAP2_FREEZE_PAGE records into a  
new combined prune, freeze, and vacuum record with opcode  
XLOG_HEAP2_PRUNE_VACUUM_SCAN. Remove the last few references to  
XLOG_HEAP2_FREEZE_PAGE records which were accidentally left behind.  
  
Reported-by: Tomas Vondra  
Reviewed-by: Robert Haas  
Discussion: https://postgr.es/m/CA%2BTgmoY1tYff-1CEn8kYt5FsOrynTbtr%3DUZw%3D7mTC1Hv1HpeBQ%40mail.gmail.com  

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

Bitmap Table Scans use unified TBMIterator

commit   : 1a0da347a7ac98db6964feb5e3063fc6e8fc92a0    
  
author   : Melanie Plageman <[email protected]>    
date     : Wed, 18 Dec 2024 18:43:39 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Wed, 18 Dec 2024 18:43:39 -0500    

Click here for diff

With the repurposing of TBMIterator as an interface for both parallel  
and serial iteration through TIDBitmaps in commit 7f9d4187e7bab10329cc,  
bitmap table scans may now use it.  
  
Modify bitmap table scan code to use the TBMIterator. This requires  
moving around a bit of code, so a few variables are initialized  
elsewhere.  
  
Author: Melanie Plageman  
Reviewed-by: Tomas Vondra  
Discussion: https://postgr.es/m/c736f6aa-8b35-4e20-9621-62c7c82e2168%40vondra.me  

M src/backend/access/heap/heapam_handler.c
M src/backend/executor/nodeBitmapHeapscan.c
M src/include/access/relscan.h
M src/include/access/tableam.h
M src/include/nodes/execnodes.h
M src/include/nodes/tidbitmap.h

Add common interface for TBMIterators

commit   : 7f9d4187e7bab10329cc00aff34cfba08248d4be    
  
author   : Melanie Plageman <[email protected]>    
date     : Wed, 18 Dec 2024 18:19:28 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Wed, 18 Dec 2024 18:19:28 -0500    

Click here for diff

Add and use TBMPrivateIterator, which replaces the current TBMIterator  
for serial use cases, and repurpose TBMIterator to be a unified  
interface for both the serial ("private") and parallel ("shared") TID  
Bitmap iterator interfaces. This encapsulation simplifies call sites for  
callers supporting both parallel and serial TID Bitmap access.  
TBMIterator is not yet used in this commit.  
  
Author: Melanie Plageman  
Reviewed-by: Tomas Vondra, Heikki Linnakangas  
Discussion: https://postgr.es/m/063e4eb4-32d9-439e-a0b1-75565a9835a8%40iki.fi  

M src/backend/access/gin/ginget.c
M src/backend/access/gin/ginscan.c
M src/backend/access/heap/heapam_handler.c
M src/backend/executor/nodeBitmapHeapscan.c
M src/backend/nodes/tidbitmap.c
M src/include/access/gin_private.h
M src/include/access/relscan.h
M src/include/nodes/execnodes.h
M src/include/nodes/tidbitmap.h
M src/tools/pgindent/typedefs.list

Fix overflow danger in SampleHeapTupleVisible()

commit   : 28328ec87b45725f62bed1104d99c8b3220d1675    
  
author   : Melanie Plageman <[email protected]>    
date     : Wed, 18 Dec 2024 18:16:43 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Wed, 18 Dec 2024 18:16:43 -0500    

Click here for diff

68d9662be1c4b70 made HeapScanDesc->rs_ntuples unsigned but neglected to  
change how it was being used in SampleHeapTupleVisible().  
  
Return early if rs_ntuples is 0 to avoid overflowing and incorrectly  
executing the loop code in SampleHeapTupleVisible().  
  
Reported-by: Ranier Vilela  
Discussion: https://postgr.es/m/CAEudQAot_xQoZyPZjpj1aBUPrPykY5mOPHGyvfe%3Djz%2BWowdA3A%40mail.gmail.com  

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

Make rs_cindex and rs_ntuples unsigned

commit   : 68d9662be1c4b705123a0e292974fb4be661294c    
  
author   : Melanie Plageman <[email protected]>    
date     : Wed, 18 Dec 2024 11:47:38 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Wed, 18 Dec 2024 11:47:38 -0500    

Click here for diff

HeapScanDescData.rs_cindex and rs_ntuples can't be less than 0. All scan  
types using the heap scan descriptor expect these values to be >= 0.  
Make that expectation clear by making rs_cindex and rs_ntuples unsigned.  
  
Also remove the test in heapam_scan_bitmap_next_tuple() that checks if  
rs_cindex < 0. This was never true, but now that rs_cindex is unsigned,  
it makes even less sense.  
  
While we are at it, initialize both rs_cindex and rs_ntuples to 0 in  
initscan().  
  
Author: Melanie Plageman  
Reviewed-by: Dilip Kumar  
Discussion: https://postgr.es/m/CAAKRu_ZxF8cDCM_BFi_L-t%3DRjdCZYP1usd1Gd45mjHfZxm0nZw%40mail.gmail.com  

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

seg: pure parser and reentrant scanner

commit   : 1f0de66ea2a5549a3768c67434e28a136c280571    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 18 Dec 2024 08:47:53 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 18 Dec 2024 08:47:53 +0100    

Click here for diff

Use the flex %option reentrant and the bison option %pure-parser to  
make the generated scanner and parser pure, reentrant, and  
thread-safe.  
  
Make the generated scanner use palloc() etc. instead of malloc() etc.  
Previously, we only used palloc() for the buffer, but flex would still  
use malloc() for its internal structures.  As a result, there could be  
some small memory leaks in case of uncaught errors.  (We do catch  
normal syntax errors as soft errors.)  Now, all the memory is under  
palloc() control, so there are no more such issues.  
  
Simplify flex scan buffer management: Instead of constructing the  
buffer from pieces and then using yy_scan_buffer(), we can just use  
yy_scan_string(), which does the same thing internally.  
  
The previous code was necessary because we allocated the buffer with  
palloc() and the rest of the state was handled by malloc().  But this  
is no longer the case; everything is under palloc() now.  
  
(We could even get rid of the yylex_destroy() call and just let the  
memory context cleanup handle everything.  But for now, we preserve  
the existing behavior.)  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Reviewed-by: Andreas Karlsson <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

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

cube: pure parser and reentrant scanner

commit   : 802fe923e3cd4b2f51080ed1a9a0958024b00479    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 18 Dec 2024 08:47:34 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 18 Dec 2024 08:47:34 +0100    

Click here for diff

Use the flex %option reentrant and the bison option %pure-parser to  
make the generated scanner and parser pure, reentrant, and  
thread-safe.  
  
Make the generated scanner use palloc() etc. instead of malloc() etc.  
Previously, we only used palloc() for the buffer, but flex would still  
use malloc() for its internal structures.  As a result, there could be  
some small memory leaks in case of uncaught errors.  (We do catch  
normal syntax errors as soft errors.)  Now, all the memory is under  
palloc() control, so there are no more such issues.  
  
Simplify flex scan buffer management: Instead of constructing the  
buffer from pieces and then using yy_scan_buffer(), we can just use  
yy_scan_string(), which does the same thing internally.  (Actually, we  
use yy_scan_bytes() here because we already have the length.)  
  
The previous code was necessary because we allocated the buffer with  
palloc() and the rest of the state was handled by malloc().  But this  
is no longer the case; everything is under palloc() now.  
  
(We could even get rid of the yylex_destroy() call and just let the  
memory context cleanup handle everything.  But for now, we preserve  
the existing behavior.)  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Reviewed-by: Andreas Karlsson <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M contrib/cube/cube.c
M contrib/cube/cubedata.h
M contrib/cube/cubeparse.y
M contrib/cube/cubescan.l

psql: Add more information about service name

commit   : 477728b5d6fa16461b81cd22b0568fec1eab97ac    
  
author   : Michael Paquier <[email protected]>    
date     : Wed, 18 Dec 2024 15:16:12 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Wed, 18 Dec 2024 15:16:12 +0900    

Click here for diff

This commit adds support for the following items in psql, able to show a  
service name, when available:  
- Variable SERVICE.  
- Substitution %s in PROMPT{1,2,3}.  
  
This relies on 4b99fed7541e, that has made the service name available in  
PGconn for libpq.  
  
Author: Michael Banck  
Reviewed-by: Greg Sabino Mullane  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/ref/psql-ref.sgml
M src/bin/psql/command.c
M src/bin/psql/prompt.c

libpq: Add service name to PGconn and PQservice()

commit   : 4b99fed7541e330b669fe488a274c0c69490391c    
  
author   : Michael Paquier <[email protected]>    
date     : Wed, 18 Dec 2024 14:53:42 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Wed, 18 Dec 2024 14:53:42 +0900    

Click here for diff

This commit adds one field to PGconn for the database service name (if  
any), with PQservice() as routine to retrieve it.  Like the other  
routines of this area, NULL is returned as result if the connection is  
NULL.  
  
A follow-up patch will make use of this feature to be able to display  
the service name in the psql prompt.  
  
Author: Michael Banck  
Reviewed-by: Greg Sabino Mullane  
Discusion: https://postgr.es/m/[email protected]  

M doc/src/sgml/libpq.sgml
M src/interfaces/libpq/exports.txt
M src/interfaces/libpq/fe-connect.c
M src/interfaces/libpq/libpq-fe.h
M src/interfaces/libpq/libpq-int.h

Fix memory leak in pg_restore with zstd-compressed data.

commit   : 3f06324705aeb5a4c67b6c08f2016c4c3c756723    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 17 Dec 2024 22:31:26 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 17 Dec 2024 22:31:26 -0500    

Click here for diff

EndCompressorZstd() neglected to free everything.  This was  
most visible with a lot of large objects in the dump.  
  
Per report from Tomasz Szypowski.  Back-patch to v16  
where this code came in.  
  
Discussion: https://postgr.es/m/DU0PR04MB94193D038A128EF989F922D199042@DU0PR04MB9419.eurprd04.prod.outlook.com  

M src/bin/pg_dump/compress_zstd.c

Fix incorrect slot type in BuildTupleHashTableExt

commit   : d96d1d5152f30d15678e08e75b42756101b7cab6    
  
author   : David Rowley <[email protected]>    
date     : Wed, 18 Dec 2024 12:05:55 +1300    
  
committer: David Rowley <[email protected]>    
date     : Wed, 18 Dec 2024 12:05:55 +1300    

Click here for diff

0f5738202 adjusted the execGrouping.c code so it made use of ExprStates to  
generate hash values.  That commit made a wrong assumption that the slot  
type to pass to ExecBuildHash32FromAttrs() is always &TTSOpsMinimalTuple.  
That's not the case as the slot type depends on the slot type passed to  
LookupTupleHashEntry(), which for nodeRecursiveunion.c, could be any of  
the current slot types.  
  
Here we fix this by adding a new parameter to BuildTupleHashTableExt()  
to allow the slot type to be passed in.  In the case of nodeSubplan.c  
and nodeAgg.c the slot type is always &TTSOpsVirtual, so for both of  
those cases, it's beneficial to pass the known slot type as that allows  
ExecBuildHash32FromAttrs() to skip adding the tuple deform step to the  
resulting ExprState.  Another possible fix would have been to have  
ExecBuildHash32FromAttrs() set "fetch.kind" to NULL so that  
ExecComputeSlotInfo() always determines the EEOP_INNER_FETCHSOME is  
required, however, that option isn't favorable as slows down aggregation  
and hashed subplan evaluation due to the extra (needless) deform step.  
  
Thanks to Nathan Bossart for bisecting to find the offending commit  
based on Paul's report.  
  
Reported-by: Paul Ramsey <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/executor/execGrouping.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeRecursiveunion.c
M src/backend/executor/nodeSetOp.c
M src/backend/executor/nodeSubplan.c
M src/include/executor/executor.h
M src/test/regress/expected/with.out
M src/test/regress/sql/with.sql

Accommodate very large dshash tables.

commit   : 84f1b0b031e6914c41623102b93fed8ab0e51253    
  
author   : Nathan Bossart <[email protected]>    
date     : Tue, 17 Dec 2024 15:24:45 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Tue, 17 Dec 2024 15:24:45 -0600    

Click here for diff

If a dshash table grows very large (e.g., the dshash table for  
cumulative statistics when there are millions of tables), resizing  
it may fail with an error like:  
  
	ERROR: invalid DSA memory alloc request size 1073741824  
  
To fix, permit dshash resizing to allocate more than 1 GB by  
providing the DSA_ALLOC_HUGE flag.  
  
Reported-by: Andreas Scherbaum  
Author: Matthias van de Meent  
Reviewed-by: Cédric Villemain, Michael Paquier, Andres Freund  
Discussion: https://postgr.es/m/80a12d59-0d5e-4c54-866c-e69cd6536471%40pgug.de  
Backpatch-through: 13  

M src/backend/lib/dshash.c

Skip useless calculation of join RTE column names during EXPLAIN.

commit   : 7a80e381d16c642d00ec6146ccdf1262a159c69e    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 17 Dec 2024 15:52:05 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 17 Dec 2024 15:52:05 -0500    

Click here for diff

There's no need for set_simple_column_names() to compute unique  
column names for join RTEs, because a finished plan tree will  
not contain any join alias Vars that we could need names for.  
Its other, internal callers will not pass it any join RTEs  
anyway, so the upshot is we can just skip join RTEs here.  
  
Aside from getting rid of a klugy against-its-documentation use of  
set_relation_column_names, this can speed up EXPLAIN substantially  
when considering many-join queries, because the upper join RTEs  
tend to have a lot of columns.  
  
Sami Imseih, with cosmetic changes by me  
  
Discussion: https://postgr.es/m/CAA5RZ0th3q-0p1pri58z9grG8r8azmEBa8o1rtkwhLmJg_cH+g@mail.gmail.com  

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

Count pages set all-visible and all-frozen in VM during vacuum

commit   : dc6acfd910b868351f115382fd92f95e5345992c    
  
author   : Melanie Plageman <[email protected]>    
date     : Tue, 17 Dec 2024 14:13:27 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Tue, 17 Dec 2024 14:13:27 -0500    

Click here for diff

Heap vacuum already counts and logs pages with newly frozen tuples. Now  
count and log the number of pages newly set all-visible and all-frozen  
in the visibility map.  
  
Pages that are all-visible but not all-frozen are debt for future  
aggressive vacuums. The counts of newly all-visible and all-frozen pages  
give us insight into the rate at which this debt is being accrued and  
paid down.  
  
Author: Melanie Plageman  
Reviewed-by: Masahiko Sawada, Alastair Turner, Nitin Jadhav, Andres Freund, Bilal Yavuz, Tomas Vondra  
Discussion: https://postgr.es/m/flat/CAAKRu_ZQe26xdvAqo4weHLR%3DivQ8J4xrSfDDD8uXnh-O-6P6Lg%40mail.gmail.com#6d8d2b4219394f774889509bf3bdc13d,  
https://postgr.es/m/ctdjzroezaxmiyah3gwbwm67defsrwj2b5fpfs4ku6msfpxeia%40mwjyqlhwr2wu  

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

Make visibilitymap_set() return previous state of vmbits

commit   : 4b565a198b524469df9f3286a6f12778acd9d564    
  
author   : Melanie Plageman <[email protected]>    
date     : Tue, 17 Dec 2024 14:13:18 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Tue, 17 Dec 2024 14:13:18 -0500    

Click here for diff

It can be useful to know the state of a relation page's VM bits before  
visibilitymap_set(). visibilitymap_set() has the old value on hand, so  
returning it is simple. This commit does not use visibilitymap_set()'s  
new return value.  
  
Author: Melanie Plageman  
Reviewed-by: Masahiko Sawada, Andres Freund, Nitin Jadhav, Bilal Yavuz  
Discussion: https://postgr.es/m/flat/CAAKRu_ZQe26xdvAqo4weHLR%3DivQ8J4xrSfDDD8uXnh-O-6P6Lg%40mail.gmail.com#6d8d2b4219394f774889509bf3bdc13d,  
https://postgr.es/m/ctdjzroezaxmiyah3gwbwm67defsrwj2b5fpfs4ku6msfpxeia%40mwjyqlhwr2wu  

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

Rename LVRelState->frozen_pages

commit   : f020baa0662c73aa7e470b1e3856281199ce1ee4    
  
author   : Melanie Plageman <[email protected]>    
date     : Tue, 17 Dec 2024 14:13:00 -0500    
  
committer: Melanie Plageman <[email protected]>    
date     : Tue, 17 Dec 2024 14:13:00 -0500    

Click here for diff

Rename frozen_pages to new_frozen_tuple_pages in LVRelState, the struct  
used for tracking state during vacuuming of a heap relation.  
frozen_pages sounds like it tracks pages set all-frozen. That is a  
misnomer. It only includes pages with at least one newly frozen tuple.  
It also includes pages that are not all-frozen.  
  
Author: Melanie Plageman  
Reviewed-by: Andres Freund, Masahiko Sawada, Nitin Jadhav, Bilal Yavuz  
  
Discussion: https://postgr.es/m/ctdjzroezaxmiyah3gwbwm67defsrwj2b5fpfs4ku6msfpxeia%40mwjyqlhwr2wu  

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

Set max_safe_fds whenever we create shared memory and semaphores.

commit   : 21fb39cb07938d29f2c7cfcf627d1b3d6b48e61c    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 17 Dec 2024 12:23:26 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 17 Dec 2024 12:23:26 -0500    

Click here for diff

Formerly we skipped this in bootstrap/check mode and in single-user  
mode.  That's bad in check mode because it may allow accepting a  
value of max_connections that doesn't actually work: on platforms  
where semaphores consume file descriptors, there may not be enough  
free FDs left over to satisfy fd.c, causing postmaster start to  
fail.  It's also not great in single-user mode, because fd.c will  
operate with just the minimum allowable value of max_safe_fds,  
resulting in excess file open/close overhead if anything moderately  
complicated is done in single-user mode.  (There may be some penalty  
for bootstrap mode too, though probably not much.)  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/bootstrap/bootstrap.c
M src/backend/tcop/postgres.c

Set the stack_base_ptr in main(), not in random other places.

commit   : c91963da1302e8dd490bde115f3956f7d2f1258d    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 17 Dec 2024 12:08:39 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 17 Dec 2024 12:08:39 -0500    

Click here for diff

Previously we did this in PostmasterMain() and InitPostmasterChild(),  
which meant that stack depth checking was disabled in non-postmaster  
server processes, for instance in single-user mode.  That seems like  
a fairly bad idea, since there's no a-priori restriction on the  
complexity of queries we will run in single-user mode.  Moreover, this  
led to not having quite the same stack depth limit in all processes,  
which likely has no real-world effect but it offends my inner neatnik.  
Setting the depth in main() guarantees that check_stack_depth() is  
armed and has a consistent interpretation of stack depth in all forms  
of server processes.  
  
While at it, move the code associated with checking the stack depth  
out of tcop/postgres.c (which was never a great home for it) into  
a new file src/backend/utils/misc/stack_depth.c.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/main/main.c
M src/backend/postmaster/postmaster.c
M src/backend/tcop/postgres.c
M src/backend/utils/init/miscinit.c
M src/backend/utils/misc/Makefile
M src/backend/utils/misc/meson.build
A src/backend/utils/misc/stack_depth.c
M src/include/miscadmin.h
M src/include/tcop/tcopprot.h

Detect version mismatch in brin_page_items

commit   : 957ba9ff14066782a42ebb974913b2fc616c99e1    
  
author   : Tomas Vondra <[email protected]>    
date     : Tue, 17 Dec 2024 16:47:23 +0100    
  
committer: Tomas Vondra <[email protected]>    
date     : Tue, 17 Dec 2024 16:47:23 +0100    

Click here for diff

Commit dae761a87ed modified brin_page_items() to return the new "empty"  
flag for each BRIN range. But the new output parameter was added in the  
middle, which may cause crashes when using the new binary with old  
function definition.  
  
The ideal solution would be to introduce API versioning similar to what  
pg_stat_statements does, but it's too late for that as PG17 was already  
released (so we can't introduce a new extension version). We could do  
something similar in brin_page_items() by checking the number of output  
columns (and ignoring the new flag), but it doesn't seem very nice.  
  
Instead, simply error out and suggest updating the extension to the  
latest version. pageinspect is a superuser-only extension, and there's  
not much reason to run an older version. Moreover, there's a precedent  
for this approach in 691e8b2e18.  
  
Reported by Ľuboslav Špilák, investigation and patch by me. Backpatch to  
17, same as dae761a87ed.  
  
Reported-by: Ľuboslav Špilák  
Reviewed-by: Michael Paquier, Hayato Kuroda, Peter Geoghegan  
Backpatch-through: 17  
Discussion: https://postgr.es/m/VI1PR02MB63331C3D90E2104FD12399D38A5D2@VI1PR02MB6333.eurprd02.prod.outlook.com  
Discussion: https://postgr.es/m/flat/[email protected]  

M contrib/pageinspect/brinfuncs.c
M contrib/pageinspect/expected/oldextversions.out
M contrib/pageinspect/sql/oldextversions.sql

Update comments about index parallel builds

commit   : 8cd44db42a40056a701a4ae03d73bf2cd05781b1    
  
author   : Tomas Vondra <[email protected]>    
date     : Tue, 17 Dec 2024 15:40:07 +0100    
  
committer: Tomas Vondra <[email protected]>    
date     : Tue, 17 Dec 2024 15:40:07 +0100    

Click here for diff

Commit b43757171470 allowed parallel builds for BRIN, but left behind  
two comments claiming only btree indexes support parallel builds.  
  
Reported by Egor Rogov, along with similar issues in SGML docs.  
Backpatch to 17, where parallel builds for BRIN were introduced.  
  
Reported-by: Egor Rogov  
Backpatch-through: 17  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/catalog/index.c
M src/backend/optimizer/plan/planner.c

Remove ts_locale.c's lowerstr()

commit   : fb1a18810f07fc3b722392103d67ce8ed188b63d    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 17 Dec 2024 14:04:55 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 17 Dec 2024 14:04:55 +0100    

Click here for diff

lowerstr() and lowerstr_with_len() in ts_locale.c do the same thing as  
str_tolower() that the rest of the system uses, except that the former  
don't use the common locale provider framework but instead use the  
global libc locale settings.  
  
This patch replaces uses of lowerstr*() with str_tolower(...,  
DEFAULT_COLLATION_OID).  For instances that use a libc locale  
globally, this will result in exactly the same behavior.  For  
instances that use other locale providers, you now get consistent  
behavior and are no longer dependent on the libc locale settings (for  
this case; there are others).  
  
Most uses of these functions are for processing dictionary and  
configuration files.  In those cases, using the default collation  
seems appropriate.  At least we don't have a more specific collation  
available.  But the code in contrib/pg_trgm should really depend on  
the collation of the columns being processed.  This is not done here,  
this can be done in a separate patch.  
  
(You can probably construct some edge cases where this change would  
create some locale-related upgrade incompatibility, for example if  
before you used a combination of ICU and a differently-behaving libc  
locale.  We can document this in the release notes, but I don't think  
there is anything more we can do about this.)  
  
Reviewed-by: Jeff Davis <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/653f3b84-fc87-45a7-9a0c-bfb4fcab3e7d%40eisentraut.org  

M contrib/dict_xsyn/dict_xsyn.c
M contrib/pg_trgm/trgm_op.c
M contrib/pg_trgm/trgm_regexp.c
M src/backend/snowball/dict_snowball.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/spell.c
M src/backend/tsearch/ts_locale.c
M src/backend/tsearch/ts_utils.c
M src/include/tsearch/ts_locale.h
M src/include/tsearch/ts_public.h

Remove ts_locale.c's t_isdigit(), t_isspace(), t_isprint()

commit   : d3aad4ac57c5592ade77916404e6d8a989a1d6a1    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 17 Dec 2024 12:48:58 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 17 Dec 2024 12:48:58 +0100    

Click here for diff

These do the same thing as the standard isdigit(), isspace(), and  
isprint() but with multibyte and encoding support.  But all the  
callers are only interested in analyzing single-byte ASCII characters.  
So this extra layer is overkill and we can replace the uses with the  
standard functions.  
  
All the t_is*() functions in ts_locale.c are under scrutiny because  
they don't use the common locale provider framework but instead use  
the global libc locale settings.  For the functions being touched by  
this patch, we don't need all that anyway, as mentioned above, so the  
simplest solution is to just remove them.  The few remaining t_is*()  
functions will need a different treatment in a separate patch.  
  
pg_trgm has some compile-time options with macros such as  
KEEPONLYALNUM.  These are not documented, and the non-default variant  
is not supported by any test cases.  As part of this undertaking, I'm  
removing the non-default variant, as it is in the way of cleanup.  So  
in this case, the not-KEEPONLYALNUM code path is gone.  
  
Reviewed-by: Jeff Davis <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/653f3b84-fc87-45a7-9a0c-bfb4fcab3e7d%40eisentraut.org  

M contrib/dict_xsyn/dict_xsyn.c
M contrib/ltree/ltree_io.c
M contrib/ltree/ltxtquery_io.c
M contrib/pg_trgm/trgm.h
M contrib/unaccent/unaccent.c
M src/backend/tsearch/dict_synonym.c
M src/backend/tsearch/dict_thesaurus.c
M src/backend/tsearch/spell.c
M src/backend/tsearch/ts_locale.c
M src/backend/tsearch/ts_utils.c
M src/backend/utils/adt/tsquery.c
M src/backend/utils/adt/tsvector_parser.c
M src/include/tsearch/ts_locale.h

Avoid unnecessary wrapping for more complex expressions

commit   : 60be3f9f0a64a071822c0711f69c7b5f6467d84f    
  
author   : Richard Guo <[email protected]>    
date     : Tue, 17 Dec 2024 19:53:01 +0900    
  
committer: Richard Guo <[email protected]>    
date     : Tue, 17 Dec 2024 19:53:01 +0900    

Click here for diff

When pulling up a subquery that is under an outer join, if the  
subquery's target list contains a strict expression that uses a  
subquery variable, it's okay to pull up the expression without  
wrapping it in a PlaceHolderVar: if the subquery variable is forced to  
NULL by the outer join, the expression result will come out as NULL  
too.  
  
If the strict expression does not contain any subquery variables, the  
current code always wraps it in a PlaceHolderVar.  While this is not  
incorrect, the analysis could be tighter: if the strict expression  
contains any variables of rels that are under the same lowest nulling  
outer join as the subquery, we can also avoid wrapping it.  This is  
safe because if the subquery variable is forced to NULL by the outer  
join, the variables of rels that are under the same lowest nulling  
outer join will also be forced to NULL, resulting in the expression  
evaluating to NULL as well.  Therefore, it's not necessary to force  
the expression to be evaluated below the outer join.  It could be  
beneficial to get rid of such PHVs because they could imply lateral  
dependencies, which force us to resort to nestloop joins.  
  
This patch checks if the lateral references in the strict expression  
contain any variables of rels under the same lowest nulling outer join  
as the subquery, and avoids wrapping the expression in that case.  
  
This is fundamentally a generalization of the optimizations for bare  
Vars and PHVs introduced in commit f64ec81a8.  
  
No backpatch as this could result in plan changes.  
  
Author: Richard Guo  
Discussion: https://postgr.es/m/CAMbWs4_ENtfRdLaM_bXAxiKRYO7DmwDBDG4_2=VTDi0mJP-jAw@mail.gmail.com  

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

commit   : 2364f61488ec1b4bc40d3a73dba4385e8ede65a0    
  
author   : Amit Kapila <[email protected]>    
date     : Tue, 17 Dec 2024 15:08:29 +0530    
  
committer: Amit Kapila <[email protected]>    
date     : Tue, 17 Dec 2024 15:08:29 +0530    

Click here for diff

Commit 84db9a0eb1 has added the incorrect link to  
'initial data synchronization'. It was a subsection of Row Filter and  
didn't provide the required information.  
  
Author: Peter Smith  
Reviewed-by: Vignesh C, Pavel Luzanov  
Backpatch-through: 17, where it was introduced  
Discussion: https://postgr.es/m/CAHut+PtnA4DB_pcv4TDr4NjUSM1=P2N_cuZx5DX09k7LVmaqUA@mail.gmail.com  

M doc/src/sgml/ref/pg_createsubscriber.sgml

commit   : fee2b3ea2ecd0da0c88832b37ac0d9f6b3bfb9a9    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 17 Dec 2024 14:32:35 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 17 Dec 2024 14:32:35 +0900    

Click here for diff

These comments referred to database objects, but depending on the stats  
kind dealt with this may not be true.  
  
Issues found while reviewing a different patch in this area.  
  
Discussion: https://postgr.es/m/ZtXR+CtkEVVE/[email protected]  

M src/backend/utils/activity/pgstat.c

Print out error position for some more DDLs

commit   : 0f23dedc91760271aefe9e3c52d677c079bb7bce    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 17 Dec 2024 09:44:06 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 17 Dec 2024 09:44:06 +0900    

Click here for diff

The following commands gain some information about the error position in  
the query, should they fail when looking at the type used:  
- CREATE TYPE (LIKE)  
- CREATE TABLE OF  
  
Both are related to typenameType() where the type name lookup is done.  
These calls gain the ParseState that already exists in these paths.  
  
Author: Kirill Reshke, Jian He  
Reviewed-by: Álvaro Herrera, Michael Paquier  
Discussion: https://postgr.es/m/CALdSSPhqfvKbDwqJaY=yEePi_aq61GmMpW88i6ZH7CMG_2Z4Cg@mail.gmail.com  

M src/backend/commands/typecmds.c
M src/backend/parser/parse_utilcmd.c
M src/test/regress/expected/float8.out
M src/test/regress/expected/typed_table.out

pg_combinebackup: Fix PITR comparison test in 002_compare_backups

commit   : e116b703f0b9b551cb413c8f2cfe231a9ce73f42    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 17 Dec 2024 09:23:49 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 17 Dec 2024 09:23:49 +0900    

Click here for diff

The test was creating both the dumps to compare from the same database  
on the same node, so it would never detect any mismatches when comparing  
the logical dumps of the two servers.  
  
Fixing this issue has revealed that there is a difference in the dumps:  
the tablespaces paths are different.  This commit uses compare_text()  
with a custom comparison function to erase the difference (slightly  
tweaked to be able to work with WIN32 and non-WIN32 paths).  This way,  
the non-relevant parts of the tablespace path are ignored from the check  
with the basic structure of the query string still compared.  
  
Author: Dagfinn Ilmari Mannsåker  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 17  

M src/bin/pg_combinebackup/t/002_compare_backups.pl

doc: Mention BRIN indexes support parallel builds

commit   : 0cc7da4e234c3027cc1f96ffcb1365bf96301587    
  
author   : Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 19:08:52 +0100    
  
committer: Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 19:08:52 +0100    

Click here for diff

Two places in the documentation suggest B-tree is the only index access  
method allowing parallel builds. Commit b4375717 added parallel builds  
for BRIN too, but failed to update the docs. So fix that, and backpatch  
to 17, where parallel BRIN builds were introduced.  
  
Author: Egor Rogov  
Backpatch-through: 17  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/config.sgml
M doc/src/sgml/ref/create_index.sgml

psql: Tab completion for JOIN ... USING column list

commit   : 3429145d42e0aee0565328c8ca8378ed17b300dc    
  
author   : Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 18:12:29 +0100    
  
committer: Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 18:12:29 +0100    

Click here for diff

For JOIN ... USING, offer attribute names for the first member of the  
column list.  
  
Author: Andreas Karlsson  
Reviewed-By: Tomas Vondra  
Discussion: https://postgr.es/m/[email protected]  

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

psql: Tab completion for JOIN ... ON/USING

commit   : a01f6fa6ad5e232e1bd38c05d443875ae3ba7ee8    
  
author   : Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 18:08:30 +0100    
  
committer: Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 18:08:30 +0100    

Click here for diff

Offer ON/USING clauses for join types that require join conditions (i.e.  
anything except for NATURAL/CROSS joins).  
  
Author: Andreas Karlsson  
Reviewed-By: Tomas Vondra  
Discussion: https://postgr.es/m/[email protected]  

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

psql: Tab completion for LATERAL joins

commit   : 5dd5786b94cea4652035a5dc55c103ed09b0365b    
  
author   : Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 17:55:00 +0100    
  
committer: Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 17:55:00 +0100    

Click here for diff

When listing selectable objects after a JOIN, offer also LATERAL.  
  
Author: Andreas Karlsson  
Reviewed-By: Tomas Vondra  
Discussion: https://postgr.es/m/[email protected]  

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

Refactor string case conversion into provider-specific files.

commit   : 86a5d6006aff956a5e00982b7628177fa7dc5027    
  
author   : Jeff Davis <[email protected]>    
date     : Mon, 16 Dec 2024 09:35:18 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Mon, 16 Dec 2024 09:35:18 -0800    

Click here for diff

Create API entry points pg_strlower(), etc., that work with any  
provider and give the caller control over the destination  
buffer. Then, move provider-specific logic into pg_locale_builtin.c,  
pg_locale_icu.c, and pg_locale_libc.c as appropriate.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/utils/adt/formatting.c
M src/backend/utils/adt/pg_locale.c
M src/backend/utils/adt/pg_locale_builtin.c
M src/backend/utils/adt/pg_locale_icu.c
M src/backend/utils/adt/pg_locale_libc.c
M src/include/utils/pg_locale.h

psql: Tab completion for CREATE MATERIALIZED VIEW ... USING

commit   : de1e29885730851787b467449f525ff6fc7d69fa    
  
author   : Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 16:46:56 +0100    
  
committer: Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 16:46:56 +0100    

Click here for diff

The tab completion didn't offer USING for CREATE MATERIALIZED VIEW, so  
add it, and offer a list of access methods, followed by SELECT.  
  
Author: Kirill Reshke  
Reviewed-By: Karina Litskevich  
Discussion: https://postgr.es/m/CALdSSPhVELkvutquqrDB=Ujfq_Pjz=6jn-kzh+291KPNViLTfw@mail.gmail.com  

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

psql: Tab completion for CREATE TEMP TABLE ... USING

commit   : 1e1f70c34a8e8cef8d7f55ecb73ef22771c2e21b    
  
author   : Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 16:38:35 +0100    
  
committer: Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 16:38:35 +0100    

Click here for diff

The USING keyword was offered only for persistent tables, not for  
temporary ones. So improve that.  
  
Author: Kirill Reshke  
Reviewed-By: Karina Litskevich  
Discussion: https://postgr.es/m/CALdSSPhVELkvutquqrDB=Ujfq_Pjz=6jn-kzh+291KPNViLTfw@mail.gmail.com  

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

psql: Tab completion for ALTER TYPE ... CASCADE/RESTRICT

commit   : 8f11ef80c5458f0d12eefa1c6fbba81af8bb3042    
  
author   : Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 16:20:04 +0100    
  
committer: Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 16:20:04 +0100    

Click here for diff

Updates table completion for ALTER TYPE to offer CASCADE/RESTRICT for a  
number of actions on attributes:  
  
    ALTER TYPE ... ADD/DROP/RENAME ATTRIBUTE ... [CASCADE|RESTRICT]  
    ALTER TYPE ... TYPE ... [CASCADE|RESTRICT]  
  
Author: Kirill Reshke  
Reviewed-By: Karina Litskevich  
Discussion: https://postgr.es/m/CALdSSPhVELkvutquqrDB=Ujfq_Pjz=6jn-kzh+291KPNViLTfw@mail.gmail.com  

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

psql: Tab completion for ALTER TYPE ... ADD ATTRIBUTE

commit   : e0275c380c3f4c11c0d6b9005b930a4d7e4b6862    
  
author   : Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 15:53:36 +0100    
  
committer: Tomas Vondra <[email protected]>    
date     : Mon, 16 Dec 2024 15:53:36 +0100    

Click here for diff

Improve psql tab completion for ALTER TYPE ... ADD ATTRIBUTE to offer a  
list of existing data types (until now no options were offered).  
  
Author: Kirill Reshke  
Reviewed-By: Karina Litskevich  
Discussion: https://postgr.es/m/CALdSSPhVELkvutquqrDB=Ujfq_Pjz=6jn-kzh+291KPNViLTfw@mail.gmail.com  

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

Make 009_twophase.pl test pass with recovery_min_apply_delay set

commit   : 1dfeb6af7f87d5117389870765c210bf6b6b8ed1    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 16 Dec 2024 15:56:38 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 16 Dec 2024 15:56:38 +0200    

Click here for diff

The test failed if you ran the regression tests with TEMP_CONFIG with  
recovery_min_apply_delay = '500ms'. Fix the race condition by waiting  
for transaction to be applied in the replica, like in a few other  
tests.  
  
The failing test was introduced in commit cbfbda7841. Backpatch to all  
supported versions like that commit (except v12, which is no longer  
supported).  
  
Reported-by: Alexander Lakhin  
Discussion: https://www.postgresql.org/message-id/[email protected]  

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

Print out error position for CREATE DOMAIN

commit   : 39240bcad56dc51a7896d04a1e066efcf988b58f    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 16 Dec 2024 14:52:11 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 16 Dec 2024 14:52:11 +0900    

Click here for diff

This is simply done by pushing down the ParseState available in  
ProcessUtility() to DefineDomain(), giving more information about the  
position of an error when running a CREATE DOMAIN query.  
  
Most of the queries impacted by this change have been added previously  
in 0172b4c9449e.  
  
Author: Kirill Reshke, Jian He  
Reviewed-by: Álvaro Herrera, Tom Lane, Michael Paquier  
Discussion: https://postgr.es/m/CALdSSPhqfvKbDwqJaY=yEePi_aq61GmMpW88i6ZH7CMG_2Z4Cg@mail.gmail.com  

M src/backend/commands/typecmds.c
M src/backend/tcop/utility.c
M src/include/commands/typecmds.h
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/collate.windows.win1252.out
M src/test/regress/expected/domain.out

Add some tests for encoding conversion in COPY TO/FROM

commit   : 3ad8b840ce8b1d7279f2d0d5fb7d346c0a6a3e8d    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 16 Dec 2024 11:23:38 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 16 Dec 2024 11:23:38 +0900    

Click here for diff

This adds a couple of tests to trigger encoding conversion when input  
and server encodings do not match in COPY FROM/TO, or need_transcoding  
set to true in the COPY state data.  These tests rely on UTF8 <-> LATIN1  
for the valid cases as LATIN1 accepts any bytes, and UTF8 <-> EUC_JP for  
some of the invalid cases where a character cannot be understood,  
causing a conversion failure.  
  
Both ENCODING and client_encoding are covered.  Test suggested by Andres  
Freund.  
  
Author: Sutou Kouhei  
Discussion: https://postgr.es/m/[email protected]  

A src/test/regress/expected/copyencoding.out
A src/test/regress/expected/copyencoding_1.out
M src/test/regress/parallel_schedule
A src/test/regress/sql/copyencoding.sql

Declare a couple of variables inside not outside a PG_TRY block.

commit   : bf9165bb0c5cea71e1a9cfa0c584c4d176f6c36f    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 15 Dec 2024 15:50:07 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 15 Dec 2024 15:50:07 -0500    

Click here for diff

I went through the buildfarm's reports of "warning: variable 'foo'  
might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]".  As usual,  
none of them are live problems according to my understanding of the  
effects of setjmp/longjmp, to wit that local variables might revert  
to their values as of PG_TRY entry, due to being kept in registers.  
But I did happen to notice that XmlTableGetValue's "cstr" variable  
doesn't need to be declared outside the PG_TRY block at all (thus  
giving further proof that the -Wclobbered warning has little  
connection to real problems).  We might as well move it inside,  
and "cur" too, in hopes of eliminating one of the bogus warnings.  

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

pgbench: fix misprocessing of some nested \if constructs.

commit   : 530f89e648da3a5505920322dcd4e00e15559f66    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 15 Dec 2024 14:14:14 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 15 Dec 2024 14:14:14 -0500    

Click here for diff

An \if command appearing within a false (not-to-be-executed) \if  
branch was incorrectly treated the same as \elif.  This could allow  
statements within the inner \if to be executed when they should  
not be.  Also the missing inner \if stack entry would result in an  
assertion failure (in assert-enabled builds) when the final \endif  
is reached.  
  
Report and patch by Michail Nikolaev.  Back-patch to all  
supported branches.  
  
Discussion: https://postgr.es/m/CANtu0oiA1ke=SP6tauhNqkUdv5QFsJtS1p=aOOf_iU+EhyKkjQ@mail.gmail.com  

M src/bin/pgbench/pgbench.c
M src/bin/pgbench/t/001_pgbench_with_server.pl

doc: Clarify old WAL files are kept until they are summarized.

commit   : 56499315a74f97d220373e396903c389d85c8933    
  
author   : Fujii Masao <[email protected]>    
date     : Sun, 15 Dec 2024 11:18:18 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Sun, 15 Dec 2024 11:18:18 +0900    

Click here for diff

The documentation in wal.sgml explains that old WAL files cannot be  
removed or recycled until they are archived (when WAL archiving is used)  
or replicated (when using replication slots). However, it did not mention  
that, similarly, old WAL files are also kept until they are summarized  
if WAL summarization is enabled. This commit adds that clarification  
to the documentation.  
  
Back-patch to v17 where WAL summarization was added.  
  
Author: Fujii Masao  
Reviewed-by: Michael Paquier  
Discussion: https://postgr.es/m/[email protected]  

M doc/src/sgml/wal.sgml

contrib/earthdistance: Use SQL-standard function bodies.

commit   : 969bbd0fafc0f4d9ef504ca98a127c8d945f71a0    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 14 Dec 2024 16:07:18 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 14 Dec 2024 16:07:18 -0500    

Click here for diff

The @extschema:name@ feature added by 72a5b1fc8 allows us to  
make earthdistance's references to the cube extension fully  
search-path-secure, so long as all those references are  
resolved at extension installation time not runtime.  
To do that, we must convert earthdistance's SQL functions to  
the new SQL-standard style; but we wanted to do that anyway.  
  
The functions can be updated in our customary style by running  
CREATE OR REPLACE FUNCTION in an extension update script.  
However, there's still problems in the "CREATE DOMAIN earth"  
command: its references to cube functions could be captured  
by hostile objects in earthdistance's installation schema,  
if that's not where the cube extension is.  Worse, the reference  
to the cube type itself as the domain's base could be captured,  
and that's not something we could fix after-the-fact in the  
update script.  
  
What I've done about that is to change the "CREATE DOMAIN earth"  
command in the base script earthdistance--1.1.sql.  Ordinarily,  
changing a released extension script is forbidden; but I think  
it's okay here since the results of successful (non-trojaned)  
script execution will be identical to before.  
  
A good deal of care is still needed to make the extension's scripts  
proof against search-path-based attacks.  We have to make sure that  
all the function and operator invocations have exact argument-type  
matches, to forestall attacks based on supplying a better match.  
Fortunately earthdistance isn't very big, so I've just gone through  
it and inspected each call to be sure of that.  The only actual code  
changes needed were to spell all floating-point constants in the style  
'-1'::float8, rather than depending on runtime type conversions and/or  
negations.  (I'm not sure that the shortcuts previously used were  
attackable, but removing run-time effort is a good thing anyway.)  
  
I believe that this fixes earthdistance enough that we could  
mark it trusted and remove the warnings about it that were  
added by 7eeb1d986; but I've not done that here.  
  
The primary reason for dealing with this now is that we've  
received reports of pg_upgrade failing for databases that use  
earthdistance functions in contexts like generated columns.  
That's a consequence of 2af07e2f7 having restricted the search_path  
used while evaluating such expressions.  The only way to fix that  
is to make the earthdistance functions independent of run-time  
search_path.  This patch is very much nicer than the alternative of  
attaching "SET search_path" clauses to earthdistance's functions:  
it is more secure and doesn't create a run-time penalty.  Therefore,  
I've chosen to back-patch this to v16 where @extschema:name@  
was added.  It won't help unless users update to 16.7 and issue  
"ALTER EXTENSION earthdistance UPDATE" before upgrading to 17,  
but at least there's now a way to deal with the problem without  
manual intervention in the dump/restore process.  
  
Tom Lane and Ronan Dunklau  
  
Discussion: https://postgr.es/m/3316564.aeNJFYEL58@aivenlaptop  
Discussion: https://postgr.es/m/[email protected]  

M contrib/earthdistance/Makefile
A contrib/earthdistance/earthdistance–1.1–1.2.sql
M contrib/earthdistance/earthdistance–1.1.sql
M contrib/earthdistance/earthdistance.control
M contrib/earthdistance/meson.build

Refactor some SQL/JSON error messages

commit   : 62b7a9a7784eb8b3871368726fc3b8df17d87f32    
  
author   : Álvaro Herrera <[email protected]>    
date     : Sat, 14 Dec 2024 12:55:00 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Sat, 14 Dec 2024 12:55:00 +0100    

Click here for diff

Turn type names into "%s" specifiers to 1) avoid getting them translated  
and 2) reduce the total number of messages.  

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

Fix warnings about declaration of environ on MinGW.

commit   : 7bc9a8bdd2d6f6da664572456f226c54e9c9e3dd    
  
author   : Thomas Munro <[email protected]>    
date     : Sun, 15 Dec 2024 00:36:30 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Sun, 15 Dec 2024 00:36:30 +1300    

Click here for diff

POSIX says that the global variable environ shouldn't be declared in a  
header, and that you have to declare it yourself.  MinGW declares it in  
<stdlib.h> with some macrology that messes up our declarations.  Visual  
Studio doesn't warn (there are clues that it may also declare it, but if  
so, apparently compatibly).  Suppress our declarations, on MinGW only.  
  
This clears the last warnings on CI's optional MinGW task, and hopefully  
on build farm animal fairywren too.  
  
Like 1319997d, no back-patch for now as it's not known to be breaking  
anything, and my humble goal is just to keep the MinGW build clean going  
forward.  
  
Reviewed-by: Tom Lane <[email protected]> (earlier version)  
Discussion: https://postgr.es/m/CA%2BhUKGJLMh%2B6W5E4M_jSFb43gnrA_-Q6-%2BBf3HkBXyGfRFcBsQ%40mail.gmail.com  

M src/backend/postmaster/postmaster.c
M src/backend/utils/misc/ps_status.c
M src/test/regress/regress.c

Remove EXTENSION_DONT_CHECK_SIZE from md.c.

commit   : 48c142f78d90fcdcbc0557a4bcdc4f47ec32b333    
  
author   : Thomas Munro <[email protected]>    
date     : Sat, 14 Dec 2024 20:59:58 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Sat, 14 Dec 2024 20:59:58 +1300    

Click here for diff

Commits 7bb3102c and 3eb77eba removed the only user of the  
EXTENSION_DONT_CHECK_SIZE flag, which had previously been required to  
checkpoint truncated relations.  Since 7bb3102c, segments have been  
opened directly for synchronization without calling _mdfd_getseg(), so  
it doesn't need a mode that tolerates non-final short segments.  Remove  
the redundant flag and associated comments.  
  
Reported-by: Andres Freund <[email protected]>  
Discussion: https://postgr.es/m/nyj4k7yur5t27rtygvx2i2lrlp6rqfvvhoiiwx4fznynksf2et%404hj2sp42alpe  

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

Fix typo

commit   : c72ca3ddec15b73d9f9dc3e21b8db5d958b0dad7    
  
author   : John Naylor <[email protected]>    
date     : Sat, 14 Dec 2024 09:52:08 +0700    
  
committer: John Naylor <[email protected]>    
date     : Sat, 14 Dec 2024 09:52:08 +0700    

Click here for diff

Ryo Kanbayashi  
  
Discussion: https://postgr.es/m/CANOn0ExEQiPVrzkjULkENVac_n4Lknm6dxsU69MSncQap0kJVA%40mail.gmail.com  

M src/backend/optimizer/util/restrictinfo.c

Fix possible crash in pg_dump with identity sequences.

commit   : 7b8cb9cd6a76b1b6a77032a1c352b258b6abfd39    
  
author   : Tom Lane <[email protected]>    
date     : Fri, 13 Dec 2024 14:21:36 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Fri, 13 Dec 2024 14:21:36 -0500    

Click here for diff

If an owned sequence is considered interesting, force its owning  
table to be marked interesting too.  This ensures, in particular,  
that we'll fetch the owning table's column names so we have the  
data needed for ALTER TABLE ... ADD GENERATED.  Previously there were  
edge cases where pg_dump could get SIGSEGV due to not having filled in  
the column names.  (The known case is where the owning table has been  
made part of an extension while its identity sequence is not a member;  
but there may be others.)  
  
Also, if it's an identity sequence, force its dumped-components mask  
to exactly match the owning table: dump definition only if we're  
dumping the table's definition, dump data only if we're dumping the  
table's data, etc.  This generalizes the code introduced in commit  
b965f2617 that set the sequence's dump mask to NONE if the owning  
table's mask is NONE.  That's insufficient to prevent failures,  
because for example the table's mask might only request dumping ACLs,  
which would lead us to still emit ALTER TABLE ADD GENERATED even  
though we didn't create the table.  It seems better to treat an  
identity sequence as though it were an inseparable aspect of the  
table, matching the treatment used in the backend's dependency logic.  
Perhaps this policy needs additional refinement, but let's wait to  
see some field use-cases before changing it further.  
  
While here, add a comment in pg_dump.h warning against writing tests  
like "if (dobj->dump == DUMP_COMPONENT_NONE)", which was a bug in this  
case.  There is one other example in getPublicationNamespaces, which  
if it's not a bug is at least remarkably unclear and under-documented.  
Changing that requires a separate discussion, however.  
  
Per report from Artur Zakirov.  Back-patch to all supported branches.  
  
Discussion: https://postgr.es/m/CAKNkYnwXFBf136=u9UqUxFUVagevLQJ=zGd5BsLhCsatDvQsKQ@mail.gmail.com  

M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dump.h

Rewrite maybe_reread_subscription() comment

commit   : 3191eccd8a9bff1715f2e4fab86d2932a556185e    
  
author   : Álvaro Herrera <[email protected]>    
date     : Fri, 13 Dec 2024 07:41:36 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Fri, 13 Dec 2024 07:41:36 +0100    

Click here for diff

One sentence was gramatically wrong, but also too terse.  Expand on it.  

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

Dump not-null constraints on inherited columns correctly

commit   : fd41ba93e4630921a72ed5127cd0d552a8f3f8fc    
  
author   : Álvaro Herrera <[email protected]>    
date     : Fri, 13 Dec 2024 07:38:49 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Fri, 13 Dec 2024 07:38:49 +0100    

Click here for diff

With not-null constraints defined in child tables for columns that are  
coming from their parent tables, we were printing ALTER TABLE SET NOT  
NULL commands that were missing the constraint name, so the original  
constraint name was being lost, which is bogus.  Fix by instead adding  
a table-constraint constraint declaration with the correct constraint  
name in the CREATE TABLE instead.  
  
Oversight in commit 14e87ffa5c54.  
  
We could have fixed it by changing the ALTER TABLE SET NOT NULL to ALTER  
TABLE ADD CONSTRAINT, but I'm not sure that's any better.  A potential  
problem here might be that if sent to a non-Postgres server, the new  
pg_dump output would fail because the "CONSTRAINT foo NOT NULL colname"  
syntax isn't SQL-conforming.  However, Postgres' implementation of  
inheritance is already non-SQL-conforming, so that'd likely fail anyway.  
  
This problem was only noticed by Ashutosh's proposed test framework for  
pg_dump, https://postgr.es/m/CAExHW5uF5V=Cjecx3_Z=7xfh4rg2Wf61PT+hfquzjBqouRzQJQ@mail.gmail.com  
  
Author: Ashutosh Bapat <[email protected]>  
Reported-by: Ashutosh Bapat <[email protected]>  
Reviewed-by: Alvaro Herrera <[email protected]>  
Discussion: https://postgr.es/m/CAExHW5tbdgAKDfqjDJ-7Fk6PJtHg8D4zUF6FQ4H2Pq8zK38Nyw@mail.gmail.com  

M src/bin/pg_dump/pg_dump.c

Revert "Don't truncate database and user names in startup packets."

commit   : a0ff56e2d3ff1db3de727b33b2dac985ccc43ef8    
  
author   : Nathan Bossart <[email protected]>    
date     : Thu, 12 Dec 2024 15:52:04 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Thu, 12 Dec 2024 15:52:04 -0600    

Click here for diff

This reverts commit 562bee0fc13dc95710b8db6a48edad2f3d052f2e.  
  
We received a report from the field about this change in behavior,  
so it seems best to revert this commit and to add proper  
multibyte-aware truncation as a follow-up exercise.  
  
Fixes bug #18711.  
  
Reported-by: Adam Rauch  
Reviewed-by: Tom Lane, Bertrand Drouvot, Bruce Momjian, Thomas Munro  
Discussion: https://postgr.es/m/18711-7503ee3e449d2c47%40postgresql.org  
Backpatch-through: 17  

M src/backend/tcop/backend_startup.c

Adjust some comments about structure properties in pg_stat.h

commit   : 4766438aa317e85f3d762847b2b009f91f530b6f    
  
author   : Michael Paquier <[email protected]>    
date     : Thu, 12 Dec 2024 16:59:22 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Thu, 12 Dec 2024 16:59:22 +0900    

Click here for diff

One comment of PgStat_TableCounts mentioned that its pending stats use  
memcmp() to check for the all-zero case if there is any activity.  This  
is not true since 07e9e28b56, as pg_memory_is_all_zeros() is used.  
  
PgStat_FunctionCounts incorrectly documented that it relied on memcpy().  
This has never been correct, and not relevant because function  
statistics do not have an all-zero check for pending stats.  
  
Checkpoint and bgwriter statistics have been always relying on memcmp()  
or pg_memory_is_all_zeros() (since 07e9e28b56 for the latter), and never  
mentioned the dependency on event counters for their all-zero checks.  
Let's document these properties, like the table statistics.  
  
Author: Bertrand Drouvot  
Discussion: https://postgr.es/m/[email protected]  

M src/include/pgstat.h

Detect redundant GROUP BY columns using UNIQUE indexes

commit   : bd10ec529796a13670645e6acd640c6f290df020    
  
author   : David Rowley <[email protected]>    
date     : Thu, 12 Dec 2024 15:28:38 +1300    
  
committer: David Rowley <[email protected]>    
date     : Thu, 12 Dec 2024 15:28:38 +1300    

Click here for diff

d4c3a156c added support that when the GROUP BY contained all of the  
columns belonging to a relation's PRIMARY KEY, all other columns  
belonging to that relation would be removed from the GROUP BY clause.  
That's possible because all other columns are functionally dependent on  
the PRIMARY KEY and those columns alone ensure the groups are distinct.  
  
Here we expand on that optimization and allow it to work for any unique  
indexes on the table rather than just the PRIMARY KEY index.  This  
normally requires that all columns in the index are defined with NOT NULL,  
however, we can relax that requirement when the index is defined with  
NULLS NOT DISTINCT.  
  
When there are multiple suitable indexes to allow columns to be removed,  
we prefer the index with the least number of columns as this allows us  
to remove the highest number of GROUP BY columns.  One day, we may want to  
revisit that decision as it may make more sense to use the narrower set of  
columns in terms of the width of the data types and stored/queried data.  
  
This also adjusts the code to make use of RelOptInfo.indexlist rather  
than looking up the catalog tables.  
  
In passing, add another short-circuit path to allow bailing out earlier  
in cases where it's certainly not possible to remove redundant GROUP BY  
columns.  This early exit is now cheaper to do than when this code was  
originally written as 00b41463c made it cheaper to check for empty  
Bitmapsets.  
  
Patch originally by Zhang Mingli and later worked on by jian he, but after  
I (David) worked on it, there was very little of the original left.  
  
Author: Zhang Mingli, jian he, David Rowley  
Reviewed-by: jian he, Andrei Lepikhov  
Discussion: https://postgr.es/m/327990c8-b9b2-4b0c-bffb-462249f82de0%40Spark  

M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/util/plancat.c
M src/include/nodes/pathnodes.h
M src/test/regress/expected/aggregates.out
M src/test/regress/sql/aggregates.sql

Improve the test case from 5668a857d

commit   : d8f335156c57f0df6ae3b1ec31e55979838eb882    
  
author   : Richard Guo <[email protected]>    
date     : Thu, 12 Dec 2024 11:21:51 +0900    
  
committer: Richard Guo <[email protected]>    
date     : Thu, 12 Dec 2024 11:21:51 +0900    

Click here for diff

In commit 5668a857d, we fixed an issue with incorrect results in right  
semi joins and introduced a test case to verify the fix.  The test  
case involves SubPlans and InitPlans, which may not be immediately  
apparent in relation to the issue we addressed.  
  
This patch simplifies the test case with a more straightforward query.  
  
Per discussion with Melanie Plageman.  
  
Author: Richard Guo  
Discussion: https://postgr.es/m/CAAKRu_a-Cip2XCXp13fmxq+T9BhLAVApHTyjr94awL2mbXHC-Q@mail.gmail.com  

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

Add some regression tests for missing DDL patterns

commit   : 0172b4c9449e92a3988f669d9e7e9000454d16ce    
  
author   : Michael Paquier <[email protected]>    
date     : Thu, 12 Dec 2024 11:16:45 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Thu, 12 Dec 2024 11:16:45 +0900    

Click here for diff

The following commands gain increased coverage for some of the errors  
they can trigger:  
- ALTER TABLE .. ALTER COLUMN  
- CREATE DOMAIN  
- CREATE TYPE (LIKE)  
  
This has come up while discussing the possibility to add more  
information about the location of the error in such queries, and it  
is useful on its own as there was no coverage until now for the  
patterns added in this commit.  
  
Author: Jian He, Kirill Reshke  
Reviewed-By: Álvaro Herrera, Michael Paquier  
Discussion: https://postgr.es/m/CALdSSPhqfvKbDwqJaY=yEePi_aq61GmMpW88i6ZH7CMG_2Z4Cg@mail.gmail.com  

M src/test/regress/expected/alter_table.out
M src/test/regress/expected/domain.out
M src/test/regress/expected/float8.out
M src/test/regress/expected/identity.out
M src/test/regress/sql/alter_table.sql
M src/test/regress/sql/domain.sql
M src/test/regress/sql/float8.sql
M src/test/regress/sql/identity.sql

Defer remove_useless_groupby_columns() work until query_planner()

commit   : 430a5952deb3bfbfe1e2537315d44427b7c41fb1    
  
author   : David Rowley <[email protected]>    
date     : Thu, 12 Dec 2024 14:22:15 +1300    
  
committer: David Rowley <[email protected]>    
date     : Thu, 12 Dec 2024 14:22:15 +1300    

Click here for diff

Traditionally, remove_useless_groupby_columns() was called during  
grouping_planner() directly after the call to preprocess_groupclause().  
While in many ways, it made sense to populate the field and remove the  
functionally dependent columns from processed_groupClause at the same  
time, it's just that doing so had the disadvantage that  
remove_useless_groupby_columns() was being called before the RelOptInfos  
were populated for the relations mentioned in the query.  Not having  
RelOptInfos available meant we needed to manually query the catalog tables  
to get the required details about the primary key constraint for the  
table.  
  
Here we move the remove_useless_groupby_columns() call to  
query_planner() and put it directly after the RelOptInfos are populated.  
This is fine to do as processed_groupClause still isn't final at this  
point as it can still be modified inside standard_qp_callback() by  
make_pathkeys_for_sortclauses_extended().  
  
This commit is just a refactor and simply moves  
remove_useless_groupby_columns() into initsplan.c.  A planned follow-up  
commit will adjust that function so it uses RelOptInfo instead of doing  
catalog lookups and also teach it how to use unique indexes as proofs to  
expand the cases where we can remove functionally dependent columns from  
the GROUP BY.  
  
Reviewed-by: Andrei Lepikhov, jian he  
Discussion: https://postgr.es/m/CAApHDvqLezKwoEBBQd0dp4Y9MDkFBDbny0f3SzEeqOFoU7Z5+A@mail.gmail.com  

M src/backend/optimizer/plan/initsplan.c
M src/backend/optimizer/plan/planmain.c
M src/backend/optimizer/plan/planner.c
M src/include/optimizer/planmain.h

Add UUID version 7 generation function.

commit   : 78c5e141e9c139fc2ff36a220334e4aa25e1b0eb    
  
author   : Masahiko Sawada <[email protected]>    
date     : Wed, 11 Dec 2024 15:54:41 -0800    
  
committer: Masahiko Sawada <[email protected]>    
date     : Wed, 11 Dec 2024 15:54:41 -0800    

Click here for diff

This commit introduces the uuidv7() SQL function, which generates UUID  
version 7 as specified in RFC 9652. UUIDv7 combines a Unix timestamp  
in milliseconds and random bits, offering both uniqueness and  
sortability.  
  
In our implementation, the 12-bit sub-millisecond timestamp fraction  
is stored immediately after the timestamp, in the space referred to as  
"rand_a" in the RFC. This ensures additional monotonicity within a  
millisecond. The rand_a bits also function as a counter. We select a  
sub-millisecond timestamp so that it monotonically increases for  
generated UUIDs within the same backend, even when the system clock  
goes backward or when generating UUIDs at very high  
frequency. Therefore, the monotonicity of generated UUIDs is ensured  
within the same backend.  
  
This commit also expands the uuid_extract_timestamp() function to  
support UUID version 7.  
  
Additionally, an alias uuidv4() is added for the existing  
gen_random_uuid() SQL function to maintain consistency.  
  
Bump catalog version.  
  
Author: Andrey Borodin  
Reviewed-by: Sergey Prokhorenko, Przemysław Sztoch, Nikolay Samokhvalov  
Reviewed-by: Peter Eisentraut, Jelte Fennema-Nio, Aleksander Alekseev  
Reviewed-by: Masahiko Sawada, Lukas Fittl, Michael Paquier, Japin Li  
Reviewed-by: Marcos Pegoraro, Junwang Zhao, Stepan Neretin  
Reviewed-by: Daniel Vérité  
Discussion: https://postgr.es/m/CAAhFRxitJv%3DyoGnXUgeLB_O%2BM7J2BJAmb5jqAT9gZ3bij3uLDA%40mail.gmail.com  

M doc/src/sgml/datatype.sgml
M doc/src/sgml/func.sgml
M src/backend/utils/adt/uuid.c
M src/include/catalog/catversion.h
M src/include/catalog/pg_proc.dat
M src/test/regress/expected/uuid.out
M src/test/regress/sql/uuid.sql

Fix further fallout from EXPLAIN ANALYZE BUFFERS change

commit   : 89988ac5891b3d41725472a65e50ae4e192313aa    
  
author   : David Rowley <[email protected]>    
date     : Thu, 12 Dec 2024 09:50:00 +1300    
  
committer: David Rowley <[email protected]>    
date     : Thu, 12 Dec 2024 09:50:00 +1300    

Click here for diff

c2a4078eb adjusted EXPLAIN ANALYZE to default the BUFFERS to ON.  This  
(hopefully) fixes the last remaining issue with regression test failures  
with -D RELCACHE_FORCE_RELEASE -D CATCACHE_FORCE_RELEASE builds, where  
the planner accesses more buffers due to the cold caches.  
  
Discussion: https://postgr.es/m/CAApHDvqLdzgz77JsE-yTki3w9UiKQ-uTMLRctazcu+99-ips3g@mail.gmail.com  

M contrib/pg_stat_statements/expected/level_tracking.out
M contrib/pg_stat_statements/sql/level_tracking.sql

Use pg_memory_is_all_zeros() in pgstatfuncs.c.

commit   : e8d59294282bd01bc06f2af13c79b9155024a917    
  
author   : Nathan Bossart <[email protected]>    
date     : Wed, 11 Dec 2024 14:19:14 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Wed, 11 Dec 2024 14:19:14 -0600    

Click here for diff

There are a few places in this file that use memset() and memcmp()  
to determine whether a section of memory is all zeros.  This commit  
modifies them to use pg_memory_is_all_zeros() instead.  These  
aren't expected to be hot code paths, but this may optimize them a  
bit.  Plus, this allows us to remove some variables that were only  
needed for the memset() and memcmp().  
  
Author: Bertrand Drouvot  
Reviewed-by: Michael Paquier  
Discussion: https://postgr.es/m/Z1hNubHfvMxlW6eu%40ip-10-97-1-34.eu-west-3.compute.internal  

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

Unmark gen_random_uuid() function leakproof.

commit   : 398d3e3b5b8f4c81795e07655f28036839cc0550    
  
author   : Masahiko Sawada <[email protected]>    
date     : Wed, 11 Dec 2024 10:35:57 -0800    
  
committer: Masahiko Sawada <[email protected]>    
date     : Wed, 11 Dec 2024 10:35:57 -0800    

Click here for diff

The functions without arguments don't need to be marked  
leakproof. This commit unmarks gen_random_uuid() leakproof for  
consistency with upcoming UUID generation functions. Also, this commit  
adds a regression test to prevent reintroducing such cases.  
  
Bump catalog version.  
  
Reported-by: Peter Eisentraut  
Reviewed-by: Andres Freund  
Discussion: https://postgr.es/m/CAD21AoBE1ePPWY1NQEgk3DkqjYzLPZwYTzCySHm0e%2B9a69PfZw%40mail.gmail.com  

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

Fix a memory leak in dumping functions with TRANSFORMs

commit   : 0e033f5b6de569e712d5f94b77878b8ffacf6397    
  
author   : Daniel Gustafsson <[email protected]>    
date     : Wed, 11 Dec 2024 12:48:22 +0100    
  
committer: Daniel Gustafsson <[email protected]>    
date     : Wed, 11 Dec 2024 12:48:22 +0100    

Click here for diff

The gneration of the dump clause for functions with TRANSFORM  
calls would leak the memory for holding the result of the Oid  
array parsing.  Fix by freeing.  
  
While in there, switch to using pg_malloc instead of palloc in  
order to be consistent with the rest of the file.  
  
Author: Oleg Tselebrovskiy <[email protected]>  
Reviewed-by: Daniel Gustafsson <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/bin/pg_dump/pg_dump.c

Add missing BUFFERS OFF in regression tests, take 2

commit   : 9df2a4b9316fae76477187bb2b64197169f5c346    
  
author   : David Rowley <[email protected]>    
date     : Wed, 11 Dec 2024 23:16:44 +1300    
  
committer: David Rowley <[email protected]>    
date     : Wed, 11 Dec 2024 23:16:44 +1300    

Click here for diff

Similar to 9fa1aaa65, but running with -D RELCACHE_FORCE_RELEASE and  
-D CATCACHE_FORCE_RELEASE yielded some additional missing places that  
needed BUFFERS OFF.  
  
Discussion: https://postgr.es/m/CANNMO++W7MM8T0KyXN3ZheXXt-uLVM3aEtZd+WNfZ=obxffUiA@mail.gmail.com  

M src/test/regress/expected/matview.out
M src/test/regress/expected/misc_functions.out
M src/test/regress/sql/matview.sql
M src/test/regress/sql/misc_functions.sql

Add missing BUFFERS OFF in select_into regression tests

commit   : 9fa1aaa6525af044385dbcefe9d9abb5d57578cd    
  
author   : David Rowley <[email protected]>    
date     : Wed, 11 Dec 2024 22:56:36 +1300    
  
committer: David Rowley <[email protected]>    
date     : Wed, 11 Dec 2024 22:56:36 +1300    

Click here for diff

c2a4078eb adjusted EXPLAIN ANALYZE to include BUFFERS by default, but  
a few tests in select_into.sql neglected to add BUFFERS OFF.  The  
failing tests seem unlikely to ever access buffers during execution, but  
they certainly could during planning.  
  
Per buildfarm member kestrel, tayra and calliphoridae.  
  
Discussion: https://postgr.es/m/CANNMO++W7MM8T0KyXN3ZheXXt-uLVM3aEtZd+WNfZ=obxffUiA@mail.gmail.com  

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

Enable BUFFERS with EXPLAIN ANALYZE by default

commit   : c2a4078ebad71999dd451ae7d4358be3c9290b07    
  
author   : David Rowley <[email protected]>    
date     : Wed, 11 Dec 2024 22:35:11 +1300    
  
committer: David Rowley <[email protected]>    
date     : Wed, 11 Dec 2024 22:35:11 +1300    

Click here for diff

The topic of turning EXPLAIN's BUFFERS option on with the ANALYZE option  
has come up a few times over the past few years.  In many ways, doing this  
seems like a good idea as it may be more obvious to users why a given  
query is running more slowly than they might expect.  Also, from my own  
(David's) personal experience, I've seen users posting to the mailing  
lists with two identical plans, one slow and one fast asking why their  
query is sometimes slow.  In many cases, this is due to additional reads.  
Having BUFFERS on by default may help reduce some of these questions, and  
if not, make it more obvious to the user before they post, or save a  
round-trip to the mailing list when additional I/O effort is the cause of  
the slowness.  
  
The general consensus is that we want BUFFERS on by default with  
ANALYZE.  However, there were more than zero concerns raised with doing  
so.  The primary reason against is the additional verbosity, making it  
harder to read large plans.  Another concern was that buffer information  
isn't always useful so may not make sense to have it on by default.  
  
It's currently December, so let's commit this to see if anyone comes  
forward with a strong objection against making this change.  We have over  
half a year remaining in the v18 cycle where we could still easily consider  
reverting this if someone were to come forward with a convincing enough  
reason as to why doing this is a bad idea.  
  
There were two patches independently submitted to achieve this goal, one  
by me and the other by Guillaume.  This commit is a mix of both of these  
patches with some additional work done by me to adjust various  
additional places in the documentation which include EXPLAIN ANALYZE  
output.  
  
Author: Guillaume Lelarge, David Rowley  
Reviewed-by: Robert Haas, Greg Sabino Mullane, Michael Christofides  
Discussion: https://postgr.es/m/CANNMO++W7MM8T0KyXN3ZheXXt-uLVM3aEtZd+WNfZ=obxffUiA@mail.gmail.com  

M contrib/postgres_fdw/expected/postgres_fdw.out
M contrib/postgres_fdw/sql/postgres_fdw.sql
M doc/src/sgml/bloom.sgml
M doc/src/sgml/jit.sgml
M doc/src/sgml/perform.sgml
M doc/src/sgml/planstats.sgml
M doc/src/sgml/ref/explain.sgml
M src/backend/commands/explain.c
M src/test/regress/expected/brin_multi.out
M src/test/regress/expected/explain.out
M src/test/regress/expected/incremental_sort.out
M src/test/regress/expected/memoize.out
M src/test/regress/expected/merge.out
M src/test/regress/expected/partition_prune.out
M src/test/regress/expected/select.out
M src/test/regress/expected/select_into.out
M src/test/regress/expected/select_parallel.out
M src/test/regress/expected/subselect.out
M src/test/regress/expected/tidscan.out
M src/test/regress/sql/brin_multi.sql
M src/test/regress/sql/explain.sql
M src/test/regress/sql/incremental_sort.sql
M src/test/regress/sql/memoize.sql
M src/test/regress/sql/merge.sql
M src/test/regress/sql/partition_prune.sql
M src/test/regress/sql/select.sql
M src/test/regress/sql/select_into.sql
M src/test/regress/sql/select_parallel.sql
M src/test/regress/sql/subselect.sql
M src/test/regress/sql/tidscan.sql

Use ExprStates for hashing in GROUP BY and SubPlans

commit   : 0f5738202b812a976e8612c85399b52d16a0abb6    
  
author   : David Rowley <[email protected]>    
date     : Wed, 11 Dec 2024 13:47:16 +1300    
  
committer: David Rowley <[email protected]>    
date     : Wed, 11 Dec 2024 13:47:16 +1300    

Click here for diff

This speeds up obtaining hash values for GROUP BY and hashed SubPlans by  
using the ExprState support for hashing, thus allowing JIT compilation for  
obtaining hash values for these operations.  
  
This, even without JIT compilation, has been shown to improve Hash  
Aggregate performance in some cases by around 15% and hashed NOT IN  
queries in one case by over 30%, however, real-world cases are likely to  
see smaller gains as the test cases used were purposefully designed to  
have high hashing overheads by keeping the hash table small to prevent  
additional memory overheads that would be a factor when working with large  
hash tables.  
  
In passing, fix a hypothetical bug in ExecBuildHash32Expr() so that the  
initial value is stored directly in the ExprState's result field if  
there are no expressions to hash.  None of the current users of this  
function use an initial value, so the bug is only hypothetical.  
  
Reviewed-by: Andrei Lepikhov <[email protected]>  
Discussion: https://postgr.es/m/CAApHDvpYSO3kc9UryMevWqthTBrxgfd9djiAjKHMPUSQeX9vdQ@mail.gmail.com  

M src/backend/executor/execExpr.c
M src/backend/executor/execGrouping.c
M src/backend/executor/nodeSubplan.c
M src/include/executor/executor.h
M src/include/nodes/execnodes.h

Use in-place updates for pg_restore_relation_stats().

commit   : a43567483c617fb046c805b61964d5168c9a0553    
  
author   : Jeff Davis <[email protected]>    
date     : Tue, 10 Dec 2024 16:30:37 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Tue, 10 Dec 2024 16:30:37 -0800    

Click here for diff

This matches the behavior of vac_update_relstats(), which is important  
to avoid bloating pg_class.  
  
Author: Corey Huinker  
Discussion: https://postgr.es/m/CADkLM=fc3je+ufv3gsHqjjSSf+t8674RXpuXW62EL55MUEQd-g@mail.gmail.com  

M doc/src/sgml/func.sgml
M src/backend/statistics/relation_stats.c
M src/test/regress/expected/stats_import.out
M src/test/regress/sql/stats_import.sql

Improve reporting of pg_upgrade log files on test failure

commit   : 8ede5016859e151003fdb662e13d11e43f372174    
  
author   : Michael Paquier <[email protected]>    
date     : Wed, 11 Dec 2024 08:48:47 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Wed, 11 Dec 2024 08:48:47 +0900    

Click here for diff

On failure, the pg_upgrade log files are automatically appended to the  
test log file, but the information reported was inconsistent.  
  
A header, with the log file name, was reported with note(), while the  
log contents and a footer used print(), making it harder to diagnose  
failures when these are split into console output and test log file  
because the pg_upgrade log file path in the header may not be included  
in the test log file.  
  
The output is now consolidated so as the header uses print() rather than  
note().  An extra note() is added to inform that the contents of a  
pg_upgrade log file are appended to the test log file.  
  
The diffs from the regression test suite and dump files all use print()  
to show their contents on failure.  
  
Author: Joel Jacobson  
Reviewed-by: Daniel Gustafsson  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 15  

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

Speedup Hash Joins with dedicated functions for ExprState hashing

commit   : 50416cc4843a85fcb53507e21577cce16c75c65f    
  
author   : David Rowley <[email protected]>    
date     : Wed, 11 Dec 2024 11:32:15 +1300    
  
committer: David Rowley <[email protected]>    
date     : Wed, 11 Dec 2024 11:32:15 +1300    

Click here for diff

Hashing of a single Var is a very common operation for ExprState to  
perform.  Here we add dedicated ExecJust* functions which helps speed up  
Hash Joins by removing the interpretation overhead in ExecInterpExpr().  
  
This change currently only affects Hash Joins on a single column.  Hash  
Joins with multiple join keys or an expression still run through  
ExecInterpExpr().  
  
Some testing has shown up to 10% query performance increases on recent AMD  
hardware and nearly 7% increase on an Apple M2 for a query performing a  
hash join with a large number of lookups on a small hash table.  
  
This change was extracted from a larger patch which adjusts GROUP BY /  
hashed subplans / hashed set operations to use ExprState hashing.  
  
Discussion: https://postgr.es/m/CAApHDvr8Zc0ZgzVoCZLdHGOFNhiJeQ6vrUcS9V7N23zMWQb-eA@mail.gmail.com  

M src/backend/executor/execExprInterp.c

Doc: add some commentary about ExecutorRun's NoMovement special case.

commit   : 982890530379235974a7e99fd72e862ae40f1400    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 10 Dec 2024 17:17:28 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 10 Dec 2024 17:17:28 -0500    

Click here for diff

Robert Haas expressed concern about whether commit 3eea7a0c9 exposed  
the parallel-execution machinery to a case it isn't tested for, namely  
a second non-parallel execution of a plan after a parallel execution.  
Investigation shows that that can't happen because of pquery.c's  
manipulation of the scan direction, but it sure wasn't obvious to  
start with.  Add some commentary about that.  
  
Discussion: https://postgr.es/m/CA+TgmoagyKQy=HFw+wLo0AKTYWHui+iKswZ8Jnqqd-cFby-WVg@mail.gmail.com  

M src/backend/executor/execMain.c

Fix elog(FATAL) before PostmasterMain() or just after fork().

commit   : 8b9cbf4922756d912309567f83f81e41f1737ac7    
  
author   : Noah Misch <[email protected]>    
date     : Tue, 10 Dec 2024 13:51:59 -0800    
  
committer: Noah Misch <[email protected]>    
date     : Tue, 10 Dec 2024 13:51:59 -0800    

Click here for diff

Since commit 97550c0711972a9856b5db751539bbaf2f88884c, these failed with  
"PANIC:  proc_exit() called in child process" due to uninitialized or  
stale MyProcPid.  That was reachable if close() failed in  
ClosePostmasterPorts() or setlocale(category, "C") failed, both  
unlikely.  Back-patch to v13 (all supported versions).  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/main/main.c
M src/backend/postmaster/fork_process.c
M src/backend/postmaster/postmaster.c
M src/port/pqsignal.c

Tests for logical replication with temporal keys

commit   : 939b0908c87a7d82171097189b855e5d0d2dd716    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 10 Dec 2024 15:05:58 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 10 Dec 2024 15:05:58 +0100    

Click here for diff

This covers some cases that were previously failing before the  
"Support for GiST in get_equal_strategy_number()" patch.  
  
Author: Paul A. Jungwirth <[email protected]>  
Reviewed-by: vignesh C <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a0+OPGharLQLO=mDHcY4_qQ0+noCUVg@mail.gmail.com  

M src/test/subscription/meson.build
A src/test/subscription/t/034_temporal.pl

Support for GiST in get_equal_strategy_number()

commit   : 74edabce7a33f428371f0da6c0338837fd9ac55e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 10 Dec 2024 13:26:09 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 10 Dec 2024 13:26:09 +0100    

Click here for diff

A WITHOUT OVERLAPS primary key or unique constraint is accepted as a  
REPLICA IDENTITY, since it guarantees uniqueness.  But subscribers  
applying logical decoding messages would fail because there was not  
support for looking up the equals operator for a gist index.  This  
fixes that: For GiST indexes we can use the stratnum GiST support  
function.  
  
Reviewed-by: Paul Jungwirth <[email protected]>  
Reviewed-by: vignesh C <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a0+OPGharLQLO=mDHcY4_qQ0+noCUVg@mail.gmail.com  

M src/backend/executor/execReplication.c

Make the conditions in IsIndexUsableForReplicaIdentityFull() more explicit

commit   : 13544e790ef8c4fe9043ba59276e5182ce9a623a    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 10 Dec 2024 13:11:34 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 10 Dec 2024 13:11:34 +0100    

Click here for diff

IsIndexUsableForReplicaIdentityFull() described a number of conditions  
that a suitable index has to fulfill.  But not all of these were  
actually checked in the code.  Instead, it appeared to rely on  
get_equal_strategy_number() to filter out any indexes that are not  
btree or hash.  As we look to generalize index AM capabilities, this  
would possibly break if we added additional support in  
get_equal_strategy_number().  Instead, write out code to check for the  
required capabilities explicitly.  This shouldn't change any behaviors  
at the moment.  
  
Reviewed-by: Paul Jungwirth <[email protected]>  
Reviewed-by: vignesh C <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a0+OPGharLQLO=mDHcY4_qQ0+noCUVg@mail.gmail.com  

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

Replace get_equal_strategy_number_for_am() by get_equal_strategy_number()

commit   : a2a475b011cf7c25f5a09574def35b335af844ac    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 10 Dec 2024 12:53:27 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 10 Dec 2024 12:53:27 +0100    

Click here for diff

get_equal_strategy_number_for_am() gets the equal strategy number for  
an AM.  This currently only supports btree and hash.  In the more  
general case, this also depends on the operator class (see for example  
GistTranslateStratnum()).  To support that, replace this function with  
get_equal_strategy_number() that takes an opclass and derives it from  
there.  (This function already existed before as a static function, so  
the signature is kept for simplicity.)  
  
This patch is only a refactoring, it doesn't add support for other  
index AMs such as gist.  This will be done separately.  
  
Reviewed-by: Paul Jungwirth <[email protected]>  
Reviewed-by: vignesh C <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a0+OPGharLQLO=mDHcY4_qQ0+noCUVg@mail.gmail.com  

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

Improve internal logical replication error for missing equality strategy

commit   : 321c287351f707c38c1fa94c1ac89bcc3134ed59    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 10 Dec 2024 12:30:42 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 10 Dec 2024 12:30:42 +0100    

Click here for diff

This "shouldn't happen", except right now it can with a temporal gist  
index (to be fixed soon), because of missing gist support in  
get_equal_strategy_number().  But right now, the error is not caught  
right away, but instead you get the subsequent error about a "missing  
operator 0".  This makes the error more accurate.  
  
Author: Paul Jungwirth <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a0+OPGharLQLO=mDHcY4_qQ0+noCUVg@mail.gmail.com  

M src/backend/executor/execReplication.c

Fix comments of GUC hooks for timezone_abbreviations

commit   : d37e856410d0856cb851e11b2e0191edf6cde527    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 10 Dec 2024 13:02:21 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 10 Dec 2024 13:02:21 +0900    

Click here for diff

The GUC assign and check hooks used "assign_timezone_abbreviations",  
which was incorrect.  
  
Issue noticed while browsing this area of the code, introduced in  
0a20ff54f5e6.  
  
Reviewed-by: Tom Lane  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 16  

M src/backend/commands/variable.c

Fix outdated comment of scram_build_secret()

commit   : 7b2690a5713e66c64313cea1cf881da3dcaaae2a    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 10 Dec 2024 12:54:09 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 10 Dec 2024 12:54:09 +0900    

Click here for diff

This routine documented that "iterations" would use a default value if  
set to 0 by the caller.  However, the iteration should always be set by  
the caller to a value strictly more than 0, as documented by an  
assertion.  
  
Oversight in b577743000cd, that has made the iteration count of SCRAM  
configurable.  
  
Author: Matheus Alcantara  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 16  

M src/common/scram-common.c

Include necessary header files in radixtree.h.

commit   : 724890ffb75c703afc1e0287f5a66b94c2998799    
  
author   : Masahiko Sawada <[email protected]>    
date     : Mon, 9 Dec 2024 13:07:06 -0800    
  
committer: Masahiko Sawada <[email protected]>    
date     : Mon, 9 Dec 2024 13:07:06 -0800    

Click here for diff

When #include'ing radixtree.h with RT_SHMEM, it could happen to raise  
compiler errors due to missing some declarations of types and  
functions.  
  
This commit also removes the inclusion of postgres.h since it's  
against our usual convention.  
  
Backpatch to v17, where radixtree.h was introduced.  
  
Reviewed-by: Heikki Linnakangas, Álvaro Herrera  
Discussion: https://postgr.es/m/CAD21AoCU9YH%2Bb9Rr8YRw7UjmB%3D1zh8GKQkWNiuN9mVhMvkyrRg%40mail.gmail.com  
Backpatch-through: 17  

M src/include/lib/radixtree.h

Doc: fix incorrect EXPLAIN ANALYZE output for bloom indexes

commit   : 36d0229b8ff5907ccff782e9425d1647401b7e99    
  
author   : David Rowley <[email protected]>    
date     : Tue, 10 Dec 2024 09:24:43 +1300    
  
committer: David Rowley <[email protected]>    
date     : Tue, 10 Dec 2024 09:24:43 +1300    

Click here for diff

It looks like the example case was once modified to increase the number  
of rows but the EXPLAIN ANALYZE output wasn't updated to reflect that.  
  
Also adjust the text which discusses the index sizes.  With the example  
table size, the bloom index isn't quite 8 times more space efficient  
than the btree indexes.  
  
Discussion: https://postgr.es/m/CAApHDvovx8kQ0=HTt85gFDAwmTJHpCgiSvRmQZ_6u_g-vQYM_w@mail.gmail.com  
Backpatch-through: 13, all supported versions  

M doc/src/sgml/bloom.sgml

Fix small memory leaks in GUC checks

commit   : 73a392d236965f14b84c0d09f011bda2cba6f8ca    
  
author   : Daniel Gustafsson <[email protected]>    
date     : Mon, 9 Dec 2024 20:58:23 +0100    
  
committer: Daniel Gustafsson <[email protected]>    
date     : Mon, 9 Dec 2024 20:58:23 +0100    

Click here for diff

Follow-up commit to a9d58bfe8a3a.  Backpatch down to v16 where  
this was added in order to keep the code consistent for future  
backpatches.  
  
Author: Tofig Aliev <[email protected]>  
Reviewed-by: Daniel Gustafsson <[email protected]>  
Reviewed-by: Masahiko Sawada <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 16  

M src/backend/commands/variable.c

Fix various overflow hazards in date and timestamp functions.

commit   : 0a27c3d0f733c132a4c5122e749a619d02937a8a    
  
author   : Nathan Bossart <[email protected]>    
date     : Mon, 9 Dec 2024 13:47:23 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Mon, 9 Dec 2024 13:47:23 -0600    

Click here for diff

This commit makes use of the overflow-aware routines in int.h to  
fix a variety of reported overflow bugs in the date and timestamp  
code.  It seems unlikely that this fixes all such bugs in this  
area, but since the problems seem limited to cases that are far  
beyond any realistic usage, I'm not going to worry too much.  Note  
that for one bug, I've chosen to simply add a comment about the  
overflow hazard because fixing it would require quite a bit of code  
restructuring that doesn't seem worth the risk.  
  
Since this is a bug fix, it could be back-patched, but given the  
risk of conflicts with the new routines in int.h and the overall  
risk/reward ratio of this patch, I've opted not to do so for now.  
  
Fixes bug #18585 (except for the one case that's just commented).  
  
Reported-by: Alexander Lakhin  
Author: Matthew Kim, Nathan Bossart  
Reviewed-by: Joseph Koshakow, Jian He  
Discussion: https://postgr.es/m/31ad2cd1-db94-bdb3-f91a-65ffdb4bef95%40gmail.com  
Discussion: https://postgr.es/m/18585-db646741dd649abd%40postgresql.org  

M src/backend/utils/adt/date.c
M src/backend/utils/adt/formatting.c
M src/backend/utils/adt/timestamp.c
M src/include/common/int.h
M src/test/regress/expected/date.out
M src/test/regress/expected/horology.out
M src/test/regress/sql/date.sql
M src/test/regress/sql/horology.sql

Simplify executor's determination of whether to use parallelism.

commit   : 3eea7a0c97e94f9570af87317ce3f6a41eb62768    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 9 Dec 2024 14:38:19 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 9 Dec 2024 14:38:19 -0500    

Click here for diff

Our parallel-mode code only works when we are executing a query  
in full, so ExecutePlan must disable parallel mode when it is  
asked to do partial execution.  The previous logic for this  
involved passing down a flag (variously named execute_once or  
run_once) from callers of ExecutorRun or PortalRun.  This is  
overcomplicated, and unsurprisingly some of the callers didn't  
get it right, since it requires keeping state that not all of  
them have handy; not to mention that the requirements for it were  
undocumented.  That led to assertion failures in some corner  
cases.  The only state we really need for this is the existing  
QueryDesc.already_executed flag, so let's just put all the  
responsibility in ExecutePlan.  (It could have been done in  
ExecutorRun too, leading to a slightly shorter patch -- but if  
there's ever more than one caller of ExecutePlan, it seems better  
to have this logic in the subroutine than the callers.)  
  
This makes those ExecutorRun/PortalRun parameters unnecessary.  
In master it seems okay to just remove them, returning the  
API for those functions to what it was before parallelism.  
Such an API break is clearly not okay in stable branches,  
but for them we can just leave the parameters in place after  
documenting that they do nothing.  
  
Per report from Yugo Nagata, who also reviewed and tested  
this patch.  Back-patch to all supported branches.  
  
Discussion: https://postgr.es/m/[email protected]  

M contrib/auto_explain/auto_explain.c
M contrib/pg_stat_statements/pg_stat_statements.c
M src/backend/commands/copyto.c
M src/backend/commands/createas.c
M src/backend/commands/explain.c
M src/backend/commands/extension.c
M src/backend/commands/matview.c
M src/backend/commands/portalcmds.c
M src/backend/commands/prepare.c
M src/backend/executor/execMain.c
M src/backend/executor/execParallel.c
M src/backend/executor/functions.c
M src/backend/executor/spi.c
M src/backend/tcop/postgres.c
M src/backend/tcop/pquery.c
M src/include/executor/execdesc.h
M src/include/executor/executor.h
M src/include/tcop/pquery.h
M src/include/utils/portal.h

Remove remants of "snapshot too old"

commit   : 4d8275046c36792afb3604677c0a53c8530388ae    
  
author   : Heikki Linnakangas <[email protected]>    
date     : Mon, 9 Dec 2024 18:13:03 +0200    
  
committer: Heikki Linnakangas <[email protected]>    
date     : Mon, 9 Dec 2024 18:13:03 +0200    

Click here for diff

Remove the 'whenTaken' and 'lsn' fields from SnapshotData. After the  
removal of the "snapshot too old" feature, they were never set to a  
non-zero value.  
  
This largely reverts commit 3e2f3c2e423, which added the  
OldestActiveSnapshot tracking, and the init_toast_snapshot()  
function. That was only required for setting the 'whenTaken' and 'lsn'  
fields. SnapshotToast is now a constant again, like SnapshotSelf and  
SnapshotAny. I kept a thin get_toast_snapshot() wrapper around  
SnapshotToast though, to check that you have a registered or active  
snapshot. That's still a useful sanity check.  
  
Reviewed-by: Nathan Bossart, Andres Freund, Tom Lane  
Discussion: https://www.postgresql.org/message-id/[email protected]  

M contrib/amcheck/verify_heapam.c
M src/backend/access/common/toast_internals.c
M src/backend/access/heap/heaptoast.c
M src/backend/storage/ipc/procarray.c
M src/backend/utils/time/snapmgr.c
M src/include/access/genam.h
M src/include/access/toast_internals.h
M src/include/storage/predicate.h
M src/include/utils/snapmgr.h
M src/include/utils/snapshot.h

Avoid unnecessary wrapping for Vars and PHVs

commit   : f64ec81a810ebd4649beb6c153844fa9ae1ecffe    
  
author   : Richard Guo <[email protected]>    
date     : Mon, 9 Dec 2024 20:38:22 +0900    
  
committer: Richard Guo <[email protected]>    
date     : Mon, 9 Dec 2024 20:38:22 +0900    

Click here for diff

When pulling up a lateral subquery that is under an outer join, the  
current code always wraps a Var or PHV in the subquery's targetlist  
into a new PlaceHolderVar if it is a lateral reference to something  
outside the subquery.  This is necessary when the Var/PHV references  
the non-nullable side of the outer join from the nullable side: we  
need to ensure that it is evaluated at the right place and hence is  
forced to null when the outer join should do so.  However, if the  
referenced rel is under the same lowest nulling outer join, we can  
actually omit the wrapping.  That's safe because if the subquery  
variable is forced to NULL by the outer join, the lateral reference  
variable will come out as NULL too.  It could be beneficial to get rid  
of such PHVs because they imply lateral dependencies, which force us  
to resort to nestloop joins.  
  
This patch leverages the newly introduced nullingrel_info to check if  
the nullingrels of the subquery RTE are a subset of those of the  
laterally referenced rel, in order to determine if the referenced rel  
is under the same lowest nulling outer join.  
  
No backpatch as this could result in plan changes.  
  
Author: Richard Guo  
Reviewed-by: James Coleman, Dmitry Dolgov, Andrei Lepikhov  
Discussion: https://postgr.es/m/CAMbWs48uk6C7Z9m_FNT8_21CMCk68hrgAsz=z6zpP1PNZMkeoQ@mail.gmail.com  

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

Fix right-semi-joins in HashJoin rescans

commit   : 5668a857de4f3f12066b2bbc626b77be4fc95ee5    
  
author   : Richard Guo <[email protected]>    
date     : Mon, 9 Dec 2024 20:36:23 +0900    
  
committer: Richard Guo <[email protected]>    
date     : Mon, 9 Dec 2024 20:36:23 +0900    

Click here for diff

When resetting a HashJoin node for rescans, if it is a single-batch  
join and there are no parameter changes for the inner subnode, we can  
just reuse the existing hash table without rebuilding it.  However,  
for join types that depend on the inner-tuple match flags in the hash  
table, we need to reset these match flags to avoid incorrect results.  
This applies to right, right-anti, right-semi, and full joins.  
  
When I introduced "Right Semi Join" plan shapes in aa86129e1, I failed  
to reset the match flags in the hash table for right-semi joins in  
rescans.  This oversight has been shown to produce incorrect results.  
This patch fixes it.  
  
Author: Richard Guo  
Discussion: https://postgr.es/m/CAMbWs4-nQF9io2WL2SkD0eXvfPdyBc9Q=hRwfQHCGV2usa0jyA@mail.gmail.com  

M src/backend/executor/nodeHashjoin.c
M src/test/regress/expected/join.out
M src/test/regress/sql/join.sql

Fix memory leak in pgoutput with publication list cache

commit   : f0c569d7151532fbc9c016b01af49f04a9fb5278    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 9 Dec 2024 16:41:46 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 9 Dec 2024 16:41:46 +0900    

Click here for diff

The pgoutput module caches publication names in a list and frees it upon  
invalidation.  However, the code forgot to free the actual publication  
names within the list elements, as publication names are pstrdup()'d in  
GetPublication().  This would cause memory to leak in  
CacheMemoryContext, bloating it over time as this context is not  
cleaned.  
  
This is a problem for WAL senders running for a long time, as an  
accumulation of invalidation requests would bloat its cache memory  
usage.  A second case, where this leak is easier to see, involves a  
backend calling SQL functions like pg_logical_slot_{get,peek}_changes()  
which create a new decoding context with each execution.  More  
publications create more bloat.  
  
To address this, this commit adds a new memory context within the  
logical decoding context and resets it each time the publication names  
cache is invalidated, based on a suggestion from Amit Kapila.  This  
ensures that the lifespan of the publication names aligns with that of  
the logical decoding context.  
  
This solution changes PGOutputData, which is fine for HEAD but it could  
cause an ABI breakage in stable branches as the structure size would  
change, so these are left out for now.  
  
Analyzed-by: Michael Paquier, Jeff Davis  
Author: Zhijie Hou  
Reviewed-by: Michael Paquier, Masahiko Sawada, Euler Taveira  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/replication/pgoutput/pgoutput.c
M src/include/replication/pgoutput.h

Improve comment about dropped entries in pgstat.c

commit   : 001a537b83ec6e2ab8fa8af44458b0502c94dd5e    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 9 Dec 2024 14:35:39 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 9 Dec 2024 14:35:39 +0900    

Click here for diff

pgstat_write_statsfile() discards any entries marked as dropped from  
being written to the stats file at shutdown, and also included an  
assertion based on the same condition.  
  
The intention of the assertion is to track that no pgstats entries  
should be left around as terminating backends should drop any entries  
they still hold references on before the stats file is written by the  
checkpointer, and it not worth taking down the server in this case if  
there is a bug making that possible.  
  
Let's improve the comment of this area to document clearly what's  
intended.  
  
Based on a discussion with Bertrand Drouvot and Anton A. Melnikov.  
  
Author: Bertrand Drouvot  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 15  

M src/backend/utils/activity/pgstat.c

Improve the error message introduced in commit 87ce27de696.

commit   : 2d0152d6147bb7d12eb120b7e749a323bf91aa6e    
  
author   : Amit Kapila <[email protected]>    
date     : Mon, 9 Dec 2024 09:11:45 +0530    
  
committer: Amit Kapila <[email protected]>    
date     : Mon, 9 Dec 2024 09:11:45 +0530    

Click here for diff

The error detail message "Replica identity consists of an unpublished  
generated column." implies that the entire replica identity is made up of  
an unpublished generated column which may not be the case.  
  
Reported-by: Peter Smith  
Author: Shlok Kyal  
Reviewed-by: Peter Smith, Amit Kapila  
Discussion: https://postgr.es/m/CAHut+PuwMhKx0PhOA4APhJTLoBGNykbeCQpr_CuwGT-SkswG5w@mail.gmail.com  

M src/backend/executor/execReplication.c
M src/test/regress/expected/publication.out

Fix invalidation of local pgstats references for entry reinitialization

commit   : da99fedf8c1726326868d37a0e886caf9107d040    
  
author   : Michael Paquier <[email protected]>    
date     : Mon, 9 Dec 2024 10:45:28 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Mon, 9 Dec 2024 10:45:28 +0900    

Click here for diff

818119afccd3 has introduced the "generation" concept in pgstats entries,  
incremented a counter when a pgstats entry is reinitialized, but it did  
not count on the fact that backends still holding local references to  
such entries need to be refreshed if the cache age is outdated.  The  
previous logic only updated local references when an entry was dropped,  
but it needs also to consider entries that are reinitialized.  
  
This matters for replication slot stats (as well as custom pgstats kinds  
in 18~), where concurrent drops and creates of a slot could cause  
incorrect stats to be locally referenced.  This would lead to an  
assertion failure at shutdown when writing out the stats file, as the  
backend holding an outdated local reference would not be able to drop  
during its shutdown sequence the stats entry that should be dropped, as  
the last process holding a reference to the stats entry.  The  
checkpointer was then complaining about such an entry late in the  
shutdown sequence, after the shutdown checkpoint is finished with the  
control file updated, causing the stats file to not be generated.  In  
non-assert builds, the entry would just be skipped with the stats file  
written.  
  
Note that only logical replication slots use statistics.  
  
A test case based on TAP is added to test_decoding, where a persistent  
connection peeking at a slot's data is kept with concurrent drops and  
creates of the same slot.  This is based on the isolation test case that  
Anton has sent.  As it requires a node shutdown with a check to make  
sure that the stats file is written with this specific sequence of  
events, TAP is used instead.  
  
Reported-by: Anton A. Melnikov  
Reviewed-by: Bertrand Drouvot  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 15  

M contrib/test_decoding/t/001_repl_stats.pl
M src/backend/utils/activity/pgstat_shmem.c

Fix possible crash during WindowAgg evaluation

commit   : 1fe5a347e36f9f5f288b3574597d4e279fc72a65    
  
author   : David Rowley <[email protected]>    
date     : Mon, 9 Dec 2024 14:23:21 +1300    
  
committer: David Rowley <[email protected]>    
date     : Mon, 9 Dec 2024 14:23:21 +1300    

Click here for diff

When short-circuiting WindowAgg node evaluation on the top-level  
WindowAgg node using quals on monotonic window functions, because the  
WindowAgg run condition can mean there's no need to evaluate subsequent  
window function results in the same partition once the run condition  
becomes false, it was possible that the executor would use stale results  
from the previous invocation of the window function in some cases.  
  
A fix for this was partially done by a5832722, but that commit only  
fixed the issue for non-top-level WindowAgg nodes.  I mistakenly thought  
that the top-level WindowAgg didn't have this issue, but Jayesh's example  
case clearly shows that's incorrect.  At the time, I also thought that  
this only affected 32-bit systems as all window functions which then  
supported run conditions returned BIGINT, however, that's wrong as  
ExecProject is still called and that could cause evaluation of any other  
window function belonging to the same WindowAgg node, one of which may  
return a byref type.  
  
The only queries affected by this are WindowAggs with a "Run Condition"  
which contains at least one window function with a byref result type,  
such as lead() or lag() on a byref column.  The window clause must also  
contain a PARTITION BY clause (without a PARTITION BY, execution of the  
WindowAgg stops immediately when the run condition becomes false and  
there's no risk of using the stale results).  
  
Reported-by: Jayesh Dehankar  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 15, where WindowAgg run conditions were added  

M src/backend/executor/nodeWindowAgg.c
M src/test/regress/expected/window.out
M src/test/regress/sql/window.sql

Ensure that pg_amop/amproc entries depend on their lefttype/righttype.

commit   : 3f9b9621766796983c37e192f73c5f8751872c18    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 7 Dec 2024 15:56:28 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 7 Dec 2024 15:56:28 -0500    

Click here for diff

Usually an entry in pg_amop or pg_amproc does not need a dependency on  
its amoplefttype/amoprighttype/amproclefttype/amprocrighttype types,  
because there is an indirect dependency via the argument types of its  
referenced operator or procedure, or via the opclass it belongs to.  
However, for some support procedures in some index AMs, the argument  
types of the support procedure might not mention the column data type  
at all.  Also, the amop/amproc entry might be treated as "loose" in  
the opfamily, in which case it lacks a dependency on any particular  
opclass; or it might be a cross-type entry having a reference to a  
datatype that is not its opclass' opcintype.  
  
The upshot of all this is that there are cases where a datatype can  
be dropped while leaving behind amop/amproc entries that mention it,  
because there is no path in pg_depend showing that those entries  
depend on that type.  Such entries are harmless in normal activity,  
because they won't get used, but they cause problems for maintenance  
actions such as dropping the operator family.  They also cause pg_dump  
to produce bogus output.  The previous commit put a band-aid on the  
DROP OPERATOR FAMILY failure, but a real fix is needed.  
  
To fix, add pg_depend entries showing that a pg_amop/pg_amproc entry  
depends on its lefttype/righttype.  To avoid bloating pg_depend too  
much, skip this if the referenced operator or function has that type  
as an input type.  (I did not bother with considering the possible  
indirect dependency via the opclass' opcintype; at least in the  
reported case, that wouldn't help anyway.)  
  
Probably, the reason this has escaped notice for so long is that  
add-on datatypes and relevant opclasses/opfamilies are usually  
packaged as extensions nowadays, so that there's no way to drop  
a type without dropping the referencing opclasses/opfamilies too.  
Still, in the absence of pg_depend entries there's nothing that  
constrains DROP EXTENSION to drop the opfamily entries before the  
datatype, so it seems possible for a DROP failure to occur anyway.  
  
The specific case that was reported doesn't fail in v13, because  
v13 prefers to attach the support procedure to the opclass not the  
opfamily.  But it's surely possible to construct other edge cases  
that do fail in v13, so patch that too.  
  
Per report from Yoran Heling.  Back-patch to all supported branches.  
  
Discussion: https://postgr.es/m/Z1MVCOh1hprjK5Sf@gmai021  

M src/backend/commands/opclasscmds.c
M src/include/access/amapi.h

Make getObjectDescription robust against dangling amproc type links.

commit   : c82003760d747a64f2decd9664a766485f66121a    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 7 Dec 2024 14:28:16 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 7 Dec 2024 14:28:16 -0500    

Click here for diff

Yoran Heling reported a case where a data type could be dropped  
while references to its OID remain behind in pg_amproc.  This  
causes getObjectDescription to fail, which blocks dropping the  
operator family (since our DROP code likes to construct descriptions  
of everything it's dropping).  The proper fix for this requires  
adding more pg_depend entries.  But to allow DROP to go through with  
already-corrupt catalogs, tweak getObjectDescription to print "???"  
for the type instead of failing when it processes such an entry.  
  
I changed the logic for pg_amop similarly, for consistency,  
although it is not known that the problem can manifest in pg_amop.  
  
Per report from Yoran Heling.  Back-patch to all supported  
branches (although the problem may be unreachable in v13).  
  
Discussion: https://postgr.es/m/Z1MVCOh1hprjK5Sf@gmai021  

M src/backend/catalog/objectaddress.c

Fix is_digit labeling of to_timestamp's FFn format codes.

commit   : 3220ceaf774a2a11f86b33425d836e7072aed677    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 7 Dec 2024 13:12:32 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 7 Dec 2024 13:12:32 -0500    

Click here for diff

These format codes produce or consume strings of digits, so they  
should be labeled with is_digit = true, but they were not.  
This has effect in only one place, where is_next_separator()  
is checked to see if the preceding format code should slurp up  
all the available digits.  Thus, with a format such as '...SSFF3'  
with remaining input '12345', the 'SS' code would consume all  
five digits (and then complain about seconds being out of range)  
when it should eat only two digits.  
  
Per report from Nick Davies.  This bug goes back to d589f9446  
where the FFn codes were introduced, so back-patch to v13.  
  
Discussion: https://postgr.es/m/AM8PR08MB6356AC979252CFEA78B56678B6312@AM8PR08MB6356.eurprd08.prod.outlook.com  

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

doc: remove LC_COLLATE and LC_CTYPE from SHOW command

commit   : 263a3f5f7f508167dbeafc2aefd5835b41d77481    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 7 Dec 2024 12:55:55 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 7 Dec 2024 12:55:55 +0100    

Click here for diff

The corresponding read-only server settings have been removed since  
in PG16. See commit b0f6c437160db6.  
  
Author: Pierre Giraud <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/a75a2fb0-f4b3-4c0c-be3d-7a62d266d760%40dalibo.com  

M doc/src/sgml/ref/show.sgml

Comment fix: "buffer context lock" to "buffer content lock".

commit   : ffe003cae1ff28b698f1769e46e3dc14b5516070    
  
author   : Jeff Davis <[email protected]>    
date     : Fri, 6 Dec 2024 09:59:12 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Fri, 6 Dec 2024 09:59:12 -0800    

Click here for diff

The term "buffer context lock" is outdated as of commit 5d5087363d.  

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

Remove useless casts to (const void *)

commit   : 8743ea1b2eb3dfbb024f40e8d9952cd85596f552    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 6 Dec 2024 17:22:19 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 6 Dec 2024 17:22:19 +0100    

Click here for diff

Similar to commit 7f798aca1d5, but I didn't think to look for "const"  
as well.  

M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/lmgr/lock.c
M src/bin/pg_dump/pg_backup_archiver.c
M src/test/modules/test_tidstore/test_tidstore.c

Fix printf format string warning on MinGW.

commit   : 1319997df92447d9b473a538b109b2d1d560c637    
  
author   : Thomas Munro <[email protected]>    
date     : Fri, 6 Dec 2024 12:34:33 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Fri, 6 Dec 2024 12:34:33 +1300    

Click here for diff

Commit 517bf2d91 changed a printf format string to placate MinGW, which  
at the time warned about "%lld".  Current MinGW is now warning about the  
replacement "%I64d".  Reverting the change clears the warning on the  
MinGW CI task, and hopefully it will clear it on build farm animal  
fairywren too.  
  
Reviewed-by: Tom Lane <[email protected]>  
Reported-by: "Hayato Kuroda (Fujitsu)" <[email protected]>  
Discussion: https://postgr.es/m/TYAPR01MB5866A71B744BE01B3BF71791F5AEA%40TYAPR01MB5866.jpnprd01.prod.outlook.com  

M src/interfaces/ecpg/test/expected/sql-sqlda.c
M src/interfaces/ecpg/test/expected/sql-sqlda.stderr
M src/interfaces/ecpg/test/sql/sqlda.pgc

Remove pg_regex_collation

commit   : 792b2c7e6d926e61e8ff3b33d3e22d7d74e7a437    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 5 Dec 2024 07:19:37 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 5 Dec 2024 07:19:37 +0100    

Click here for diff

We can also use the existing pg_regex_locale as the cache key, which  
is the only use of this variable.  
  
Reviewed-by: Jeff Davis <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/b1b92ae1-2e06-4619-a87a-4b4858e547ec%40eisentraut.org  

M src/backend/regex/regc_pg_locale.c

Fix header inclusion order in c.h.

commit   : 71cb352904c1833fe067d6f191269710fe2ca06f    
  
author   : Thomas Munro <[email protected]>    
date     : Thu, 5 Dec 2024 14:27:35 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Thu, 5 Dec 2024 14:27:35 +1300    

Click here for diff

Commit 962da900a added #include <stdint.h> to postgres_ext.h, which  
broke c.h's header ordering rule.  
  
The system headers on some systems would then lock down off_t's size in  
private macros, before they'd had a chance to see our definition of  
_FILE_OFFSET_BITS (and presumably other things).  This was picked up by  
perl's ABI compatibility checks on some 32 bit systems in the build  
farm.  
  
Move #include "postgres_ext.h" down below the system header section, and  
make the comments clearer (thanks to Tom for the new wording).  
  
Diagnosed-by: Tom Lane <[email protected]>  
Discussion: https://postgr.es/m/2397643.1733347237%40sss.pgh.pa.us  

M src/include/c.h

Provide a better error message for misplaced dispatch options.

commit   : 76fd342496612c8432ef8f6c71794c935497d3c9    
  
author   : Nathan Bossart <[email protected]>    
date     : Wed, 4 Dec 2024 15:04:15 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Wed, 4 Dec 2024 15:04:15 -0600    

Click here for diff

Before this patch, misplacing a special must-be-first option for  
dispatching to a subprogram (e.g., postgres -D . --single) would  
fail with an error like  
  
	FATAL:  --single requires a value  
  
This patch adjusts this error to more accurately complain that the  
special option wasn't listed first.  The aforementioned error  
message now looks like  
  
	FATAL:  --single must be first argument  
  
The dispatch option parsing code has been refactored for use  
wherever ParseLongOption() is called.  Beyond the obvious advantage  
of avoiding code duplication, this should prevent similar problems  
when new dispatch options are added.  Note that we assume that none  
of the dispatch option names match another valid command-line  
argument, such as the name of a configuration parameter.  
  
Ideally, we'd remove this must-be-first requirement for these  
options, but after some investigation, we decided that wasn't worth  
the added complexity and behavior changes.  
  
Author: Nathan Bossart, Greg Sabino Mullane  
Reviewed-by: Greg Sabino Mullane, Peter Eisentraut, Álvaro Herrera, Tom Lane  
Discussion: https://postgr.es/m/CAKAnmmJkZtZAiSryho%3DgYpbvC7H-HNjEDAh16F3SoC9LPu8rqQ%40mail.gmail.com  

M src/backend/bootstrap/bootstrap.c
M src/backend/main/main.c
M src/backend/postmaster/postmaster.c
M src/backend/tcop/postgres.c
M src/include/postmaster/postmaster.h
M src/tools/pgindent/typedefs.list

Return actual error code from FOP failure in PDF build

commit   : 24c1c6338719e4de1dd5f045418e64957781c595    
  
author   : Bruce Momjian <[email protected]>    
date     : Wed, 4 Dec 2024 14:37:24 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Wed, 4 Dec 2024 14:37:24 -0500    

Click here for diff

Previously we returned "1" on error.  Improvement on 77c189cdafe.  
  
Backpatch-through: master  

M doc/src/sgml/Makefile

Fix dead code

commit   : dfbb092cff70ee4d4084b7e4e57228a89ff4f9f8    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 4 Dec 2024 16:43:07 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 4 Dec 2024 16:43:07 +0100    

Click here for diff

from commit 85b7efa1cdd  
  
per Coverity report  

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

Fix use-after-free in parallel_vacuum_reset_dead_items

commit   : ccc8194e4275d0be557a9b94126a12b389520593    
  
author   : John Naylor <[email protected]>    
date     : Wed, 4 Dec 2024 16:51:55 +0700    
  
committer: John Naylor <[email protected]>    
date     : Wed, 4 Dec 2024 16:51:55 +0700    

Click here for diff

parallel_vacuum_reset_dead_items used a local variable to hold a  
pointer from the passed vacrel, purely as a shorthand. This pointer  
was later freed and a new allocation was made and stored to the  
struct. Then the local pointer was mistakenly referenced again.  
  
This apparently happened not to break anything since the freed chunk  
would have been put on the context's freelist, so it was accidentally  
the same pointer anyway, in which case the DSA handle was correctly  
updated. The minimal fix is to change two places so they access  
dead_items through the vacrel. This coding style is a maintenance  
hazard, so while at it get rid of most other similar usages, which  
were inconsistently used anyway.  
  
Analysis and patch by Vallimaharajan G, with further defensive coding  
by me  
  
Backpath to v17, when TidStore came in  
  
Discussion: https://postgr.es/m/[email protected]  

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

Simplify IsIndexUsableForReplicaIdentityFull()

commit   : 7727049e8f663344d4d0457e1d9ec048d626f3d9    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 4 Dec 2024 08:33:28 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 4 Dec 2024 08:33:28 +0100    

Click here for diff

Take Relation as argument instead of IndexInfo.  Building the  
IndexInfo is an unnecessary intermediate step here.  
  
A future patch wants to get some information that is in the relcache  
but not in IndexInfo, so this will also help there.  
  
Discussion: https://www.postgresql.org/message-id/[email protected]  

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

Ensure stored generated columns must be published when required.

commit   : 87ce27de6963091f4a365f80bcdb06b9da098f00    
  
author   : Amit Kapila <[email protected]>    
date     : Wed, 4 Dec 2024 09:45:18 +0530    
  
committer: Amit Kapila <[email protected]>    
date     : Wed, 4 Dec 2024 09:45:18 +0530    

Click here for diff

Ensure stored generated columns that are part of REPLICA IDENTITY must be  
published explicitly for UPDATE and DELETE operations to be published. We  
can publish generated columns by listing them in the column list or by  
enabling the publish_generated_columns option.  
  
This commit changes the behavior of the test added in commit adedf54e65 by  
giving an ERROR for the UPDATE operation in such cases. There is no way to  
trigger the bug reported in commit adedf54e65 but we didn't remove the  
corresponding code change because it is still relevant when replicating  
changes from a publisher with version less than 18.  
  
We decided not to backpatch this behavior change to avoid the risk of  
breaking existing output plugins that may be sending generated columns by  
default although we are not aware of any such plugin. Also, we didn't see  
any reports related to this on STABLE branches which is another reason not  
to backpatch this change.  
  
Author: Shlok Kyal, Hou Zhijie  
Reviewed-by: Vignesh C, Amit Kapila  
Discussion: https://postgr.es/m/CANhcyEVw4V2Awe2AB6i0E5AJLNdASShGfdBLbUd1XtWDboymCA@mail.gmail.com  

M doc/src/sgml/ref/create_publication.sgml
M src/backend/commands/publicationcmds.c
M src/backend/executor/execReplication.c
M src/backend/utils/cache/relcache.c
M src/include/catalog/pg_publication.h
M src/include/commands/publicationcmds.h
M src/test/regress/expected/publication.out
M src/test/regress/sql/publication.sql
M src/test/subscription/t/100_bugs.pl

Properly use $(AWK) in Makefile, not 'awk'

commit   : 77c189cdafe3873b7273149fbc490cc11c431cc3    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 3 Dec 2024 22:31:12 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 3 Dec 2024 22:31:12 -0500    

Click here for diff

Fix for commit 498f1307569.  
  
Backpatch-through: master  

M doc/src/sgml/Makefile

Use <stdint.h> and <inttypes.h> for c.h integers.

commit   : 962da900ac8f0927f1af2fd811ca67fa163c873a    
  
author   : Thomas Munro <[email protected]>    
date     : Wed, 4 Dec 2024 14:46:59 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Wed, 4 Dec 2024 14:46:59 +1300    

Click here for diff

Redefine our exact width types with standard C99 types and macros,  
including int64_t, INT64_MAX, INT64_C(), PRId64 etc.  We were already  
using <stdint.h> types in a few places.  
  
One complication is that Windows' <inttypes.h> uses format strings like  
"%I64d", "%I32", "%I" for PRI*64, PRI*32, PTR*PTR, instead of mapping to  
other standardized format strings like "%lld" etc as seen on other known  
systems.  Teach our snprintf.c to understand them.  
  
This removes a lot of configure clutter, and should also allow 64-bit  
numbers and other standard types to be used in localized messages  
without casting.  
  
Reviewed-by: Peter Eisentraut <[email protected]>  
Discussion: https://postgr.es/m/ME3P282MB3166F9D1F71F787929C0C7E7B6312%40ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM  

M config/c-compiler.m4
M configure
M configure.ac
M meson.build
M src/Makefile.global.in
M src/bin/pg_waldump/pg_waldump.c
M src/bin/pgbench/pgbench.c
M src/include/.gitignore
M src/include/Makefile
M src/include/c.h
M src/include/meson.build
M src/include/pg_config.h.in
D src/include/pg_config_ext.h.in
D src/include/pg_config_ext.h.meson
M src/include/port/pg_bitutils.h
M src/include/postgres_ext.h
M src/include/utils/dsa.h
M src/interfaces/ecpg/ecpglib/typename.c
M src/interfaces/ecpg/include/ecpg_config.h.in
M src/interfaces/ecpg/include/meson.build
M src/interfaces/ecpg/include/pgtypes_interval.h
M src/interfaces/ecpg/include/sqltypes.h
M src/interfaces/ecpg/test/expected/compat_informix-sqlda.c
M src/port/pg_bitutils.c
M src/port/snprintf.c

Define __EXTENSIONS__ on Solaris, too.

commit   : 3b08d5224d7df71cc111d8522cf6190fc02f6fb9    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 3 Dec 2024 20:21:23 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 3 Dec 2024 20:21:23 -0500    

Click here for diff

Apparently, if you define _POSIX_C_SOURCE on Solaris,  
that's interpreted as "you get ONLY what's defined by POSIX".  
Results from BF member hake show that that breaks perl.h,  
and doubtless it'd cause more problems if we got past that.  
Adopt the suggestion from standards(7) that we also need to  
define __EXTENSIONS__, in hopes of un-breaking things.  
  
Discussion: https://postgr.es/m/[email protected]  

M configure
M configure.ac
M meson.build

Fix Makefile so invalid characters warning preserves error code

commit   : 498f130756914e1bc3125ddfc7e5c86f38ded8e8    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 3 Dec 2024 18:27:41 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 3 Dec 2024 18:27:41 -0500    

Click here for diff

Fix for commit e4c8865196f.  
  
Reported-by: Peter Eisentraut  
  
Discussion: https://postgr.es/m/[email protected]  
  
Backpatch-through: master  

M doc/src/sgml/Makefile

Now that we have non-Latin1 SGML detection, restore Latin1 chars

commit   : 8b318a168a5830770722c501d7db0607649b3c33    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 3 Dec 2024 17:09:49 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 3 Dec 2024 17:09:49 -0500    

Click here for diff

This reverts the change in commit 641a5b7a144 that converted them to  
HTML entities.  
  
Reported-by: Peter Eisentraut  
  
Discussion: https://postgr.es/m/[email protected]  
  
Backpatch-through: master  

M doc/src/sgml/charset.sgml
M doc/src/sgml/stylesheet-man.xsl

Move check for ucol_strcollUTF8 to pg_locale_icu.c

commit   : 7167e05fc7d191bfd59f16d0852705d8f4a3fa08    
  
author   : Jeff Davis <[email protected]>    
date     : Tue, 3 Dec 2024 11:32:14 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Tue, 3 Dec 2024 11:32:14 -0800    

Click here for diff

The result of the check is only used by pg_locale_icu.c.  
  
Author: Andreas Karlsson  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/utils/adt/pg_locale_icu.c
M src/include/utils/pg_locale.h

Define _POSIX_C_SOURCE as 200112L on Solaris.

commit   : 32a7deb2a02bc3c81d61eeb943b03ed2010eaac9    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 3 Dec 2024 12:44:43 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 3 Dec 2024 12:44:43 -0500    

Click here for diff

This is an attempt to suppress some compiler warnings that appeared in  
the wake of commit 7f798aca1: it seems that by default Solaris/illumos  
declares shmdt() to take "char *" not "void *".  We'd like the system  
headers to provide modern POSIX APIs, and POSIX 2001 seems to be as  
modern as is available there.  
  
illumos' standards(7) man page suggests that we might also need to  
define __EXTENSIONS__, but let's see what happens with just this.  
  
Discussion: https://postgr.es/m/[email protected]  

M configure
M configure.ac
M meson.build

Fix synchronized_standby_slots GUC check hook

commit   : 3c5f9f12c807760f6d512957a863113b07a79dcb    
  
author   : Álvaro Herrera <[email protected]>    
date     : Tue, 3 Dec 2024 17:50:57 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Tue, 3 Dec 2024 17:50:57 +0100    

Click here for diff

The validate_sync_standby_slots subroutine requires an LWLock, so it  
cannot run in processes without PGPROC; skip it there to avoid a crash.  
  
This replaces the current test for ReplicationSlotCtl being not null,  
which appears to be a solution for the same problem but less general.  
I also rewrote a related comment that mentioned ReplicationSlotCtl in  
StandbySlotsHaveCaughtup.  
  
This code came in with commit bf279ddd1c28; backpatch to 17.  
  
Reported-by: Gabriele Bartolini <[email protected]>  
Reviewed-by: Amit Kapila <[email protected]>  
Reviewed-by: Zhijie Hou <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/replication/slot.c

Drop "Lock" suffix from LWLock wait event names

commit   : 1e5ef3a2a17974f574b90b86f491d74e32615987    
  
author   : Álvaro Herrera <[email protected]>    
date     : Tue, 3 Dec 2024 15:50:03 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Tue, 3 Dec 2024 15:50:03 +0100    

Click here for diff

Commit da952b415f44 unintentially reverted the SQL-visible part of  
commit 14a910109126, which breaks queries joining pg_wait_events with  
pg_stat_acivity.  Remove the suffix again.  
  
Backpatch to 17.  
  
Reported-by: Christophe Courtois <[email protected]>  
Author: Bertrand Drouvot <[email protected]>  
Discussion: https://postgr.es/m/18728-450924477056a339%40postgresql.org  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/storage/lmgr/generate-lwlocknames.pl
M src/backend/storage/lmgr/lwlock.c

Update obsolete comment

commit   : 4cc2a449802ec654b1b3ac4db698c3af4e7fd9f7    
  
author   : Álvaro Herrera <[email protected]>    
date     : Tue, 3 Dec 2024 14:46:31 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Tue, 3 Dec 2024 14:46:31 +0100    

Click here for diff

Commit 3aa0395d4ed3 made worrying about BKI_ROWTYPE_OID matching no  
longer necessary, but this comment didn't get the memo.  

M src/include/catalog/pg_class.dat

Fix handling of CREATE DOMAIN with GENERATED constraint syntax

commit   : 84a67725cd11ffbd5c0e142b067ae90dc3e57270    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 3 Dec 2024 14:32:45 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 3 Dec 2024 14:32:45 +0100    

Click here for diff

Stuff like  
  
    CREATE DOMAIN foo AS int CONSTRAINT cc GENERATED ALWAYS AS (2) STORED  
  
is not supported for domains, but the parser allows it, because it's  
the same syntax as for table constraints.  But CreateDomain() did not  
explicitly handle all ConstrType values, so the above would get an  
internal error like  
  
    ERROR:  unrecognized constraint subtype: 4  
  
Fix that by providing a user-facing error message for all ConstrType  
values.  Also, remove the switch default case, so future additions to  
ConstrType are caught.  
  
Reported-by: Jian He <[email protected]>  
Discussion: https://www.postgresql.org/message-id/CACJufxF8fmM=Dbm4pDFuV_nKGz2-No0k4YifhrF3-rjXTWJM3w@mail.gmail.com  

M src/backend/commands/typecmds.c

Fix temporary memory leak in system table index scans

commit   : 1acf10549e64c6a52ced570d712fcba1a2f5d1ec    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 3 Dec 2024 09:04:20 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 3 Dec 2024 09:04:20 +0100    

Click here for diff

Commit 811af9786b introduced palloc() calls into systable_beginscan()  
and systable_beginscan_ordered().  But there was no pfree(), as is the  
usual style.  
  
It turns out that an ANALYZE of a partitioned table can invoke many  
thousand system table index scans, and this memory is not cleaned up  
until the end of the command, so this can temporarily leak quite a bit  
of memory.  Maybe there are improvements to be made at a higher level  
about this, but for now, insert a couple of corresponding pfree()  
calls to fix this particular issue.  
  
Reported-by: Justin Pryzby <[email protected]>  
Discussion: https://www.postgresql.org/message-id/Z0XTfIq5xUtbkiIh@pryzbyj2023  

M src/backend/access/index/genam.c

Perform provider-specific initialization in new functions.

commit   : 1ba0782ce90cb4261098de59b49ae5cb2326566b    
  
author   : Jeff Davis <[email protected]>    
date     : Mon, 2 Dec 2024 23:20:32 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Mon, 2 Dec 2024 23:20:32 -0800    

Click here for diff

Reviewed-by: Andreas Karlsson  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/utils/adt/Makefile
M src/backend/utils/adt/meson.build
M src/backend/utils/adt/pg_locale.c
A src/backend/utils/adt/pg_locale_builtin.c
M src/backend/utils/adt/pg_locale_icu.c
M src/backend/utils/adt/pg_locale_libc.c

doc: Clarify some terms for pg_createsubscriber

commit   : 8817e8d3a4e5f00a5583e56a17f5d49a4e21dafd    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 3 Dec 2024 16:21:07 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 3 Dec 2024 16:21:07 +0900    

Click here for diff

The last section of pg_createsubscriber used the terms  
"publication-name", "replication-slot-name", and "subscription-name".  
These terms are not defined on the page, which was confusing, and the  
intention is clearly to refer to the values one would give to the  
options --publication, --subscription and --replication-slot.  Let's  
simplify the documentation by mentioning the option switches, instead of  
these terms.  
  
Reported-by: Christophe Courtois  
Author: Shubham Khanna  
Reviewed-by: Vignesh C, Peter Smith  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 17  

M doc/src/sgml/ref/pg_createsubscriber.sgml

Fix unintentional behavior change in commit e9931bfb75.

commit   : e3fa2b037c6f0f435838e99200050dc54c306085    
  
author   : Jeff Davis <[email protected]>    
date     : Mon, 2 Dec 2024 21:59:02 -0800    
  
committer: Jeff Davis <[email protected]>    
date     : Mon, 2 Dec 2024 21:59:02 -0800    

Click here for diff

Prior to that commit, there was special case to use ASCII case mapping  
behavior for the libc provider with a single-byte encoding when that's  
the default collation. Commit e9931bfb75 mistakenly eliminated that  
special case; this commit restores it.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/utils/adt/formatting.c
M src/backend/utils/adt/like.c
M src/backend/utils/adt/pg_locale.c
M src/include/utils/pg_locale.h

Revert "Introduce CompactAttribute array in TupleDesc"

commit   : 4171c44c9b791da3c00386dc6d8e6b1842e3036b    
  
author   : David Rowley <[email protected]>    
date     : Tue, 3 Dec 2024 17:12:38 +1300    
  
committer: David Rowley <[email protected]>    
date     : Tue, 3 Dec 2024 17:12:38 +1300    

Click here for diff

This reverts commit d28dff3f6cd6a7562fb2c211ac0fb74a33ffd032.  
  
Quite a large number of buildfarm members didn't like this commit and  
it's not yet clear why.  Reverting this before too many animals turn  
red.  
  
Discussion: https://postgr.es/m/CAApHDvr9i6T5=iAwQCxFDgMsthr_obVxgwBaEJkC8KUH6yM3Hw@mail.gmail.com  

M src/backend/access/common/heaptuple.c
M src/backend/access/common/indextuple.c
M src/backend/access/common/tupdesc.c
M src/backend/access/spgist/spgutils.c
M src/backend/catalog/index.c
M src/backend/commands/tablecmds.c
M src/backend/executor/execTuples.c
M src/backend/utils/cache/relcache.c
M src/backend/utils/cache/typcache.c
M src/include/access/htup_details.h
M src/include/access/itup.h
M src/include/access/tupdesc.h
M src/include/access/tupmacs.h
M src/tools/pgindent/typedefs.list

Introduce CompactAttribute array in TupleDesc

commit   : d28dff3f6cd6a7562fb2c211ac0fb74a33ffd032    
  
author   : David Rowley <[email protected]>    
date     : Tue, 3 Dec 2024 16:50:59 +1300    
  
committer: David Rowley <[email protected]>    
date     : Tue, 3 Dec 2024 16:50:59 +1300    

Click here for diff

The new compact_attrs array stores a few select fields from  
FormData_pg_attribute in a more compact way, using only 16 bytes per  
column instead of the 104 bytes that FormData_pg_attribute uses.  Using  
CompactAttribute allows performance-critical operations such as tuple  
deformation to be performed without looking at the FormData_pg_attribute  
element in TupleDesc which means fewer cacheline accesses.  With this  
change, NAMEDATALEN could be increased with a much smaller negative impact  
on performance.  
  
For some workloads, tuple deformation can be the most CPU intensive part  
of processing the query.  Some testing with 16 columns on a table  
where the first column is variable length showed around a 10% increase in  
transactions per second for an OLAP type query performing aggregation on  
the 16th column.  However, in certain cases, the increases were much  
higher, up to ~25% on one AMD Zen4 machine.  
  
This also makes pg_attribute.attcacheoff redundant.  A follow-on commit  
will remove it, thus shrinking the FormData_pg_attribute struct by 4  
bytes.  
  
Author: David Rowley  
Discussion: https://postgr.es/m/CAApHDvrBztXP3yx=NKNmo3xwFAFhEdyPnvrDg3=M0RhDs+4vYw@mail.gmail.com  
Reviewed-by: Andres Freund, Victor Yegorov  

M src/backend/access/common/heaptuple.c
M src/backend/access/common/indextuple.c
M src/backend/access/common/tupdesc.c
M src/backend/access/spgist/spgutils.c
M src/backend/catalog/index.c
M src/backend/commands/tablecmds.c
M src/backend/executor/execTuples.c
M src/backend/utils/cache/relcache.c
M src/backend/utils/cache/typcache.c
M src/include/access/htup_details.h
M src/include/access/itup.h
M src/include/access/tupdesc.h
M src/include/access/tupmacs.h
M src/tools/pgindent/typedefs.list

doc Makefile: issue warning about chars that cannot be output

commit   : e4c8865196f6ad6bb3473bcad1d2ad51147e4513    
  
author   : Bruce Momjian <[email protected]>    
date     : Mon, 2 Dec 2024 21:25:12 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Mon, 2 Dec 2024 21:25:12 -0500    

Click here for diff

A follow-up improvement to commit 641a5b7a144.  
  
Reported-by: Tatsuo Ishii, Tom Lane  
  
Discussion: https://postgr.es/m/[email protected]  
  
Backpatch-through: master  

M doc/src/sgml/Makefile

Rework some code handling pg_subscription data in psql and pg_dump

commit   : 08691ea958c2646b6aadefff878539eb0b860bb0    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 3 Dec 2024 09:48:12 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 3 Dec 2024 09:48:12 +0900    

Click here for diff

This commit fixes some inconsistencies found in the frontend code when  
dealing with subscription catalog data.  
  
The following changes are done:  
- pg_subscription.h gains a EXPOSE_TO_CLIENT_CODE, so as more content  
defined in pg_subscription.h becomes available in pg_subscription_d.h  
for the frontend.  
- In psql's describe.c, substream can be switched to use CppAsString2()  
with its three LOGICALREP_STREAM_* values, with pg_subscription_d.h  
included.  
- pg_dump.c included pg_subscription.h, which is a header that should  
only be used in the backend code.  The code is updated to use  
pg_subscription_d.h instead.  
- pg_dump stored all the data from pg_subscription in SubscriptionInfo  
with only strings, and a good chunk of them are boolean and char values.  
Using strings is not necessary, complicates the code (see for example  
two_phase_disabled[] removed here), and is inconsistent with the way  
other catalogs' data is handled.  The fields of SubscriptionInfo are  
reordered to match with the order in its catalog, while on it.  
  
Reviewed-by: Hayato Kuroda  
Discussion: https://postgr.es/m/[email protected]  

M src/bin/pg_dump/pg_dump.c
M src/bin/pg_dump/pg_dump.h
M src/bin/psql/describe.c
M src/include/catalog/pg_subscription.h

RelationTruncate() must set DELAY_CHKPT_START.

commit   : 75818b3afbf850d600e0fcd1a3b03199077063f8    
  
author   : Thomas Munro <[email protected]>    
date     : Tue, 3 Dec 2024 09:27:05 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Tue, 3 Dec 2024 09:27:05 +1300    

Click here for diff

Previously, it set only DELAY_CHKPT_COMPLETE. That was important,  
because it meant that if the XLOG_SMGR_TRUNCATE record preceded a  
XLOG_CHECKPOINT_ONLINE record in the WAL, then the truncation would also  
happen on disk before the XLOG_CHECKPOINT_ONLINE record was  
written.  
  
However, it didn't guarantee that the sync request for the truncation  
was processed before the XLOG_CHECKPOINT_ONLINE record was written. By  
setting DELAY_CHKPT_START, we guarantee that if an XLOG_SMGR_TRUNCATE  
record is written to WAL before the redo pointer of a concurrent  
checkpoint, the sync request queued by that operation must be processed  
by that checkpoint, rather than being left for the following one.  
  
This is a refinement of commit 412ad7a5563.  Back-patch to all supported  
releases, like that commit.  
  
Author: Robert Haas <[email protected]>  
Reported-by: Thomas Munro <[email protected]>  
Discussion: https://postgr.es/m/CA%2BhUKG%2B-2rjGZC2kwqr2NMLBcEBp4uf59QT1advbWYF_uc%2B0Aw%40mail.gmail.com  

M src/backend/catalog/storage.c

Deprecate MD5 passwords.

commit   : db6a4a985bc09d260d5c29848e3c97f080646a53    
  
author   : Nathan Bossart <[email protected]>    
date     : Mon, 2 Dec 2024 13:30:07 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Mon, 2 Dec 2024 13:30:07 -0600    

Click here for diff

MD5 has been considered to be unsuitable for use as a cryptographic  
hash algorithm for some time.  Furthermore, MD5 password hashes in  
PostgreSQL are vulnerable to pass-the-hash attacks, i.e., knowing  
the username and hashed password is sufficient to authenticate.  
The SCRAM-SHA-256 method added in v10 is not subject to these  
problems and is considered to be superior to MD5.  
  
This commit marks MD5 password support in PostgreSQL as deprecated  
and to be removed in a future release.  The documentation now  
contains several deprecation notices, and CREATE ROLE and ALTER  
ROLE now emit deprecation warnings when setting MD5 passwords.  The  
warnings can be disabled by setting the md5_password_warnings  
parameter to "off".  
  
Reviewed-by: Greg Sabino Mullane, Jim Nasby  
Discussion: https://postgr.es/m/ZwbfpJJol7lDWajL%40nathan  

M contrib/passwordcheck/expected/passwordcheck.out
M contrib/passwordcheck/expected/passwordcheck_1.out
M contrib/passwordcheck/sql/passwordcheck.sql
M doc/src/sgml/catalogs.sgml
M doc/src/sgml/client-auth.sgml
M doc/src/sgml/config.sgml
M doc/src/sgml/libpq.sgml
M doc/src/sgml/protocol.sgml
M doc/src/sgml/ref/create_role.sgml
M doc/src/sgml/runtime.sgml
M src/backend/libpq/crypt.c
M src/backend/utils/misc/guc_tables.c
M src/backend/utils/misc/postgresql.conf.sample
M src/include/libpq/crypt.h
M src/test/regress/expected/password.out
M src/test/regress/expected/password_1.out

Add a planner support function for numeric generate_series().

commit   : 97173536ed4b1c29dce0dc4119db136e142f60a2    
  
author   : Dean Rasheed <[email protected]>    
date     : Mon, 2 Dec 2024 11:37:57 +0000    
  
committer: Dean Rasheed <[email protected]>    
date     : Mon, 2 Dec 2024 11:37:57 +0000    

Click here for diff

This allows the planner to estimate the number of rows returned by  
generate_series(numeric, numeric[, numeric]), when the input values  
can be estimated at plan time.  
  
Song Jinzhou, reviewed by Dean Rasheed and David Rowley.  
  
Discussion: https://postgr.es/m/tencent_F43E7F4DD50EF5986D1051DE8DE547910206%40qq.com  
Discussion: https://postgr.es/m/tencent_1F6D5B9A1545E02FD7D0EE508DFD056DE50A%40qq.com  

M src/backend/utils/adt/numeric.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

Fix #include order in timestamp.c.

commit   : 33152358453cc46f986483e9f82418fb8ba8eaef    
  
author   : Dean Rasheed <[email protected]>    
date     : Mon, 2 Dec 2024 11:34:26 +0000    
  
committer: Dean Rasheed <[email protected]>    
date     : Mon, 2 Dec 2024 11:34:26 +0000    

Click here for diff

Oversight in 036bdcec9f.  

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

Fix error code for referential action RESTRICT

commit   : 086c84b23d99c2ad268f97508cd840efc1fdfd79    
  
author   : Peter Eisentraut <[email protected]>    
date     : Mon, 2 Dec 2024 08:18:36 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Mon, 2 Dec 2024 08:18:36 +0100    

Click here for diff

According to the SQL standard, if the referential action RESTRICT is  
triggered, it has its own error code.  We previously didn't use that,  
we just used the error code for foreign key violation.  But RESTRICT  
is not necessarily an actual foreign key violation.  The foreign key  
might still be satisfied in theory afterwards, but the RESTRICT  
setting prevents the action even then.  So it's a separate kind of  
error condition.  
  
Discussion: https://www.postgresql.org/message-id/[email protected]  

M src/backend/utils/adt/ri_triggers.c
M src/test/regress/expected/collate.icu.utf8.out
M src/test/regress/expected/foreign_key.out
M src/test/regress/expected/without_overlaps.out

Fix broken list-munging in ecpg's remove_variables().

commit   : 2f696453d2b39fea800d5f7d8e5d3e1a2266de24    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 1 Dec 2024 14:15:37 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 1 Dec 2024 14:15:37 -0500    

Click here for diff

The loops over cursor argument variables neglected to ever advance  
"prevvar".  The code would accidentally do the right thing anyway  
when removing the first or second list entry, but if it had to  
remove the third or later entry then it would also remove all  
entries between there and the first entry.  AFAICS this would  
only matter for cursors that reference out-of-scope variables,  
which is a weird Informix compatibility hack; between that and  
the lack of impact for short lists, it's not so surprising that  
nobody has complained.  Nonetheless it's a pretty obvious bug.  
  
It would have been more obvious if these loops used a more standard  
coding style for chasing the linked lists --- this business with the  
"prev" pointer sometimes pointing at the current list entry is  
confusing and overcomplicated.  So rather than just add a minimal  
band-aid, I chose to rewrite the loops in the same style we use  
elsewhere, where the "prev" pointer is NULL until we are dealing with  
a non-first entry and we save the "next" pointer at the top of the  
loop.  (Two of the four loops touched here are not actually buggy,  
but it seems better to make them all look alike.)  
  
Coverity discovered this problem, but not until 2b41de4a5 added code  
to free no-longer-needed arguments structs.  With that, the incorrect  
link updates are possibly touching freed memory, and it complained  
about that.  Nonetheless the list corruption hazard is ancient, so  
back-patch to all supported branches.  

M src/interfaces/ecpg/preproc/variable.c

Avoid mislabeling of lateral references, redux.

commit   : e032e4c7ddd0e1f7865b246ec18944365d4f8614    
  
author   : Tom Lane <[email protected]>    
date     : Sat, 30 Nov 2024 12:42:19 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sat, 30 Nov 2024 12:42:19 -0500    

Click here for diff

As I'd feared, commit 5c9d8636d was still a few bricks shy of a load.  
We can't just leave pulled-up lateral-reference Vars with no new  
nullingrels: we have to carefully compute what subset of the  
to-be-replaced Var's nullingrels apply to them, else we still get  
"wrong varnullingrels" errors.  This is a bit tedious, but it looks  
like we can use the nullingrel data this patch computes for other  
purposes, enabling better optimization.  We don't want to inject  
unnecessary plan changes into stable branches though, so leave that  
idea for a later HEAD-only patch.  
  
Patch by me, but thanks to Richard Guo for devising a test case that  
broke 5c9d8636d, and for preliminary investigation about how to fix  
it.  As before, back-patch to v16.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/optimizer/prep/prepjointree.c
M src/test/regress/expected/subselect.out
M src/test/regress/sql/subselect.sql
M src/tools/pgindent/typedefs.list

doc: Fix typo

commit   : 49ae9fd8b7081c075b74889449b29d47fd80eaf3    
  
author   : Peter Eisentraut <[email protected]>    
date     : Sat, 30 Nov 2024 08:43:46 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Sat, 30 Nov 2024 08:43:46 +0100    

Click here for diff

for commit 1e08905842f  
  
Reported-by: Marcos Pegoraro <[email protected]>  

M doc/src/sgml/ddl.sgml

Small indenting fixes in jsonpath_scan.l

commit   : 5d39becf8ba0080c98fee4b63575552f6800b012    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 29 Nov 2024 11:33:21 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 29 Nov 2024 11:33:21 +0100    

Click here for diff

Some lines were indented by an inconsistent number of spaces.  While  
we're here, also fix some code that used the newline after left  
parenthesis style, which is obsolete.  

M src/backend/utils/adt/jsonpath_scan.l

doc: Improve description of referential actions

commit   : 1e08905842fbfa9301374f10571116bc5f0f7b8a    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 29 Nov 2024 08:52:28 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 29 Nov 2024 08:52:28 +0100    

Click here for diff

Some of the differences between NO ACTION and RESTRICT were not  
explained fully.  
  
Discussion: https://www.postgresql.org/message-id/[email protected]  

M doc/src/sgml/ddl.sgml
M doc/src/sgml/ref/create_table.sgml

Add tests for foreign keys with case-insensitive collations

commit   : 4a2dbfc6be45c4ce2d9ac53502f931e6b1d70318    
  
author   : Peter Eisentraut <[email protected]>    
date     : Fri, 29 Nov 2024 08:52:27 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Fri, 29 Nov 2024 08:52:27 +0100    

Click here for diff

Some of the behaviors of the different referential actions, such as  
the difference between NO ACTION and RESTRICT are best illustrated  
using a case-insensitive collation.  So add some tests for that.  
  
(What is actually being tested here is the behavior with values that  
are "distinct" (binary different) but compare as equal.  Another way  
to do that would be with positive and negative zeroes with float  
types.  But this way seems nicer and more flexible.)  
  
Discussion: https://www.postgresql.org/message-id/[email protected]  

M src/test/regress/expected/collate.icu.utf8.out
M src/test/regress/sql/collate.icu.utf8.sql

Skip not SOAP-supported indexes while transforming an OR clause into SAOP

commit   : 5bba0546eecb32f4ff9388815727304823940ef6    
  
author   : Alexander Korotkov <[email protected]>    
date     : Fri, 29 Nov 2024 09:48:29 +0200    
  
committer: Alexander Korotkov <[email protected]>    
date     : Fri, 29 Nov 2024 09:48:29 +0200    

Click here for diff

There is no point in transforming OR-clauses into SAOP's if the target index  
doesn't support SAOP scans anyway.  This commit adds corresponding checks  
to match_orclause_to_indexcol() and group_similar_or_args().  The first check  
fixes the actual bug, while the second just saves some cycles.  
  
Reported-by: Alexander Lakhin  
Discussion: https://postgr.es/m/8174de69-9e1a-0827-0e81-ef97f56a5939%40gmail.com  
Author: Alena Rybakina  
Reviewed-by: Ranier Vilela, Alexander Korotkov, Andrei Lepikhov  

M src/backend/optimizer/path/indxpath.c
M src/test/regress/expected/create_index.out
M src/test/regress/sql/create_index.sql

Fix typo in header comment for set_operation_ordered_results_useful

commit   : b6612aedc53a6bf069eba5e356a8421ad6426486    
  
author   : David Rowley <[email protected]>    
date     : Fri, 29 Nov 2024 15:56:24 +1300    
  
committer: David Rowley <[email protected]>    
date     : Fri, 29 Nov 2024 15:56:24 +1300    

Click here for diff

Reported-by: Richard Guo  
Discussion: https://postgr.es/m/CAMbWs492vMy3XNjDZRtqtHfFTK6HVeDwhrEQH7eXGgF_h5Jnzw@mail.gmail.com  

M src/backend/optimizer/prep/prepunion.c

psql: Sprinkle more CppAsString2() in describe.c

commit   : 18954ce7f69b0a4725b1cf1845ed5fd3874e2a92    
  
author   : Michael Paquier <[email protected]>    
date     : Fri, 29 Nov 2024 08:53:09 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Fri, 29 Nov 2024 08:53:09 +0900    

Click here for diff

Like 91f5a4a000ea for pg_amcheck, this makes the code more  
self-documented as there is less need to look in the headers what a  
hardcoded value means.  This touches queries related to procedures, AMs,  
functions, databases, relations, constraints, collations, types and  
extended stats, pulling into psql their *_d.h headers.  The queries are  
written the same way as originally.  
  
There are still a couple of hardcoded values.  These cannot be included  
yet as they are not exposed in headers that are safe to use in frontend  
code.  
  
Note that describe.c was including pg_am.h that should be used only in  
backend code.  This is updated to use pg_am_d.h.  
  
Reviewed-by: Daniel Gustafsson, Corey Huinker  
Discussion: https://postgr.es/m/[email protected]  

M src/bin/psql/describe.c

Avoid mislabeling of lateral references when pulling up a subquery.

commit   : 5c9d8636d30d0838c7432c2c75096b4cd7801971    
  
author   : Tom Lane <[email protected]>    
date     : Thu, 28 Nov 2024 17:33:16 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Thu, 28 Nov 2024 17:33:16 -0500    

Click here for diff

If we are pulling up a subquery that's under an outer join, and  
the subquery's target list contains a strict expression that uses  
both a subquery variable and a lateral-reference variable, it's okay  
to pull up the expression without wrapping it in a PlaceHolderVar.  
That's safe because if the subquery variable is forced to NULL  
by the outer join, the expression result will come out as NULL too,  
so we don't have to force that outcome by evaluating the expression  
below the outer join.  It'd be correct to wrap in a PHV, but that can  
lead to very significantly worse plans, since we'd then have to use  
a nestloop plan to pass down the lateral reference to where the  
expression will be evaluated.  
  
However, when we do that, we should not mark the lateral reference  
variable as being nulled by the outer join, because it isn't after  
we pull up the expression in this way.  So the marking logic added  
by cb8e50a4a was incorrect in this detail, leading to "wrong  
varnullingrels" errors from the consistency-checking logic in  
setrefs.c.  It seems to be sufficient to just not mark lateral  
references at all in this case.  (I have a nagging feeling that more  
complexity may be needed in cases where there are several levels of  
outer join, but some attempts to break it with that didn't succeed.)  
  
Per report from Bertrand Mamasam.  Back-patch to v16, as the previous  
patch was.  
  
Discussion: https://postgr.es/m/CACZ67_UA_EVrqiFXJu9XK50baEpH=ofEPJswa2kFxg6xuSw-ww@mail.gmail.com  

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

Fix wording in comment

commit   : 0c01f509a38f5b1f5fab26d98ae55d796541c2e4    
  
author   : Daniel Gustafsson <[email protected]>    
date     : Thu, 28 Nov 2024 15:17:49 +0100    
  
committer: Daniel Gustafsson <[email protected]>    
date     : Thu, 28 Nov 2024 15:17:49 +0100    

Click here for diff

Author: Peter Smith <[email protected]>  
Reviewed-by: vignesh C <[email protected]>  
Discussion: https://postgr.es/m/CAHut+PvE+2T2etdTaHi3n+xbCG_UYrshQuCbaAdJCFPpQGLwgQ@mail.gmail.com  

M src/include/replication/reorderbuffer.h

psql: Add tab completion for COPY (MERGE ...

commit   : 25ec329afa175a3a27d0d49ef5214d9249421de5    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 28 Nov 2024 09:14:41 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 28 Nov 2024 09:14:41 +0100    

Click here for diff

The underlying feature for this was added in PostgreSQL 17.  
  
Author: Jian He <[email protected]>  
Discussion: https://www.postgresql.org/message-id/CACJufxEmNjxvf1deR1zBrJbjAMeCooooLRzZ+yaaBuqDKh_6-Q@mail.gmail.com  

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

Remove useless casts to (void *)

commit   : 7f798aca1d5df290aafad41180baea0ae311b4ee    
  
author   : Peter Eisentraut <[email protected]>    
date     : Thu, 28 Nov 2024 08:19:22 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Thu, 28 Nov 2024 08:19:22 +0100    

Click here for diff

Many of them just seem to have been copied around for no real reason.  
Their presence causes (small) risks of hiding actual type mismatches  
or silently discarding qualifiers  
  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M contrib/amcheck/verify_nbtree.c
M contrib/bloom/blinsert.c
M contrib/bloom/blutils.c
M contrib/btree_gist/btree_bit.c
M contrib/btree_gist/btree_bool.c
M contrib/btree_gist/btree_bytea.c
M contrib/btree_gist/btree_cash.c
M contrib/btree_gist/btree_date.c
M contrib/btree_gist/btree_enum.c
M contrib/btree_gist/btree_float4.c
M contrib/btree_gist/btree_float8.c
M contrib/btree_gist/btree_inet.c
M contrib/btree_gist/btree_int2.c
M contrib/btree_gist/btree_int4.c
M contrib/btree_gist/btree_int8.c
M contrib/btree_gist/btree_interval.c
M contrib/btree_gist/btree_macaddr.c
M contrib/btree_gist/btree_macaddr8.c
M contrib/btree_gist/btree_numeric.c
M contrib/btree_gist/btree_oid.c
M contrib/btree_gist/btree_text.c
M contrib/btree_gist/btree_time.c
M contrib/btree_gist/btree_ts.c
M contrib/btree_gist/btree_uuid.c
M contrib/file_fdw/file_fdw.c
M contrib/hstore/hstore_op.c
M contrib/intarray/_int_bool.c
M contrib/ltree/_ltree_gist.c
M contrib/ltree/_ltree_op.c
M contrib/pg_trgm/trgm_gist.c
M contrib/pgcrypto/openssl.c
M contrib/postgres_fdw/postgres_fdw.c
M src/backend/access/brin/brin.c
M src/backend/access/brin/brin_minmax_multi.c
M src/backend/access/common/detoast.c
M src/backend/access/gin/ginbulk.c
M src/backend/access/gin/gininsert.c
M src/backend/access/gist/gist.c
M src/backend/access/gist/gistbuild.c
M src/backend/access/hash/hash.c
M src/backend/access/heap/vacuumlazy.c
M src/backend/access/nbtree/nbtree.c
M src/backend/access/nbtree/nbtsort.c
M src/backend/access/spgist/spginsert.c
M src/backend/access/spgist/spgutils.c
M src/backend/access/transam/twophase.c
M src/backend/access/transam/xlogrecovery.c
M src/backend/catalog/dependency.c
M src/backend/catalog/heap.c
M src/backend/catalog/index.c
M src/backend/catalog/objectaccess.c
M src/backend/catalog/pg_proc.c
M src/backend/catalog/pg_publication.c
M src/backend/commands/copyfrom.c
M src/backend/commands/foreigncmds.c
M src/backend/commands/indexcmds.c
M src/backend/commands/lockcmds.c
M src/backend/commands/policy.c
M src/backend/commands/publicationcmds.c
M src/backend/commands/tablecmds.c
M src/backend/commands/tablespace.c
M src/backend/commands/typecmds.c
M src/backend/commands/vacuum.c
M src/backend/commands/variable.c
M src/backend/executor/execExpr.c
M src/backend/executor/execExprInterp.c
M src/backend/executor/execIndexing.c
M src/backend/executor/functions.c
M src/backend/executor/nodeAgg.c
M src/backend/executor/nodeSort.c
M src/backend/executor/nodeWindowAgg.c
M src/backend/libpq/hba.c
M src/backend/nodes/nodeFuncs.c
M src/backend/nodes/params.c
M src/backend/nodes/read.c
M src/backend/optimizer/geqo/geqo_main.c
M src/backend/optimizer/path/costsize.c
M src/backend/optimizer/path/indxpath.c
M src/backend/optimizer/plan/createplan.c
M src/backend/optimizer/plan/setrefs.c
M src/backend/optimizer/plan/subselect.c
M src/backend/optimizer/prep/prepagg.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/predtest.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/parse_agg.c
M src/backend/parser/parse_collate.c
M src/backend/parser/parse_cte.c
M src/backend/parser/parse_node.c
M src/backend/parser/parse_param.c
M src/backend/parser/scan.l
M src/backend/partitioning/partprune.c
M src/backend/port/sysv_shmem.c
M src/backend/replication/logical/logical.c
M src/backend/replication/logical/tablesync.c
M src/backend/replication/slot.c
M src/backend/replication/syncrep.c
M src/backend/rewrite/rewriteDefine.c
M src/backend/rewrite/rewriteHandler.c
M src/backend/rewrite/rewriteManip.c
M src/backend/storage/buffer/buf_table.c
M src/backend/storage/buffer/bufmgr.c
M src/backend/storage/ipc/shmem.c
M src/backend/tcop/postgres.c
M src/backend/tsearch/dict_thesaurus.c
M src/backend/tsearch/spell.c
M src/backend/tsearch/ts_locale.c
M src/backend/tsearch/ts_parse.c
M src/backend/tsearch/wparser.c
M src/backend/utils/adt/acl.c
M src/backend/utils/adt/array_userfuncs.c
M src/backend/utils/adt/arrayfuncs.c
M src/backend/utils/adt/datetime.c
M src/backend/utils/adt/datum.c
M src/backend/utils/adt/domains.c
M src/backend/utils/adt/enum.c
M src/backend/utils/adt/expandedrecord.c
M src/backend/utils/adt/jsonb.c
M src/backend/utils/adt/jsonfuncs.c
M src/backend/utils/adt/jsonpath_exec.c
M src/backend/utils/adt/jsonpath_scan.l
M src/backend/utils/adt/lockfuncs.c
M src/backend/utils/adt/multirangetypes.c
M src/backend/utils/adt/orderedsetaggs.c
M src/backend/utils/adt/partitionfuncs.c
M src/backend/utils/adt/rangetypes.c
M src/backend/utils/adt/regexp.c
M src/backend/utils/adt/tsgistidx.c
M src/backend/utils/adt/tsrank.c
M src/backend/utils/adt/tsvector_op.c
M src/backend/utils/adt/xml.c
M src/backend/utils/cache/plancache.c
M src/backend/utils/cache/typcache.c
M src/backend/utils/error/elog.c
M src/backend/utils/hash/dynahash.c
M src/backend/utils/mmgr/mcxt.c
M src/backend/utils/sort/tuplesortvariants.c
M src/backend/utils/sort/tuplestore.c
M src/bin/pg_dump/pg_backup_archiver.c
M src/bin/pg_dump/pg_backup_custom.c
M src/bin/pg_dump/pg_backup_directory.c
M src/bin/pg_dump/pg_backup_tar.c
M src/bin/psql/mainloop.c
M src/bin/psql/startup.c
M src/include/common/pg_prng.h
M src/interfaces/ecpg/ecpglib/connect.c
M src/interfaces/ecpg/ecpglib/descriptor.c
M src/interfaces/ecpg/ecpglib/memory.c
M src/pl/plpgsql/src/pl_comp.c
M src/pl/plpgsql/src/pl_exec.c
M src/pl/plpgsql/src/pl_handler.c
M src/pl/plpython/plpy_exec.c
M src/test/isolation/isolationtester.c
M src/test/modules/test_regex/test_regex.c

Require sizeof(bool) == 1.

commit   : 97525bc5c8ffb31475d23955d08e9ec9c1408f33    
  
author   : Thomas Munro <[email protected]>    
date     : Thu, 28 Nov 2024 11:48:07 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Thu, 28 Nov 2024 11:48:07 +1300    

Click here for diff

The C standard says that sizeof(bool) is implementation-defined, but we  
know of no current systems where it is not 1.  The last known systems  
seem to have been Apple macOS/PowerPC 10.5 and Microsoft Visual C++ 4,  
both long defunct.  
  
PostgreSQL has always required sizeof(bool) == 1 for the definition of  
bool that it used, but previously it would define its own type if the  
system-provided bool had a different size.  That was liable to cause  
memory layout problems when interacting with system and third-party  
libraries on (by now hypothetical) computers with wider _Bool, and now  
C23 has introduced a new problem by making bool a built-in datatype  
(like C++), so the fallback code doesn't even compile.  We could  
probably work around that, but then we'd be writing new untested code  
for a computer that doesn't exist.  
  
Instead, delete the unreachable and C23-uncompilable fallback code, and  
let existing static assertions fail if the system-provided bool is too  
wide.  If we ever get a problem report from a real system, then it will  
be time to figure out what to do about it in a way that also works on  
modern compilers.  
  
Note on C++: Previously we avoided including <stdbool.h> or trying to  
define a new bool type in headers that might be included by C++ code.  
These days we might as well just include <stdbool.h> unconditionally:  
it should be visible to C++11 but do nothing, just as in C23.  We  
already include <stdint.h> without C++ guards in c.h, and that falls  
under the same C99-compatibility section of the C++11 standard as  
<stdbool.h>, so let's remove the guards here too.  
  
Reviewed-by: Tom Lane <[email protected]>  
Discussion: https://postgr.es/m/3198438.1731895163%40sss.pgh.pa.us  

M configure
M configure.ac
M meson.build
M src/backend/jit/llvm/llvmjit_types.c
M src/backend/utils/fmgr/dfmgr.c
M src/include/c.h
M src/include/pg_config.h.in
M src/interfaces/ecpg/include/ecpg_config.h.in
M src/interfaces/ecpg/include/ecpglib.h
M src/interfaces/ecpg/include/meson.build
M src/pl/plperl/plperl_system.h

Use __attribute__((target(...))) for SSE4.2 CRC-32C support.

commit   : 4b03a27fafc98e2a34e4e0b5ca44895211e021cc    
  
author   : Nathan Bossart <[email protected]>    
date     : Wed, 27 Nov 2024 16:19:05 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Wed, 27 Nov 2024 16:19:05 -0600    

Click here for diff

Presently, we check for compiler support for the required  
intrinsics both with and without the -msse4.2 compiler flag, and  
then depending on the results of those checks, we pick which files  
to compile with which flags.  This is tedious and complicated, and  
it results in unsustainable coding patterns such as separate files  
for each portion of code that may need to be built with different  
compiler flags.  
  
This commit makes use of the newly-added support for  
__attribute__((target(...))) in the SSE4.2 CRC-32C code.  This  
simplifies both the configure-time checks and the build scripts,  
and it allows us to place the functions that use the intrinsics in  
files that we otherwise do not want to build with special CPU  
instructions (although this commit refrains from doing so).  This  
is also preparatory work for a proposed follow-up commit that will  
further optimize the CRC-32C code with AVX-512 instructions.  
  
While at it, this commit modifies meson's checks for SSE4.2 CRC  
support to be the same as autoconf's.  meson was choosing whether  
to use a runtime check based purely on whether -msse4.2 is  
required, while autoconf has long checked for the __SSE4_2__  
preprocessor symbol to decide.  meson's previous approach seems to  
work just fine, but this change avoids needing to build multiple  
test programs and to keep track of whether to actually use  
pg_attribute_target().  
  
Ideally we'd use __attribute__((target(...))) for ARMv8 CRC  
support, too, but there's little point in doing so because until  
clang 16, using the ARM intrinsics still requires special compiler  
flags.  Perhaps we can re-evaluate this decision after some time  
has passed.  
  
Author: Raghuveer Devulapalli  
Discussion: https://postgr.es/m/PH8PR11MB8286BE735A463468415D46B5FB5C2%40PH8PR11MB8286.namprd11.prod.outlook.com  

M config/c-compiler.m4
M configure
M configure.ac
M meson.build
M src/port/Makefile
M src/port/meson.build
M src/port/pg_crc32c_sse42.c

Make GUC_check_errdetail messages full sentences

commit   : 6ba9892f5cb8c2f1c2592198d938cc8f5cf52edc    
  
author   : Álvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2024 19:46:06 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2024 19:46:06 +0100    

Click here for diff

They were all missing punctuation, one was missing initial capital.  
Per our message style guidelines.  
  
No backpatch, to avoid breaking existing translations.  

M src/backend/access/transam/slru.c
M src/backend/access/transam/xlogrecovery.c
M src/backend/commands/vacuum.c
M src/backend/replication/slot.c
M src/backend/replication/syncrep.c
M src/backend/storage/file/fd.c
M src/backend/utils/error/elog.c

Remove redundant relam initialization

commit   : fd9924542bccc488731361861903e3f9f3cf11fa    
  
author   : Álvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2024 19:13:37 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2024 19:13:37 +0100    

Click here for diff

This struct member is initialized again a few lines below in the same  
function.  This is cosmetic, so no backpatch.  
  
Reported-by: Jingtang Zhang <[email protected]>  
Discussion: https://postgr.es/m/[email protected]  

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

ecpg: clean up some other assorted memory leaks.

commit   : 2b41de4a5b429c53ae5fb5ff92b2e9822fd2cd9a    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 27 Nov 2024 12:50:15 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 27 Nov 2024 12:50:15 -0500    

Click here for diff

Avoid leaking the prior value when updating the "connection"  
state variable.  
  
Ditto for ECPGstruct_sizeof.  (It seems like this one ought to  
be statement-local, but testing says it isn't, and I didn't  
feel like diving deeper.)  
  
The actual_type[] entries are statement-local, though, so  
no need to mm_strdup() strings stored in them.  
  
Likewise, sqlda variables are statement-local, so we can  
loc_alloc them.  
  
Also clean up sloppiness around management of the argsinsert and  
argsresult lists.  
  
progname changes are strictly to prevent valgrind from complaining  
about leaked allocations.  
  
With this, valgrind reports zero leakage in the ecpg preprocessor  
for all of our ecpg regression test cases.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/interfaces/ecpg/preproc/descriptor.c
M src/interfaces/ecpg/preproc/ecpg.addons
M src/interfaces/ecpg/preproc/ecpg.c
M src/interfaces/ecpg/preproc/ecpg.header
M src/interfaces/ecpg/preproc/ecpg.trailer
M src/interfaces/ecpg/preproc/output.c
M src/interfaces/ecpg/preproc/variable.c

ecpg: put all string-valued tokens returned by pgc.l in local storage.

commit   : 85312d95e959bae16c5d0bbf79ae74bcd7fec1a9    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 27 Nov 2024 12:44:03 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 27 Nov 2024 12:44:03 -0500    

Click here for diff

This didn't work earlier in the patch series (I think some of  
the strings were ending up in data-type-related structures),  
but apparently we're now clean enough for it.  This considerably  
reduces process-lifespan memory leakage.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/interfaces/ecpg/preproc/parser.c
M src/interfaces/ecpg/preproc/pgc.l

commit   : 0e6060790d6533847084770845c84e81862bff47    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 27 Nov 2024 12:41:20 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 27 Nov 2024 12:41:20 -0500    

Click here for diff

ECPGfree_type() and related functions were quite incomplete  
about removing subsidiary data structures.  Possibly this is  
because ecpg wasn't careful to make sure said data structures  
always had their own storage.  Previous patches in this series  
cleaned up a lot of that, and I had to add a couple more  
mm_strdup's here.  
  
Also, ecpg.trailer tended to overwrite struct_member_list[struct_level]  
without bothering to free up its previous contents, thus potentially  
leaking a lot of struct-member-related storage.  Add  
ECPGfree_struct_member() calls at appropriate points.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/interfaces/ecpg/preproc/ecpg.header
M src/interfaces/ecpg/preproc/ecpg.trailer
M src/interfaces/ecpg/preproc/type.c
M src/interfaces/ecpg/preproc/type.h
M src/interfaces/ecpg/preproc/variable.c

jsonapi: add lexer option to keep token ownership

commit   : 5c32c21afe6449a19b6dfafa17f29b71c9595e03    
  
author   : Andrew Dunstan <[email protected]>    
date     : Wed, 27 Nov 2024 12:05:44 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Wed, 27 Nov 2024 12:05:44 -0500    

Click here for diff

Commit 0785d1b8b adds support for libpq as a JSON client, but  
allocations for string tokens can still be leaked during parsing  
failures. This is tricky to fix for the object_field semantic callbacks:  
the field name must remain valid until the end of the object, but if a  
parsing error is encountered partway through, object_field_end() won't  
be invoked and the client won't get a chance to free the field name.  
  
This patch adds a flag to switch the ownership of parsed tokens to the  
lexer. When this is enabled, the client must make a copy of any tokens  
it wants to persist past the callback lifetime, but the lexer will  
handle necessary cleanup on failure.  
  
Backend uses of the JSON parser don't need to use this flag, since the  
parser's allocations will occur in a short lived memory context.  
  
A -o option has been added to test_json_parser_incremental to exercise  
the new setJsonLexContextOwnsTokens() API, and the test_json_parser TAP  
tests make use of it. (The test program now cleans up allocated memory,  
so that tests can be usefully run under leak sanitizers.)  
  
Author: Jacob Champion  
  
Discussion: https://postgr.es/m/CAOYmi+kb38EciwyBQOf9peApKGwraHqA7pgzBkvoUnw5BRfS1g@mail.gmail.com  

M src/common/jsonapi.c
M src/include/common/jsonapi.h
M src/test/modules/test_json_parser/t/001_test_json_parser_incremental.pl
M src/test/modules/test_json_parser/t/002_inline.pl
M src/test/modules/test_json_parser/t/003_test_semantic.pl
M src/test/modules/test_json_parser/test_json_parser_incremental.c

ci: Fix cached MacPorts installation management

commit   : 262283d5eec3d582a8645692fede2e8f5e6029bd    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 27 Nov 2024 11:28:59 -0500    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 27 Nov 2024 11:28:59 -0500    

Click here for diff

1.  The error reporting of "port setrequested list-of-packages..."  
changed, hiding errors we were relying on to know if all packages in our  
list were already installed.  Use a loop instead.  
  
2.  The cached MacPorts installation was shared between PostgreSQL  
major branches, though each branch wanted different packages.  Add the  
list of packages to cache key, so that different branches, when tested  
in one github account/repo such as postgres/postgres, stop fighting with  
each other, adding and removing packages.  
  
Back-patch to 15 where CI began.  
  
Author: Thomas Munro <[email protected]>  
Author: Nazir Bilal Yavuz <[email protected]>  
Suggested-by: Andres Freund <[email protected]>  
Discussion: https://postgr.es/m/au2uqfuy2nf43nwy2txmc5t2emhwij7kzupygto3d2ffgtrdgr%40ckvrlwyflnh2  

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

Look up backend type in pg_signal_backend() more cheaply.

commit   : 61171a632d10ad7abe1d7ad891176266cc5ef0e1    
  
author   : Nathan Bossart <[email protected]>    
date     : Wed, 27 Nov 2024 10:32:25 -0600    
  
committer: Nathan Bossart <[email protected]>    
date     : Wed, 27 Nov 2024 10:32:25 -0600    

Click here for diff

Commit ccd38024bc, which introduced the pg_signal_autovacuum_worker  
role, added a call to pgstat_get_beentry_by_proc_number() for the  
purpose of determining whether the process is an autovacuum worker.  
This function calls pgstat_read_current_status(), which can be  
fairly expensive and may return cached, out-of-date information.  
Since we just need to look up the target backend's BackendType, and  
we already know its ProcNumber, we can instead inspect the  
BackendStatusArray directly, which is much less expensive and  
possibly more up-to-date.  There are some caveats with this  
approach (which are documented in the code), but it's still  
substantially better than before.  
  
Reported-by: Andres Freund  
Reviewed-by: Andres Freund  
Discussion: https://postgr.es/m/ujenaa2uabzfkwxwmfifawzdozh3ljr7geozlhftsuosgm7n7q%40g3utqqyyosb6  

M src/backend/storage/ipc/signalfuncs.c
M src/backend/utils/activity/backend_status.c
M src/include/utils/backend_status.h

postmaster: Reduce verbosity of environment dump debug message

commit   : 6a5bcf7f7dd1e3c1c669912d82591397dbe24a10    
  
author   : Andres Freund <[email protected]>    
date     : Wed, 27 Nov 2024 11:17:23 -0500    
  
committer: Andres Freund <[email protected]>    
date     : Wed, 27 Nov 2024 11:17:23 -0500    

Click here for diff

Emitting each variable separately is unnecessarily verbose / hard to skim  
over. Emit the whole thing in one ereport() to address that.  
  
Also remove program name and function reference from the message. The former  
doesn't seem particularly helpful and the latter is provided by the elog.c  
infrastructure these days.  
  
Reviewed-by: Heikki Linnakangas <[email protected]>  
Reviewed-by: Peter Eisentraut <[email protected]>  
Discussion: https://postgr.es/m/leouteo5ozcrux3fepuhtbp6c56tbfd4naxeokidbx7m75cabz@hhw6g4urlowt  

M src/backend/postmaster/postmaster.c

file_fdw: Add regression tests for ON_ERROR and other options.

commit   : 631db1d4b251a500e22743fc3eec9fb8724baf67    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 27 Nov 2024 23:40:11 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 27 Nov 2024 23:40:11 +0900    

Click here for diff

This commit introduces regression tests to validate incorrect settings  
for the ON_ERROR, LOG_VERBOSITY, and REJECT_LIMIT options in file_fdw.  
  
Author: Atsushi Torikoshi  
Reviewed-by: Fujii Masao  
Suggested-by: Yugo Nagata  
Discussion: https://postgr.es/m/[email protected]  

M contrib/file_fdw/expected/file_fdw.out
M contrib/file_fdw/sql/file_fdw.sql

pgbench: Ensure previous progress message is fully cleared when updating.

commit   : af35fe501af52f90355ac184a17643932a26464f    
  
author   : Fujii Masao <[email protected]>    
date     : Wed, 27 Nov 2024 23:01:53 +0900    
  
committer: Fujii Masao <[email protected]>    
date     : Wed, 27 Nov 2024 23:01:53 +0900    

Click here for diff

During pgbench's table initialization, progress updates could display  
leftover characters from the previous message if the new message  
was shorter. This commit resolves the issue by appending spaces to  
the current message to fully overwrite any remaining characters from  
the previous line.  
  
Back-patch to all the supported versions.  
  
Author: Yushi Ogiwara, Tatsuo Ishii, Fujii Masao  
Reviewed-by: Tatsuo Ishii, Fujii Masao  
Discussion: https://postgr.es/m/[email protected]  

M src/bin/pgbench/pgbench.c

Fix pg_get_constraintdef for NOT NULL constraints on domains

commit   : 09d09d4297b9acbc2848ec35e8bf030d6c1fae18    
  
author   : Álvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2024 13:50:27 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Wed, 27 Nov 2024 13:50:27 +0100    

Click here for diff

We added pg_constraint rows for all not-null constraints, first for  
tables and later for domains; but while the ones for tables were  
reverted, the ones for domains were not.  However, we did accidentally  
revert ruleutils.c support for the ones on domains in 6f8bb7c1e961,  
which breaks running pg_get_constraintdef() on them.  Put that back.  
  
This is only needed in branch 17, because we've reinstated this code in  
branch master with commit 14e87ffa5c54.  Add some new tests in both  
branches.  
  
I couldn't find anything else that needs de-reverting.  
  
Reported-by: Erki Eessaar <[email protected]>  
Reviewed-by: Magnus Hagander <[email protected]>  
Discussion: https://postgr.es/m/AS8PR01MB75110350415AAB8BBABBA1ECFE222@AS8PR01MB7511.eurprd01.prod.exchangelabs.com  

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

gitattributes: Add .cpp files to whitespace checks

commit   : 0d884f570b72c5b030f7908032946078537ea121    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2024 11:15:53 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2024 11:15:53 +0100    

Click here for diff

Use the same rules as .c files.  

M .gitattributes

Fix typo

commit   : 41272784b9383910de737937f1987dd00246f728    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2024 11:12:09 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2024 11:12:09 +0100    

Click here for diff

from commit 9044fc1d45a  

M src/tools/pgindent/exclude_file_patterns

Exclude LLVM files from whitespace checks

commit   : 96447e9c817143071826c9a5b129f61d17c4ae2e    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2024 11:08:12 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2024 11:08:12 +0100    

Click here for diff

Commit 9044fc1d45a added some files from upstream LLVM.  These files  
have different whitespace rules, which make the git whitespace checks  
powered by gitattributes fail.  To fix, add those files to the exclude  
list.  

M .gitattributes

Revert "Blind attempt to fix _configthreadlocale() failures on MinGW."

commit   : a62d90f2e5cb55d0c8998b63120d6db3c55df866    
  
author   : Thomas Munro <[email protected]>    
date     : Wed, 27 Nov 2024 22:56:41 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Wed, 27 Nov 2024 22:56:41 +1300    

Click here for diff

This reverts commit 2cf91ccb73ce888c44e3751548fb7c77e87335f2.  
  
When using the old msvcrt.dll, MinGW would supply its own dummy version  
of _configthreadlocale() that just returns -1 if you try to use it.  For  
a time we tolerated that to shut the build farm up.  We would fall back  
to code that was enough for the tests to pass, but it would surely have  
risked crashing a real multithreaded program.  
  
We don't need that kludge anymore, because we can count on ucrt.  We  
expect the real _configthreadlocale() to be present, and the ECPG tests  
will now fail if it isn't.  The workaround was dead code and it's time  
to revert it.  
  
(A later patch still under review proposes to remove this use of  
_configthreadlocale() completely but we're unwinding this code in  
steps.)  
  
Reviewed-by: Peter Eisentraut <[email protected]>  
Discussion: https://postgr.es/m/d9e7731c-ca1b-477c-9298-fa51e135574a%40eisentraut.org  

M src/interfaces/ecpg/ecpglib/descriptor.c
M src/interfaces/ecpg/ecpglib/execute.c

Require ucrt if using MinGW.

commit   : 1758d42446161f5dfae9b14791c5640239b86faa    
  
author   : Thomas Munro <[email protected]>    
date     : Wed, 27 Nov 2024 22:34:11 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Wed, 27 Nov 2024 22:34:11 +1300    

Click here for diff

Historically we tolerated the absence of various C runtime library  
features for the benefit of the MinGW tool chain, because it used  
ancient msvcrt.dll for a long period of time.  It now uses ucrt by  
default (like Windows 10+, Visual Studio 2015+), and that's the only  
configuration we're testing.  
  
In practice, we effectively required ucrt already in PostgreSQL 17, when  
commit 8d9a9f03 required _create_locale etc, first available in  
msvcr120.dll (Visual Studio 2013, the last of the pre-ucrt series of  
runtimes), and for MinGW users that practically meant ucrt because it  
was difficult or impossible to use msvcr120.dll.  That may even not have  
been the first such case, but old MinGW configurations had already  
dropped off our testing radar so we weren't paying much attention.  
  
This commit formalizes the requirement.  It also removes a couple of  
obsolete comments that discussed msvcrt.dll limitations, and some tests  
of !defined(_MSC_VER) to imply msvcrt.dll.  There are many more  
anachronisms, but it'll take some time to figure out how to remove them  
all.  APIs affected relate to locales, UTF-8, threads, large files and  
more.  
  
Thanks to Peter Eisentraut for the documentation change.  It's not  
really necessary to talk about ucrt explicitly in such a short section,  
since it's the default for MinGW-w64 and MSYS2.  It's enough to prune  
references and broken links to much older tools.  
  
Reviewed-by: Peter Eisentraut <[email protected]>  
Discussion: https://postgr.es/m/d9e7731c-ca1b-477c-9298-fa51e135574a%40eisentraut.org  

M doc/src/sgml/installation.sgml
M src/backend/utils/adt/pg_locale.c

Remove configure check for _configthreadlocale().

commit   : f1da075d9a0373c08af32e31dcbf0809ae4aec2f    
  
author   : Thomas Munro <[email protected]>    
date     : Wed, 27 Nov 2024 22:34:03 +1300    
  
committer: Thomas Munro <[email protected]>    
date     : Wed, 27 Nov 2024 22:34:03 +1300    

Click here for diff

All modern Windows systems have _configthreadlocale().  It was first  
introduced in msvcr80.dll from Visual Studio 2005.  Historically, MinGW  
was stuck on even older msvcrt.dll, but added its own dummy  
implementation of the function when using msvcrt.dll years ago anyway,  
effectively rendering the configure test useless.  In practice we don't  
encounter the dummy anymore because modern MinGW uses ucrt.  
  
Reviewed-by: Peter Eisentraut <[email protected]>  
Discussion: https://postgr.es/m/CWZBBRR6YA8D.8EHMDRGLCKCD%40neon.tech  

M configure
M configure.ac
M meson.build
M src/include/pg_config.h.in
M src/interfaces/ecpg/ecpglib/descriptor.c
M src/interfaces/ecpg/ecpglib/ecpglib_extern.h
M src/interfaces/ecpg/ecpglib/execute.c

Improve slightly misleading internal error message

commit   : 63e10988f8705cc56ac242fa21ec42dd87e99cbf    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2024 10:55:35 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2024 10:55:35 +0100    

Click here for diff

The error message was talking about RowCompareType but was actually  
checking strategy numbers.  While those are closely related, it is  
better to be accurate.  
  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

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

Fix buildfarm failure from commit 8fcd80258b.

commit   : 9d7aa406d04ce51da38eb5b6402079f60a601aec    
  
author   : Amit Kapila <[email protected]>    
date     : Wed, 27 Nov 2024 14:54:26 +0530    
  
committer: Amit Kapila <[email protected]>    
date     : Wed, 27 Nov 2024 14:54:26 +0530    

Click here for diff

The test case was incorrectly matching the error code.  
  
Author: Vignesh C  
Discussion: https://postgr.es/m/CALDaNm0C5LPiTxkdqsxiyeaL=nuUP8t6ne81sp9jE0=MFz=-ew@mail.gmail.com  

M src/test/subscription/t/011_generated.pl

Support LIKE with nondeterministic collations

commit   : 85b7efa1cdd63c2fe2b70b725b8285743ee5787f    
  
author   : Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2024 08:18:35 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Wed, 27 Nov 2024 08:18:35 +0100    

Click here for diff

This allows for example using LIKE with case-insensitive collations.  
There was previously no internal implementation of this, so it was met  
with a not-supported error.  This adds the internal implementation and  
removes the error.  The implementation follows the specification of  
the SQL standard for this.  
  
Unlike with deterministic collations, the LIKE matching cannot go  
character by character but has to go substring by substring.  For  
example, if we are matching against LIKE 'foo%bar', we can't start by  
looking for an 'f', then an 'o', but instead with have to find  
something that matches 'foo'.  This is because the collation could  
consider substrings of different lengths to be equal.  This is all  
internal to MatchText() in like_match.c.  
  
The changes in GenericMatchText() in like.c just pass through the  
locale information to MatchText(), which was previously not needed.  
This matches exactly Generic_Text_IC_like() below.  
  
ILIKE is not affected.  (It's unclear whether ILIKE makes sense under  
nondeterministic collations.)  
  
This also updates match_pattern_prefix() in like_support.c to support  
optimizing the case of an exact pattern with nondeterministic  
collations.  This was already alluded to in the previous code.  
  
(includes documentation examples from Daniel Vérité and test cases  
from Paul A Jungwirth)  
  
Reviewed-by: Jian He <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/[email protected]  

M doc/src/sgml/charset.sgml
M doc/src/sgml/func.sgml
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/test/regress/expected/collate.icu.utf8.out
M src/test/regress/sql/collate.icu.utf8.sql

Improve error message for replication of generated columns.

commit   : 8fcd80258bcf43dab93d877a5de0ce3f4d2bd471    
  
author   : Amit Kapila <[email protected]>    
date     : Wed, 27 Nov 2024 09:09:20 +0530    
  
committer: Amit Kapila <[email protected]>    
date     : Wed, 27 Nov 2024 09:09:20 +0530    

Click here for diff

Currently, logical replication produces a generic error message when  
targeting a subscriber-side table column that is either missing or  
generated. The error message can be misleading for generated columns.  
  
This patch introduces a specific error message to clarify the issue when  
generated columns are involved.  
  
Author: Shubham Khanna  
Reviewed-by: Peter Smith, Vignesh C, Amit Kapila  
Discussion: https://postgr.es/m/CAHv8RjJBvYtqU7OAofBizOmQOK2Q8h+w9v2_cQWxT_gO7er3Aw@mail.gmail.com  

M src/backend/replication/logical/relation.c
M src/test/subscription/t/011_generated.pl

Handle better implicit transaction state of pipeline mode

commit   : d0eb4297cc5bbfb02b64fdaaf5510415e92e5312    
  
author   : Michael Paquier <[email protected]>    
date     : Wed, 27 Nov 2024 09:31:22 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Wed, 27 Nov 2024 09:31:22 +0900    

Click here for diff

When using a pipeline, a transaction starts from the first command and  
is committed with a Sync message or when the pipeline ends.  
  
Functions like IsInTransactionBlock() or PreventInTransactionBlock()  
were already able to understand a pipeline as being in a transaction  
block, but it was not the case of CheckTransactionBlock().  This  
function is called for example to generate a WARNING for SET LOCAL,  
complaining that it is used outside of a transaction block.  
  
The current state of the code caused multiple problems, like:  
- SET LOCAL executed at any stage of a pipeline issued a WARNING, even  
if the command was at least second in line where the pipeline is in a  
transaction state.  
- LOCK TABLE failed when invoked at any step of a pipeline, even if it  
should be able to work within a transaction block.  
  
The pipeline protocol assumes that the first command of a pipeline is  
not part of a transaction block, and that any follow-up commands is  
considered as within a transaction block.  
  
This commit changes the backend so as an implicit transaction block is  
started each time the first Execute message of a pipeline has finished  
processing, with this implicit transaction block ended once a sync is  
processed.  The checks based on XACT_FLAGS_PIPELINING in the routines  
checking if we are in a transaction block are not necessary: it is  
enough to rely on the existing ones.  
  
Some tests are added to pgbench, that can be backpatched down to v17  
when \syncpipeline is involved and down to v14 where \startpipeline and  
\endpipeline are available.  This is unfortunately limited regarding the  
error patterns that can be checked, but it provides coverage for various  
pipeline combinations to check if these succeed or fail.  These tests  
are able to capture the case of SET LOCAL's WARNING.  The author has  
proposed a different feature to improve the coverage by adding similar  
meta-commands to psql where error messages could be checked, something  
more useful for the cases where commands cannot be used in transaction  
blocks, like REINDEX CONCURRENTLY or VACUUM.  This is considered as  
future work for v18~.  
  
Author: Anthonin Bonnefoy  
Reviewed-by: Jelte Fennema-Nio, Michael Paquier  
Discussion: https://postgr.es/m/CAO6_XqrWO8uNBQrSu5r6jh+vTGi5Oiyk4y8yXDORdE2jbzw8xw@mail.gmail.com  
Backpatch-through: 13  

M doc/src/sgml/protocol.sgml
M src/backend/access/transam/xact.c
M src/backend/tcop/postgres.c
M src/bin/pgbench/t/001_pgbench_with_server.pl

Fix commit 641a5b7a144 for "nbsp" output in SVG files

commit   : 6e80951f49f3bc18b5bdfb7e87bc2e0bcfb4af00    
  
author   : Bruce Momjian <[email protected]>    
date     : Tue, 26 Nov 2024 13:07:53 -0500    
  
committer: Bruce Momjian <[email protected]>    
date     : Tue, 26 Nov 2024 13:07:53 -0500    

Click here for diff

In commit 641a5b7a144, I removed "nbsp" characters from SVG files, not  
realizing the SVG files were generated from GV files and that the "nbsp"  
characters were caused by trailing ASCII spaces in GV files.  This  
commit restores the "nbsp" SVG characters and adds a GV comment about  
how the trailing spaces cause the "nbsp" output.  
  
Reported-by: Peter Eisentraut  
  
Discussion: https://postgr.es/m/2c5dd601-b245-4092-9c27-6d1ad51609df%40eisentraut.org  
  
Backpatch-through: master  

M doc/src/sgml/images/genetic-algorithm.gv
M doc/src/sgml/images/genetic-algorithm.svg

Distinguish between AcquireExternalFD and epoll_create1 / kqueue failing

commit   : b8f9afc81f26ead612fcfe76301c01d110e36c7e    
  
author   : Andres Freund <[email protected]>    
date     : Tue, 26 Nov 2024 12:20:59 -0500    
  
committer: Andres Freund <[email protected]>    
date     : Tue, 26 Nov 2024 12:20:59 -0500    

Click here for diff

The error messages in CreateWaitEventSet() made it hard to know whether the  
syscall or AcquireExternalFD() failed. This is particularly relevant because  
AcquireExternalFD() imposes a lower limit than what would cause syscalls fail  
with EMFILE.  
  
I did not change the message in libpqsrv_connect_prepare(), which is the one  
other use of AcquireExternalFD() in our codebase, as the error message already  
is less ambiguous.  
  
Reviewed-by: Tom Lane <[email protected]>  
Discussion: https://postgr.es/m/xjjx7r4xa7beixuu4qtkdhnwdbchrrpo3gaeb3jsbinvvdiat5@cwjw55mna5of  

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

meson: Build pgevent as shared_module rather than shared_library

commit   : 4ee130c6e03becefae94e66bf537cd1279823c68    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 26 Nov 2024 18:06:08 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 26 Nov 2024 18:06:08 +0100    

Click here for diff

This matches the behavior of the makefiles and the old MSVC build  
system.  The main effect is that the build result gets installed into  
pkglibdir rather than bindir.  The documentation says to locate the  
library in pkglibdir, so this makes the code match the documentation  
again.  
  
Reviewed-by: Ryohei Takahashi (Fujitsu) <[email protected]>  
Discussion: https://www.postgresql.org/message-id/flat/TY3PR01MB118912125614599641CA881B782522%40TY3PR01MB11891.jpnprd01.prod.outlook.com  

M src/bin/pgevent/meson.build

Clean up newlines following left parentheses

commit   : e6c32d9fad18f5a1dcb13c13f02445061b60523b    
  
author   : Álvaro Herrera <[email protected]>    
date     : Tue, 26 Nov 2024 17:10:07 +0100    
  
committer: Álvaro Herrera <[email protected]>    
date     : Tue, 26 Nov 2024 17:10:07 +0100    

Click here for diff

Most came in during the 17 cycle, so backpatch there.  Some  
(particularly reorderbuffer.h) are very old, but backpatching doesn't  
seem useful.  
  
Like commits c9d297751959, c4f113e8fef9.  

M contrib/bloom/bloom.h
M src/backend/backup/basebackup_incremental.c
M src/backend/utils/adt/pg_locale.c
M src/backend/utils/cache/relcache.c
M src/bin/pg_combinebackup/load_manifest.c
M src/common/parse_manifest.c
M src/common/unicode/category_test.c
M src/include/common/parse_manifest.h
M src/include/replication/reorderbuffer.h

Improve InitShmemAccess() prototype

commit   : 2a7b2d97171dd39dca7cefb91008a3c84ec003ba    
  
author   : Peter Eisentraut <[email protected]>    
date     : Tue, 26 Nov 2024 08:25:23 +0100    
  
committer: Peter Eisentraut <[email protected]>    
date     : Tue, 26 Nov 2024 08:25:23 +0100    

Click here for diff

The code comment said, 'the argument should be declared "PGShmemHeader  
*seghdr", but we use void to avoid having to include ipc.h in  
shmem.h.'  We can achieve the original goal with a struct forward  
declaration.  (ipc.h was also not the correct header file.)  
  
Discussion: https://www.postgresql.org/message-id/flat/cnthxg2eekacrejyeonuhiaezc7vd7o2uowlsbenxqfkjwgvwj@qgzu6eoqrglb  

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

Fix test case from a8ccf4e93

commit   : e15e56713702c45402d2728f3d7d68df96b2fbbe    
  
author   : Richard Guo <[email protected]>    
date     : Tue, 26 Nov 2024 11:12:57 +0900    
  
committer: Richard Guo <[email protected]>    
date     : Tue, 26 Nov 2024 11:12:57 +0900    

Click here for diff

Commit a8ccf4e93 uses the same table name "distinct_tbl" in both  
select_distinct.sql and select_distinct_on.sql, which could cause  
conflicts when these two test scripts are run in parallel.  
  
Fix by renaming the table in select_distinct_on.sql to  
"distinct_on_tbl".  
  
Per buildfarm (via Tom Lane)  
  
Discussion: https://postgr.es/m/[email protected]  

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

pg_amcheck: Use CppAsString2() for relkind and relpersistence in queries

commit   : 91f5a4a000ea4979e5490e0a111c24f4486d7361    
  
author   : Michael Paquier <[email protected]>    
date     : Tue, 26 Nov 2024 09:45:34 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Tue, 26 Nov 2024 09:45:34 +0900    

Click here for diff

This utility has been using hardcoded values for relkind and  
relpersistence in its queries generated.  These queries are switched to  
use CppAsString2() instead, with the values fetched directly from the  
header of pg_class.  This has the advantage of making the code more  
self-documented, as it becomes unnecessary to look at a header for the  
meaning of a value.