pgsql: Fix typo in tablecmds.c

2025-12-14 Thread David Rowley
Fix typo in tablecmds.c Author: Chao Li Discussion: https://postgr.es/m/CAEoWx2%3DAib%2BcatZn6wHKmz0BWe8-q10NAhpxu8wUDT19SddKNA%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/cd83ed9a91bbd4d05fffd059161b060b7473f5ad Modified Files --

pgsql: Add retry logic to pg_sync_replication_slots().

2025-12-14 Thread Amit Kapila
Add retry logic to pg_sync_replication_slots(). Previously, pg_sync_replication_slots() would finish without synchronizing slots that didn't meet requirements, rather than failing outright. This could leave some failover slots unsynchronized if required catalog rows or WAL segments were missing or

pgsql: test_custom_stats: Fix compilation warning

2025-12-14 Thread Michael Paquier
test_custom_stats: Fix compilation warning I have fat-fingered an error message related to an offset while switching the code to use pgoff_t. Let's switch to the same error message used in the rest of the tree for similar failures with fseeko(), instead. Per buildfarm members running macos: long

pgsql: pageinspect: use index_close() for GiST index relation

2025-12-14 Thread Michael Paquier
pageinspect: use index_close() for GiST index relation gist_page_items() opens its target relation with index_open(), but closed it using relation_close() instead of index_close(). This was harmless because index_close() and relation_close() do the exact same work, still inconsistent with the res

pgsql: test_custom_stats: Add tests with read/write of auxiliary data

2025-12-14 Thread Michael Paquier
test_custom_stats: Add tests with read/write of auxiliary data This commit builds upon 4ba012a8ed9c, giving an example of what can be achieved with the new callbacks. This provides coverage for the new pgstats APIs, while serving as a reference template. Note that built-in stats kinds could use

pgsql: Allow cumulative statistics to read/write auxiliary data from/to

2025-12-14 Thread Michael Paquier
Allow cumulative statistics to read/write auxiliary data from/to disk Cumulative stats kinds gain the capability to write additional per-entry data when flushing the stats at shutdown, and read this data when loading back the stats at startup. This can be fit for example in the case of variable-l

pgsql: Make "pgoff_t" be a typedef not a #define.

2025-12-14 Thread Tom Lane
Make "pgoff_t" be a typedef not a #define. There doesn't seem to be any great reason why this has been a macro rather than a typedef. But doing it like that means our buildfarm typedef tooling doesn't capture the name as a typedef. That would result in pgindent glitches, except that we've seemin

pgsql: Update typedefs.list to match what the buildfarm currently repor

2025-12-14 Thread Tom Lane
Update typedefs.list to match what the buildfarm currently reports. The current list from the buildfarm includes quite a few typedef names that it used to miss. The reason is a bit obscure, but it seems likely to have something to do with our recent increased use of palloc_object and palloc_array

pgsql: Looks like we can't test NLS on machines that lack any es_ES loc

2025-12-14 Thread Tom Lane
Looks like we can't test NLS on machines that lack any es_ES locale. While commit 5b275a6e1 fixed a few unhappy buildfarm animals, it looks like the remainder simply don't have any es_ES locale at all. There's little point in running the test in that case, so minimize the number of variant expect

pgsql: bufmgr: Separate keys for private refcount infrastructure

2025-12-14 Thread Andres Freund
bufmgr: Separate keys for private refcount infrastructure This makes lookups faster, due to allowing auto-vectorized lookups. It is also beneficial for an upcoming patch, independent of auto-vectorization, as the upcoming patch wants to track more information for each pinned buffer, making the exi

pgsql: bufmgr: Add one-entry cache for private refcount

2025-12-14 Thread Andres Freund
bufmgr: Add one-entry cache for private refcount The private refcount entry for a buffer is often looked up repeatedly for the same buffer, e.g. to pin and then unpin a buffer. Benchmarking shows that it's worthwhile to have a one-entry cache for that case. With that cache in place, it's worth spl

