pgsql: Expose wal_fpi_bytes in EXPLAIN (WAL)

2025-10-29 Thread Michael Paquier
Expose wal_fpi_bytes in EXPLAIN (WAL) The new wal_fpi_bytes counter calculates the total amount of full page images inserted in WAL records, in bytes. This commit exposes this information in EXPLAIN (ANALYZE, WAL) alongside the existing counters, for both the text and JSON/YAML outputs, building

pgsql: Fix regression with slot invalidation checks

2025-10-29 Thread Michael Paquier
Fix regression with slot invalidation checks This commit reverts 818fefd8fd4, that has been introduced to address a an instability in some of the TAP tests due to the presence of random standby snapshot WAL records, when slots are invalidated by InvalidatePossiblyObsoleteSlot(). Anyway, this comm

pgsql: Fix regression with slot invalidation checks

2025-10-29 Thread Michael Paquier
Fix regression with slot invalidation checks This commit reverts 818fefd8fd4, that has been introduced to address a an instability in some of the TAP tests due to the presence of random standby snapshot WAL records, when slots are invalidated by InvalidatePossiblyObsoleteSlot(). Anyway, this comm

pgsql: Fix regression with slot invalidation checks

2025-10-29 Thread Michael Paquier
Fix regression with slot invalidation checks This commit reverts 818fefd8fd4, that has been introduced to address a an instability in some of the TAP tests due to the presence of random standby snapshot WAL records, when slots are invalidated by InvalidatePossiblyObsoleteSlot(). Anyway, this comm

pgsql: Fix regression with slot invalidation checks

2025-10-29 Thread Michael Paquier
Fix regression with slot invalidation checks This commit reverts 818fefd8fd4, that has been introduced to address a an instability in some of the TAP tests due to the presence of random standby snapshot WAL records, when slots are invalidated by InvalidatePossiblyObsoleteSlot(). Anyway, this comm

pgsql: Disable parallel plans for RIGHT_SEMI joins

2025-10-29 Thread Richard Guo
Disable parallel plans for RIGHT_SEMI joins RIGHT_SEMI joins rely on the HEAP_TUPLE_HAS_MATCH flag to guarantee that only the first match for each inner tuple is considered. However, in a parallel hash join, the inner relation is stored in a shared global hash table that can be probed by multiple

pgsql: Disable parallel plans for RIGHT_SEMI joins

2025-10-29 Thread Richard Guo
Disable parallel plans for RIGHT_SEMI joins RIGHT_SEMI joins rely on the HEAP_TUPLE_HAS_MATCH flag to guarantee that only the first match for each inner tuple is considered. However, in a parallel hash join, the inner relation is stored in a shared global hash table that can be probed by multiple

pgsql: Fix bogus use of "long" in AllocSetCheck()

2025-10-29 Thread David Rowley
Fix bogus use of "long" in AllocSetCheck() Because long is 32-bit on 64-bit Windows, it isn't a good datatype to store the difference between 2 pointers. The under-sized type could overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds, such as: WARNING: problem in alloc set Exec

pgsql: Fix bogus use of "long" in AllocSetCheck()

2025-10-29 Thread David Rowley
Fix bogus use of "long" in AllocSetCheck() Because long is 32-bit on 64-bit Windows, it isn't a good datatype to store the difference between 2 pointers. The under-sized type could overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds, such as: WARNING: problem in alloc set Exec

pgsql: Fix bogus use of "long" in AllocSetCheck()

2025-10-29 Thread David Rowley
Fix bogus use of "long" in AllocSetCheck() Because long is 32-bit on 64-bit Windows, it isn't a good datatype to store the difference between 2 pointers. The under-sized type could overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds, such as: WARNING: problem in alloc set Exec

pgsql: Fix bogus use of "long" in AllocSetCheck()

2025-10-29 Thread David Rowley
Fix bogus use of "long" in AllocSetCheck() Because long is 32-bit on 64-bit Windows, it isn't a good datatype to store the difference between 2 pointers. The under-sized type could overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds, such as: WARNING: problem in alloc set Exec

pgsql: Fix bogus use of "long" in AllocSetCheck()

2025-10-29 Thread David Rowley
Fix bogus use of "long" in AllocSetCheck() Because long is 32-bit on 64-bit Windows, it isn't a good datatype to store the difference between 2 pointers. The under-sized type could overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds, such as: WARNING: problem in alloc set Exec

pgsql: Fix bogus use of "long" in AllocSetCheck()

2025-10-29 Thread David Rowley
Fix bogus use of "long" in AllocSetCheck() Because long is 32-bit on 64-bit Windows, it isn't a good datatype to store the difference between 2 pointers. The under-sized type could overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds, such as: WARNING: problem in alloc set Exec

pgsql: Fix bogus use of "long" in AllocSetCheck()

