pgsql: Adjust tuplestore.c not to allocate BufFiles in generation conte

2024-07-05 Thread David Rowley
Adjust tuplestore.c not to allocate BufFiles in generation context 590b045c3 made it so tuplestore.c would store tuples inside a generation.c memory context. After fixing a bug report in 97651b013, it seems that it's probably best not to allocate BufFile related allocations in that context. Let'

pgsql: Fix incorrect sentinel byte logic in GenerationRealloc()

2024-07-05 Thread David Rowley
Fix incorrect sentinel byte logic in GenerationRealloc() This only affects MEMORY_CONTEXT_CHECKING builds. This fixes an off-by-one issue in GenerationRealloc() where the fast-path code which tries to reuse the existing allocation if the existing chunk is >= the new requested size. The code ther

pgsql: Fix incorrect sentinel byte logic in GenerationRealloc()

2024-07-05 Thread David Rowley
Fix incorrect sentinel byte logic in GenerationRealloc() This only affects MEMORY_CONTEXT_CHECKING builds. This fixes an off-by-one issue in GenerationRealloc() where the fast-path code which tries to reuse the existing allocation if the existing chunk is >= the new requested size. The code ther

pgsql: Fix incorrect sentinel byte logic in GenerationRealloc()

2024-07-05 Thread David Rowley
Fix incorrect sentinel byte logic in GenerationRealloc() This only affects MEMORY_CONTEXT_CHECKING builds. This fixes an off-by-one issue in GenerationRealloc() where the fast-path code which tries to reuse the existing allocation if the existing chunk is >= the new requested size. The code ther

pgsql: Cope with name clashes.

2024-07-05 Thread Thomas Munro
Cope with name clashes. macOS 15's SDK pulls in headers related to when we include . This causes our own regex_t implementation to clash with the OS's regex_t implementation. Luckily our function names already had pg_ prefixes, but the macros and typenames did not. Include explicitly on all

pgsql: Cope with name clashes.

2024-07-05 Thread Thomas Munro
Cope with name clashes. macOS 15's SDK pulls in headers related to when we include . This causes our own regex_t implementation to clash with the OS's regex_t implementation. Luckily our function names already had pg_ prefixes, but the macros and typenames did not. Include explicitly on all

pgsql: Cope with name clashes.

2024-07-05 Thread Thomas Munro
Cope with name clashes. macOS 15's SDK pulls in headers related to when we include . This causes our own regex_t implementation to clash with the OS's regex_t implementation. Luckily our function names already had pg_ prefixes, but the macros and typenames did not. Include explicitly on all

pgsql: Cope with name clashes.

2024-07-05 Thread Thomas Munro
Cope with name clashes. macOS 15's SDK pulls in headers related to when we include . This causes our own regex_t implementation to clash with the OS's regex_t implementation. Luckily our function names already had pg_ prefixes, but the macros and typenames did not. Include explicitly on all

pgsql: Cope with name clashes.

2024-07-05 Thread Thomas Munro
Cope with name clashes. macOS 15's SDK pulls in headers related to when we include . This causes our own regex_t implementation to clash with the OS's regex_t implementation. Luckily our function names already had pg_ prefixes, but the macros and typenames did not. Include explicitly on all

pgsql: Cope with name clashes.

2024-07-05 Thread Thomas Munro
Cope with name clashes. macOS 15's SDK pulls in headers related to when we include . This causes our own regex_t implementation to clash with the OS's regex_t implementation. Luckily our function names already had pg_ prefixes, but the macros and typenames did not. Include explicitly on all

pgsql: Cope with name clashes.

2024-07-05 Thread Thomas Munro
Cope with name clashes. macOS 15's SDK pulls in headers related to when we include . This causes our own regex_t implementation to clash with the OS's regex_t implementation. Luckily our function names already had pg_ prefixes, but the macros and typenames did not. Include explicitly on all

pgsql: Fix placement of "static".

2024-07-05 Thread Tom Lane
Fix placement of "static". Various buildfarm critters were complaining about pgbench.c:304:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration] Evidently a thinko in 720b0eaae. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8212625e5

pgsql: doc PG 17 relnotes: fix psql connection cancelation item

2024-07-05 Thread Bruce Momjian
doc PG 17 relnotes: fix psql connection cancelation item Reported-by: Matthias van de Meent Discussion: https://postgr.es/m/CAEze2WiprrENrFQqeXij2XyLAdoZaFTFLGC8sE=v8c1yrwn...@mail.gmail.com Backpatch-through: 17 only Branch -- REL_17_STABLE Details --- https://git.postgresql.org/pg/

pgsql: Remove check hooks for GUCs that contribute to MaxBackends.

2024-07-05 Thread Nathan Bossart
Remove check hooks for GUCs that contribute to MaxBackends. Each of max_connections, max_worker_processes, autovacuum_max_workers, and max_wal_senders has a GUC check hook that verifies the sum of those GUCs does not exceed a hard-coded limit (see the comment for MAX_BACKENDS in postmaster.h). In

pgsql: Improve PL/Tcl's method for choosing Tcl names of procedures.

2024-07-05 Thread Tom Lane
Improve PL/Tcl's method for choosing Tcl names of procedures. Previously, the internal name of a PL/Tcl function was just "__PLTcl_proc_", where is the function OID. That's pretty unhelpful when reading an error report. Plus it prevents us from testing the CONTEXT output for PL/Tcl erro

pgsql: Doc: minor improvements for our "Brief History" chapter.

2024-07-05 Thread Tom Lane
Doc: minor improvements for our "Brief History" chapter. Add a link to Joe Hellerstein's paper "Looking Back at Postgres", which is quite an interesting take on the history of Postgres. The reference to Appendix E was written when we were still keeping the entire release-note history there, which

pgsql: Support loading of injection points

2024-07-05 Thread Michael Paquier
Support loading of injection points This can be used to load an injection point and prewarm the backend-level cache before running it, to avoid issues if the point cannot be loaded due to restrictions in the code path where it would be run, like a critical section where no memory allocation can ha

pgsql: Lift limitation that PGPROC->links must be the first field

2024-07-05 Thread Heikki Linnakangas
Lift limitation that PGPROC->links must be the first field Since commit 5764f611e1, we've been using the ilist.h functions for handling the linked list. There's no need for 'links' to be the first element of the struct anymore, except for one call in InitProcess where we used a straight cast from