pgsql: Teach autoprewarm to use the dynamic shared memory registry.

2024-01-19 Thread Nathan Bossart
Teach autoprewarm to use the dynamic shared memory registry. Besides showcasing the DSM registry, this prevents pg_prewarm from stealing from the main shared memory segment's extra buffer space when autoprewarm_start_worker() and autoprewarm_dump_now() are used without loading the module via

pgsql: Introduce the dynamic shared memory registry.

2024-01-19 Thread Nathan Bossart
Introduce the dynamic shared memory registry. Presently, the most straightforward way for a shared library to use shared memory is to request it at server startup via a shmem_request_hook, which requires specifying the library in shared_preload_libraries. Alternatively, the library can create a

pgsql: doc: Reorganize section for shared memory and LWLocks.

2024-01-19 Thread Nathan Bossart
doc: Reorganize section for shared memory and LWLocks. Presently, this section meanders through a few different features, and the text itself is terse. This commit attempts to improve matters by splitting the section into smaller sections and by expanding the text for clarity. This is

Re: pgsql: Reorder actions in ProcArrayApplyRecoveryInfo()

2024-01-19 Thread Alexander Korotkov
On Fri, Jan 19, 2024 at 6:08 PM Tom Lane wrote: > > Alexander Korotkov writes: > > Reorder actions in ProcArrayApplyRecoveryInfo() > > I'm seeing this warning since this commit: > > procarray.c: In function 'ProcArrayApplyRecoveryInfo': > procarray.c:1172:17: warning: declaration of 'xid'

pgsql: Fix name collision in c64086b79dba

2024-01-19 Thread Alexander Korotkov
Fix name collision in c64086b79dba Reported-by: Erik Rijkers, Tom Lane Discussion: https://postgr.es/m/E1rQqeS-002A0s-Qm%40gemulon.postgresql.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/448a3331d9ab3094183cea59f601b6f2f7f7c48a Modified Files --

Re: pgsql: Reorder actions in ProcArrayApplyRecoveryInfo()

2024-01-19 Thread Tom Lane
Alexander Korotkov writes: > Reorder actions in ProcArrayApplyRecoveryInfo() I'm seeing this warning since this commit: procarray.c: In function 'ProcArrayApplyRecoveryInfo': procarray.c:1172:17: warning: declaration of 'xid' shadows a previous local [-Wshadow=compatible-local]

pgsql: doc: Update compiler for FreeBSD specific instructions

2024-01-19 Thread Daniel Gustafsson
doc: Update compiler for FreeBSD specific instructions FreeBSD has since v13 switched to Clang from GCC, so update our instructions to cc instead of gcc to reflect that. Reported-by: digitald...@gmail.com Discussion:

pgsql: Reorder actions in ProcArrayApplyRecoveryInfo()

2024-01-19 Thread Alexander Korotkov
Reorder actions in ProcArrayApplyRecoveryInfo() Since 5a1dfde8334b, 2PC filenames use FullTransactionId. Thus, it needs to convert TransactionId to FullTransactionId in StandbyTransactionIdIsPrepared() using TransamVariables->nextXid. However, ProcArrayApplyRecoveryInfo() first releases locks

pgsql: Add stratnum GiST support function

2024-01-19 Thread Peter Eisentraut
Add stratnum GiST support function This is support function 12 for the GiST AM and translates "well-known" RT*StrategyNumber values into whatever strategy number is used by the opclass (since no particular numbers are actually required). We will use this to support temporal PRIMARY

pgsql: Rename COPY option from SAVE_ERROR_TO to ON_ERROR

2024-01-19 Thread Alexander Korotkov
Rename COPY option from SAVE_ERROR_TO to ON_ERROR The option names now are "stop" (default) and "ignore". The future options could be "file 'filename.log'" and "table 'tablename'". Discussion: https://postgr.es/m/20240117.164859.2242646601795501168.horikyota.ntt%40gmail.com Author: Jian He