pgsql: Use "COPY table TO" for partitioned tables in initial table sync

2025-11-20 Thread Masahiko Sawada
Use "COPY table TO" for partitioned tables in initial table synchronization. Commit 4bea91f added support for "COPY table TO" with partitioned tables. This commit enhances initial table synchronization in logical replication to use "COPY table TO" for partitioned tables if possible, instead of "CO

pgsql: Split PruneFreezeParams initializers to one field per line

2025-11-20 Thread Melanie Plageman
Split PruneFreezeParams initializers to one field per line This conforms more closely with the style of other struct initializers in the code base. Initializing multiple fields on a single line is unpopular in part because pgindent won't permit a space after the comma before the next field's perio

pgsql: tools: update tools/codelines to use "git ls-files"

2025-11-20 Thread Bruce Momjian
tools: update tools/codelines to use "git ls-files" This generates a more accurate code count because 'make distclean' doesn't always remove build files. Author: idea from David Rowley Discussion: https://postgr.es/m/[email protected] Backpatch-through: master Branch -- master

pgsql: Update PruneState.all_[visible|frozen] earlier in pruning

2025-11-20 Thread Melanie Plageman
Update PruneState.all_[visible|frozen] earlier in pruning During pruning and freezing in phase I of vacuum, we delay clearing all_visible and all_frozen in the presence of dead items. This allows opportunistic freezing if the page would otherwise be fully frozen, since those dead items are later r

pgsql: Keep all_frozen updated in heap_page_prune_and_freeze

2025-11-20 Thread Melanie Plageman
Keep all_frozen updated in heap_page_prune_and_freeze Previously, we relied on all_visible and all_frozen being used together to ensure that all_frozen was correct, but it is better to keep both fields updated. Future changes will separate their usage, so we should not depend on all_visible for t

pgsql: Refactor heap_page_prune_and_freeze() parameters into a struct

2025-11-20 Thread Melanie Plageman
Refactor heap_page_prune_and_freeze() parameters into a struct heap_page_prune_and_freeze() had accumulated an unwieldy number of input parameters and upcoming work to handle VM updates in this function will add even more. Introduce a new PruneFreezeParams struct to group the function’s input par

pgsql: doc: Assorted documentation improvements

2025-11-20 Thread Daniel Gustafsson
doc: Assorted documentation improvements A set of wording improvements and spelling fixes. Author: Oleg Sibiryakov Reviewed-by: Daniel Gustafsson Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/[email protected] Branch -- master Details --

pgsql: doc: Document how to run a subset of regress tests

2025-11-20 Thread Daniel Gustafsson
doc: Document how to run a subset of regress tests This patch was originally submitted a year ago, but never ended up getting committed. It was later brought up again on a recent thread on the same subject. Original patch by Paul A Jungwirth with some wordsmithing by me based on the review from t

pgsql: Handle EPERM in pg_numa_init

2025-11-20 Thread Tomas Vondra
Handle EPERM in pg_numa_init When running in Docker, the container may not have privileges needed by get_mempolicy(). This is called by numa_available() in libnuma, but versions prior to 2.0.19 did not expect that. The numa_available() call seemingly succeeds, but then we get unexpected failures w

pgsql: Handle EPERM in pg_numa_init

2025-11-20 Thread Tomas Vondra
Handle EPERM in pg_numa_init When running in Docker, the container may not have privileges needed by get_mempolicy(). This is called by numa_available() in libnuma, but versions prior to 2.0.19 did not expect that. The numa_available() call seemingly succeeds, but then we get unexpected failures w