2025-10-29 Thread David Rowley
Fix bogus use of "long" in AllocSetCheck() Because long is 32-bit on 64-bit Windows, it isn't a good datatype to store the difference between 2 pointers. The under-sized type could overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds, such as: WARNING: problem in alloc set Exec

pgsql: Use C11 char16_t and char32_t for Unicode code points.

2025-10-29 Thread Jeff Davis
Use C11 char16_t and char32_t for Unicode code points. Reviewed-by: Tatsuo Ishii Reviewed-by: Thomas Munro Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/bedcc93d06203dfd89815b10f815ca2de8626e85.camel%40j-davis.com Branch -- master Details --- https://git.postgresql.or

Re: pgsql: Add mem_exceeded_count column to pg_stat_replication_slots.

2025-10-29 Thread Masahiko Sawada
On Wed, Oct 29, 2025 at 1:52 AM Bertrand Drouvot wrote: > > Hi, > > On Wed, Oct 08, 2025 at 05:05:21PM +, Masahiko Sawada wrote: > > Add mem_exceeded_count column to pg_stat_replication_slots. > > > > This commit introduces a new column mem_exceeded_count to the > > pg_stat_replication_slots v

pgsql: pg_stat_statements: Fix handling of duplicate constant locations

2025-10-29 Thread Álvaro Herrera
pg_stat_statements: Fix handling of duplicate constant locations Two or more constants can have the same location. We handled this correctly for non squashed constants, but failed to do it if squashed (resulting in out-of-bounds memory access), because the code structure became broken by commit 0

pgsql: pg_stat_statements: Fix handling of duplicate constant locations

2025-10-29 Thread Álvaro Herrera
pg_stat_statements: Fix handling of duplicate constant locations Two or more constants can have the same location. We handled this correctly for non squashed constants, but failed to do it if squashed (resulting in out-of-bounds memory access), because the code structure became broken by commit 0

pgsql: CheckNNConstraintFetch: Fill all of ConstrCheck in a single pass

2025-10-29 Thread Álvaro Herrera
CheckNNConstraintFetch: Fill all of ConstrCheck in a single pass Previously, we'd fill all fields except ccbin, and only later obtain and detoast ccbin, with hypothetical failures being possible. If ccbin is null (rare catalog corruption I have never witnessed) or its a corrupted toast entry, we

pgsql: Reorganize GUC structs

2025-10-29 Thread Peter Eisentraut
Reorganize GUC structs Instead of having five separate GUC structs, one for each type, with the generic part contained in each of them, flip it around and have one common struct, with the type-specific part has a subfield. The very original GUC design had type-specific structs and type-specific l

Re: pgsql: Add mem_exceeded_count column to pg_stat_replication_slots.

2025-10-29 Thread Bertrand Drouvot
Hi, On Wed, Oct 08, 2025 at 05:05:21PM +, Masahiko Sawada wrote: > Add mem_exceeded_count column to pg_stat_replication_slots. > > This commit introduces a new column mem_exceeded_count to the > pg_stat_replication_slots view. This counter tracks how often the > memory used by logical decodin

pgsql: formatting.c cleanup: Use array syntax instead of pointer arithm

2025-10-29 Thread Peter Eisentraut
formatting.c cleanup: Use array syntax instead of pointer arithmetic for easier readability Reviewed-by: Chao Li Discussion: https://www.postgresql.org/message-id/flat/6dd9d208-a3ed-49b5-b03d-8617261da973%40eisentraut.org Branch -- master Details --- https://git.postgresql.org/pg/comm

pgsql: formatting.c cleanup: Remove unnecessary extra parentheses

2025-10-29 Thread Peter Eisentraut
formatting.c cleanup: Remove unnecessary extra parentheses Reviewed-by: Chao Li Discussion: https://www.postgresql.org/message-id/flat/6dd9d208-a3ed-49b5-b03d-8617261da973%40eisentraut.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2724830929ba29a5cf95fba6134

pgsql: formatting.c cleanup: Add some const pointer qualifiers

2025-10-29 Thread Peter Eisentraut
formatting.c cleanup: Add some const pointer qualifiers Co-authored-by: Chao Li Discussion: https://www.postgresql.org/message-id/flat/6dd9d208-a3ed-49b5-b03d-8617261da973%40eisentraut.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b9def57a3c95540737290ca88ea

pgsql: formatting.c cleanup: Use size_t for string length variables and

2025-10-29 Thread Peter Eisentraut
formatting.c cleanup: Use size_t for string length variables and arguments Reviewed-by: Chao Li Discussion: https://www.postgresql.org/message-id/flat/6dd9d208-a3ed-49b5-b03d-8617261da973%40eisentraut.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d98b3cdbafb

pgsql: Replace pg_restrict by standard restrict

2025-10-29 Thread Peter Eisentraut
Replace pg_restrict by standard restrict MSVC in C11 mode supports the standard restrict qualifier, so we don't need the workaround naming pg_restrict anymore. Even though restrict is in C99 and should be supported by all supported compilers, we keep the configure test and the hardcoded redirecti