pgsql: Try a few different locale name spellings in nls.sql.

2025-12-14 Thread Tom Lane
Try a few different locale name spellings in nls.sql. While CI testing in advance of commit 8c498479d suggested that all Unix-ish platforms would accept 'es_ES.UTF-8', the buildfarm has a different opinion. Let's dynamically select something that works, if possible. Discussion: https://postgr.es

Re: pgsql: Add a regression test to verify that NLS translation works.

2025-12-14 Thread Tom Lane
I wrote: > Alexander Korotkov writes: >> I noticed couple of buildfarm failures on bumblebee and akepa. > Yeah, I'm kind of expecting some given what we already found ... It looks like acceptable LC_MESSAGES values are more variable than the previous testing suggested. I'm going to try putting

Re: pgsql: Add a regression test to verify that NLS translation works.

2025-12-14 Thread Tom Lane
Alexander Korotkov writes: > On Sun, Dec 14, 2025, 18:55 Tom Lane wrote: >> Add a regression test to verify that NLS translation works. > I noticed couple of buildfarm failures on bumblebee and akepa. Yeah, I'm kind of expecting some given what we already found ... rega

pgsql: Fix double assignment.

2025-12-14 Thread Tom Lane
Fix double assignment. Coverity complained about this, not without reason: OldMultiXactReader *state = state = pg_malloc(sizeof(*state)); (I'm surprised this is even legal C ... why is "state" in-scope in its initialization expression?) While at it, convert to use our newly-preferred "p

Re: pgsql: Add a regression test to verify that NLS translation works.

2025-12-14 Thread Alexander Korotkov
Hi, Tom! On Sun, Dec 14, 2025, 18:55 Tom Lane wrote: > Add a regression test to verify that NLS translation works. > > We've never actually had a formal test for this facility. > It seems worth adding one now, mainly because we are starting > to depend on gettext() being able to handle the PRI*

pgsql: Add a regression test to verify that NLS translation works.

2025-12-14 Thread Tom Lane
Add a regression test to verify that NLS translation works. We've never actually had a formal test for this facility. It seems worth adding one now, mainly because we are starting to depend on gettext() being able to handle the PRI* macros from , and it's not all that certain that that works every

pgsql: Refactor WaitLSNType enum to use a macro for type count

2025-12-14 Thread Alexander Korotkov
Refactor WaitLSNType enum to use a macro for type count Change WAIT_LSN_TYPE_COUNT from an enum sentinel to a macro definition, in a similar way to IOObject, IOContext, and BackendType enums. Remove explicit enum value assignments well. Author: Xuneng Zhou Branch -- master Details ---

pgsql: Fix usage of palloc() in MERGE/SPLIT PARTITION(s) code

2025-12-14 Thread Alexander Korotkov
Fix usage of palloc() in MERGE/SPLIT PARTITION(s) code f2e4cc427951 and 4b3d173629f4 implement ALTER TABLE ... MERGE/SPLIT PARTITION(s) commands. In several places, these commits use palloc(), where we should use palloc_object() and palloc_array(). This commit provides appropriate usage of pallo

pgsql: Implement ALTER TABLE ... MERGE PARTITIONS ... command

2025-12-14 Thread Alexander Korotkov
Implement ALTER TABLE ... MERGE PARTITIONS ... command This new DDL command merges several partitions into a single partition of the target table. The target partition is created using the new createPartitionTable() function with the parent partition as the template. This commit comprises a quit

pgsql: Implement ALTER TABLE ... SPLIT PARTITION ... command

2025-12-14 Thread Alexander Korotkov
Implement ALTER TABLE ... SPLIT PARTITION ... command This new DDL command splits a single partition into several partitions. Just like the ALTER TABLE ... MERGE PARTITIONS ... command, new partitions are created using the createPartitionTable() function with the parent partition as the template.