pgsql: Eliminate XLOG_HEAP2_VISIBLE from vacuum phase III

2025-10-13 Thread Melanie Plageman
Eliminate XLOG_HEAP2_VISIBLE from vacuum phase III Instead of emitting a separate XLOG_HEAP2_VISIBLE WAL record for each page that becomes all-visible in vacuum's third phase, specify the VM changes in the already emitted XLOG_HEAP2_PRUNE_VACUUM_CLEANUP record. Visibility checks are now performed

pgsql: Fix incorrect message-printing in win32security.c.

2025-10-13 Thread Tom Lane
Fix incorrect message-printing in win32security.c. log_error() would probably fail completely if used, and would certainly print garbage for anything that needed to be interpolated into the message, because it was failing to use the correct printing subroutine for a va_list argument. This bug lik

pgsql: Fix incorrect message-printing in win32security.c.

2025-10-13 Thread Tom Lane
Fix incorrect message-printing in win32security.c. log_error() would probably fail completely if used, and would certainly print garbage for anything that needed to be interpolated into the message, because it was failing to use the correct printing subroutine for a va_list argument. This bug lik

pgsql: Remove extra semicolon in example

2025-10-13 Thread Magnus Hagander
Remove extra semicolon in example Reported-By: Pavel Luzanov Discussion: https://postgr.es/m/[email protected] Backpatch-through: 18 Branch -- REL_18_STABLE Details --- https://git.postgresql.org/pg/commitdiff/656736402f54f840a90acfae7db826c53

pgsql: Remove extra semicolon in example

2025-10-13 Thread Magnus Hagander
Remove extra semicolon in example Reported-By: Pavel Luzanov Discussion: https://postgr.es/m/[email protected] Backpatch-through: 18 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e062af861b453769ccf3940fe7920a87d7d31fe6

pgsql: Remove state.tmp when failing to save a replication slot

2025-10-13 Thread Michael Paquier
Remove state.tmp when failing to save a replication slot An error happening while a slot data is saved on disk in SaveSlotToPath() could cause a state.tmp file (temporary file holding the slot state data, renamed to its permanent name at the end of the function) to remain around after it has been

pgsql: Fix serious performance problems in LZ4Stream_read_internal.

2025-10-13 Thread Tom Lane
Fix serious performance problems in LZ4Stream_read_internal. I was distressed to find that reading an LZ4-compressed toc.dat file was hundreds of times slower than it ought to be. On investigation, the blame mostly affixes to LZ4Stream_read_overflow's habit of memmove'ing all the remaining buffer

pgsql: Fix version number calculation for data folder flush in pg_combi

2025-10-13 Thread Michael Paquier
Fix version number calculation for data folder flush in pg_combinebackup The version number calculated by read_pg_version_file() is multiplied once by 1, to be able to do comparisons based on PG_VERSION_NUM or equivalents with a minor version included. However, the version number given sync_p

pgsql: Fix incorrect message-printing in win32security.c.

2025-10-13 Thread Tom Lane
Fix incorrect message-printing in win32security.c. log_error() would probably fail completely if used, and would certainly print garbage for anything that needed to be interpolated into the message, because it was failing to use the correct printing subroutine for a va_list argument. This bug lik

pgsql: Doc: clarify n_distinct_inherited setting

2025-10-13 Thread David Rowley
Doc: clarify n_distinct_inherited setting There was some confusion around how to adjust the n_distinct estimates for partitioned tables. Here we try and clarify that n_distinct_inherited needs to be adjusted rather than n_distinct. Also fix some slightly misleading text which was talking about t

pgsql: Fix issue with reading zero bytes in Gzip_read.

2025-10-13 Thread Tom Lane
Fix issue with reading zero bytes in Gzip_read. pg_dump expects a read request of zero bytes to be a no-op; see for example ReadStr(). Gzip_read got this wrong and falsely supposed that the resulting gzret == 0 indicated an error. We could complicate that error-checking logic some more, but it s

pgsql: Fix poor buffering logic in pg_dump's lz4 and zstd compression c

2025-10-13 Thread Tom Lane
Fix poor buffering logic in pg_dump's lz4 and zstd compression code. Both of these modules dumped each bit of output that they got from the underlying compression library as a separate "data block" in the emitted archive file. In the case of zstd this'd frequently result in block sizes well under

pgsql: Doc: clarify n_distinct_inherited setting

2025-10-13 Thread David Rowley
Doc: clarify n_distinct_inherited setting There was some confusion around how to adjust the n_distinct estimates for partitioned tables. Here we try and clarify that n_distinct_inherited needs to be adjusted rather than n_distinct. Also fix some slightly misleading text which was talking about t