pgsql: Support buffer forwarding in read_stream.c.

2025-03-20 Thread Thomas Munro
Support buffer forwarding in read_stream.c. In preparation for a follow-up change to the buffer manager, teach read_stream.c to manage buffers "forwarded" from one StartReadBuffers() call to the next after a short read. This involves a small amount of extra book-keeping, and opens the way for low

pgsql: doc: Remove incorrect description about dropping replication slo

2025-03-20 Thread Fujii Masao
doc: Remove incorrect description about dropping replication slots. pg_drop_replication_slot() can drop replication slots created on a different database than the one where it is executed. This behavior has been in place since PostgreSQL 9.4, when pg_drop_replication_slot() was introduced. Howeve

pgsql: doc: Remove incorrect description about dropping replication slo

2025-03-20 Thread Fujii Masao
doc: Remove incorrect description about dropping replication slots. pg_drop_replication_slot() can drop replication slots created on a different database than the one where it is executed. This behavior has been in place since PostgreSQL 9.4, when pg_drop_replication_slot() was introduced. Howeve

pgsql: doc: Remove incorrect description about dropping replication slo

2025-03-20 Thread Fujii Masao
doc: Remove incorrect description about dropping replication slots. pg_drop_replication_slot() can drop replication slots created on a different database than the one where it is executed. This behavior has been in place since PostgreSQL 9.4, when pg_drop_replication_slot() was introduced. Howeve

pgsql: doc: Remove incorrect description about dropping replication slo

2025-03-20 Thread Fujii Masao
doc: Remove incorrect description about dropping replication slots. pg_drop_replication_slot() can drop replication slots created on a different database than the one where it is executed. This behavior has been in place since PostgreSQL 9.4, when pg_drop_replication_slot() was introduced. Howeve

pgsql: Simplify EXPLAIN code for Memoize

2025-03-20 Thread David Rowley
Simplify EXPLAIN code for Memoize This removes a needless special case for Memoize's FORMAT TEXT EXPLAIN output. ExplainPropertyText() outputs the same thing in text mode as the special-case code was doing, so removing the special-case code results in the same EXPLAIN output, just with less code.

pgsql: smgr: Hold interrupts in most smgr functions

2025-03-20 Thread Andres Freund
smgr: Hold interrupts in most smgr functions We need to hold interrupts across most of the smgr.c/md.c functions, as otherwise interrupt processing, e.g. due to a < ERROR elog/ereport, can trigger procsignal processing, which in turn can trigger smgrreleaseall(). As the relevant code is not reentr

pgsql: Add an additional hook for EXPLAIN option validation.

2025-03-20 Thread Robert Haas
Add an additional hook for EXPLAIN option validation. Commit c65bc2e1d14a2d4daed7c1921ac518f2c5ac3d17 made it possible for loadable modules to add EXPLAIN options. Normally, any necessary validation can be performed by the hook function passed to RegisterExtensionExplainOption, but if a loadable m

pgsql: Add test for pg_upgrade file transfer modes.

2025-03-20 Thread Nathan Bossart
Add test for pg_upgrade file transfer modes. This new test checks all of pg_upgrade's file transfer modes. For each mode, we verify that pg_upgrade either succeeds (and some test objects successfully reach the new version) or fails with an error that indicates the mode is not supported on the cur

pgsql: Add vacuum_truncate configuration parameter.

2025-03-20 Thread Nathan Bossart
Add vacuum_truncate configuration parameter. This new parameter works just like the storage parameter of the same name: if set to true (which is the default), autovacuum and VACUUM attempt to truncate any empty pages at the end of the table. It is primarily intended to help users avoid locking iss

Re: pgsql: Add vacuum_truncate configuration parameter.

2025-03-20 Thread David G. Johnston
On Thursday, March 20, 2025, Tom Lane wrote: > Nathan Bossart writes: > > Since there's presently no way to determine whether a Boolean > > storage parameter is explicitly set or has just picked up the > > default value, this commit also introduces an isset_offset member > > to relopt_parse_elt.

Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p

2025-03-20 Thread David Rowley
On Thu, 13 Mar 2025 at 21:33, Peter Eisentraut wrote: > Ok, this is weird, because we have pg_unreachable() support for MSVC: > > #if defined(HAVE__BUILTIN_UNREACHABLE) && !defined(USE_ASSERT_CHECKING) > #define pg_unreachable() __builtin_unreachable() > #elif defined(_MSC_VER) && !defined(USE_ASS

pgsql: Revert workarounds for -Wmissing-braces false positives on old G

2025-03-20 Thread Peter Eisentraut
Revert workarounds for -Wmissing-braces false positives on old GCC We have collected several instances of a workaround for GCC bug 53119, which caused false-positive compiler warnings. This bug has long been fixed, but was still seen on the buildfarm, most recently on lapwing with gcc (Debian 4.7

pgsql: Fix extension control path tests

2025-03-20 Thread Peter Eisentraut
Fix extension control path tests Change expected extension to be installed from amcheck to plpgsql since not all build farm animals has the contrib module installed. Author: Matheus Alcantara Reported-by: Tom Lane Discussion: https://www.postgresql.org/message-id/flat/e7c7bffb-8857-48d4-a71f-8