Re: pgsql: doc: Remove trailing whitespace in xref

2025-09-22 Thread Michael Paquier
On Mon, Sep 22, 2025 at 10:23:45AM +0200, Daniel Gustafsson wrote: > I am so sorry, I realized my mistake the second I hit enter, I meant to just > stage it and accidentally instead did all branches =( Reverted immediately. I > am going to go stand in the corner. Let's share a beer in the corner

pgsql: Add a test module for Bitmapset

2025-09-22 Thread Michael Paquier
for other purposes than only tests. The coverage increases from 85.2% to 93.4%. It should be possible to cover more code paths, but at least it's a beginning. Author: Greg Burd Reviewed-by: Nathan Bossart Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/7bd1abdb-b03a-464a

Re: pgsql: Fix meson build with -Duuid=ossp when using version older than 0

2025-09-21 Thread Michael Paquier
On Sun, Sep 21, 2025 at 07:57:05PM -0400, Tom Lane wrote: > Michael Paquier writes: >> Argh. Sorry about that! Would you prefer if I revert immediately on >> ~18? > > Yeah, reverting on 18 and leaving the other branches alone > would be fine with me. We can put

pgsql: Revert "Fix meson build with -Duuid=ossp when using version olde

2025-09-21 Thread Michael Paquier
Revert "Fix meson build with -Duuid=ossp when using version older than 0.60" This reverts commit 5f565b0aee90 temporarily on v18. This branch is in a release freeze state until tagged. Let's re-add this commit once the release is out. The other branches are left untouched. Discussion: https://

pgsql: Fix meson build with -Duuid=ossp when using version older than 0

2025-09-21 Thread Michael Paquier
Fix meson build with -Duuid=ossp when using version older than 0.60 The package for the UUID library may be named "uuid" or "ossp-uuid", and meson.build has been using a single call of dependency() with multiple names, something only supported since meson 0.60.0. The minimum version of meson supp

Re: pgsql: Fix meson build with -Duuid=ossp when using version older than 0

2025-09-21 Thread Michael Paquier
On Sun, Sep 21, 2025 at 07:49:44PM -0400, Tom Lane wrote: > Michael Paquier writes: > > Fix meson build with -Duuid=ossp when using version older than 0.60 > > Um ... we are in release freeze for 18.0. Not sure that this > is something that justifies breaking freeze. Argh.

pgsql: Fix meson build with -Duuid=ossp when using version older than 0

2025-09-21 Thread Michael Paquier
Fix meson build with -Duuid=ossp when using version older than 0.60 The package for the UUID library may be named "uuid" or "ossp-uuid", and meson.build has been using a single call of dependency() with multiple names, something only supported since meson 0.60.0. The minimum version of meson supp

pgsql: Fix meson build with -Duuid=ossp when using version older than 0

2025-09-21 Thread Michael Paquier
Fix meson build with -Duuid=ossp when using version older than 0.60 The package for the UUID library may be named "uuid" or "ossp-uuid", and meson.build has been using a single call of dependency() with multiple names, something only supported since meson 0.60.0. The minimum version of meson supp

pgsql: Fix meson build with -Duuid=ossp when using version older than 0

2025-09-21 Thread Michael Paquier
Fix meson build with -Duuid=ossp when using version older than 0.60 The package for the UUID library may be named "uuid" or "ossp-uuid", and meson.build has been using a single call of dependency() with multiple names, something only supported since meson 0.60.0. The minimum version of meson supp

pgsql: Fix incorrect file reference in guc.h

2025-09-20 Thread Michael Paquier
Fix incorrect file reference in guc.h GucSource_Names was documented as being in guc.c, but since 0a20ff54f5e6 it is located in guc_tables.c. The reference to the location of GucSource_Names is important, as GucSource needs to be kept in sync with GucSource_Names. Author: David G. Johnston Disc

pgsql: Fix description of WAL record blocks in hash_xlog.h

2025-09-20 Thread Michael Paquier
Fix description of WAL record blocks in hash_xlog.h hash_xlog.h included descriptions for the blocks used in WAL records that were was not completely consistent with how the records are generated, with one block missing for SQUEEZE_PAGE, and inconsistent descriptions used for block 0 in VACUUM_ONE

pgsql: Make XLogFlush() and XLogNeedsFlush() decision-making more consi

2025-09-18 Thread Michael Paquier
: Chao Li Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/caakru_a1vzrzrwo3_jv_x13ryoqlrvipgo0237g5pkzpa2y...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/deb208df4559c922df217354f2c0cb689016a2ed Modified Files -- src

pgsql: Document and check that PgStat_HashKey has no padding

2025-09-18 Thread Michael Paquier
f the hash key is already 8 bytes, which should be plenty enough already. A comment is added to discourage the addition of new fields. Author: Michael Paquier Reviewed-by: Sami Imseih Discussion: https://postgr.es/m/caa5rz0t9omat+hvsakjxwtmwvhpyfcazb41rpwkwrkfugma...@mail.gmail.com B

Re: pgsql: Move named LWLock tranche requests to shared memory.

2025-09-18 Thread Michael Paquier
On Thu, Sep 18, 2025 at 09:56:44AM -0500, Nathan Bossart wrote: > Thanks for reviewing. Committed. Thanks. batta looks happy now. -- Michael signature.asc Description: PGP signature

pgsql: Fix description of WAL record blocks in hash_xlog.h

2025-09-17 Thread Michael Paquier
Fix description of WAL record blocks in hash_xlog.h hash_xlog.h included descriptions for the blocks used in WAL records that were was not completely consistent with how the records are generated, with one block missing for SQUEEZE_PAGE, and inconsistent descriptions used for block 0 in VACUUM_ONE

Re: pgsql: Move named LWLock tranche requests to shared memory.

2025-09-17 Thread Michael Paquier
On Wed, Sep 17, 2025 at 09:34:24AM -0500, Nathan Bossart wrote: > Yeah, this stuff is rather precarious, and I'm a bit surprised there > haven't been more problems in this area. LWLock handling is quite special, but I am also getting suspicious about some more shmem areas. Perhaps these deserve a

pgsql: injection_points: Fix incrementation of variable-numbered stats

2025-09-16 Thread Michael Paquier
injection_points: Fix incrementation of variable-numbered stats The pending entry was not used when incrementing its data, directly manipulating the shared memory pointer, without even locking it. This could mean losing statistics under concurrent activity. The flush callback was a no-op. This

Re: pgsql: Move named LWLock tranche requests to shared memory.

2025-09-16 Thread Michael Paquier
On Tue, Sep 16, 2025 at 11:10:34PM -0500, Nathan Bossart wrote: > I was able to simplify the patch. + if (LocalNamedLWLockTrancheRequestArray) + NamedLWLockTrancheRequestArray = LocalNamedLWLockTrancheRequestArray; It's not a common practice in the code to rely on a shmem state that shoul

Re: pgsql: Move named LWLock tranche requests to shared memory.

2025-09-16 Thread Michael Paquier
Ni Nathan, On Thu, Sep 11, 2025 at 09:15:12PM +, Nathan Bossart wrote: > Move named LWLock tranche requests to shared memory. > > In EXEC_BACKEND builds, GetNamedLWLockTranche() can segfault when > called outside of the postmaster process, as it might access > NamedLWLockTrancheRequestArray,

pgsql: injection_points: Fix incrementation of variable-numbered stats

2025-09-16 Thread Michael Paquier
injection_points: Fix incrementation of variable-numbered stats The pending entry was not used when incrementing its data, directly manipulating the shared memory pointer, without even locking it. This could mean losing statistics under concurrent activity. The flush callback was a no-op. This

pgsql: Fix shared memory calculation size of PgAioCtl

2025-09-16 Thread Michael Paquier
Fix shared memory calculation size of PgAioCtl The shared memory size was calculated based on an offset of io_handles, which is itself a pointer included in the structure. We tend to overestimate the shared memory size overall, so this was unlikely an issue in practice, but let's be correct and u

pgsql: Fix shared memory calculation size of PgAioCtl

2025-09-16 Thread Michael Paquier
Fix shared memory calculation size of PgAioCtl The shared memory size was calculated based on an offset of io_handles, which is itself a pointer included in the structure. We tend to overestimate the shared memory size overall, so this was unlikely an issue in practice, but let's be correct and u

pgsql: Fix description of WAL record blocks in hash_xlog.h

2025-09-13 Thread Michael Paquier
Fix description of WAL record blocks in hash_xlog.h hash_xlog.h included descriptions for the blocks used in WAL records that were was not completely consistent with how the records are generated, with one block missing for SQUEEZE_PAGE, and inconsistent descriptions used for block 0 in VACUUM_ONE

pgsql: Fix leak with SMgrRelations in startup process

2025-09-11 Thread Michael Paquier
Fix leak with SMgrRelations in startup process The startup process does not process shared invalidation messages, only sending them, and never calls AtEOXact_SMgr() which clean up any unpinned SMgrRelations. Hence, it is never able to free SMgrRelations on a periodic basis, bloating its hashtable

pgsql: Fix corruption of pgstats shared hashtable due to OOM failures

2025-09-11 Thread Michael Paquier
Fix corruption of pgstats shared hashtable due to OOM failures A new pgstats entry is created as a two-step process: - The entry is looked at in the shared hashtable of pgstats, and is inserted if not found. - When not found and inserted, its fields are then initialized. This part include a DSA c

pgsql: Remove whitespace in comment of pg_stat_statements.c

2025-09-11 Thread Michael Paquier
Remove whitespace in comment of pg_stat_statements.c Introduced by 6b4d23feef6e, spotted while reading this area of the code. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/306dd13079ed616c414c9411c5deadffea273266 Modified Files -- contrib/pg_stat_stat

pgsql: Add more information for WAL records of hash index AMs

2025-09-11 Thread Michael Paquier
Add more information for WAL records of hash index AMs hashdesc.c was missing a couple of fields in its record descriptions, as of: - is_prev_bucket_same_wrt for SQUEEZE_PAGE. - procid for INIT_META_PAGE. - old_bucket_flag and new_bucket_flag for SPLIT_ALLOCATE_PAGE. The author has noted the firs

pgsql: Fix description of WAL record blocks in hash_xlog.h

2025-09-11 Thread Michael Paquier
Fix description of WAL record blocks in hash_xlog.h hash_xlog.h included descriptions for the blocks used in WAL records that were was not completely consistent with how the records are generated, with one block missing for SQUEEZE_PAGE, and inconsistent descriptions used for block 0 in VACUUM_ONE

pgsql: Fix description of WAL record blocks in hash_xlog.h

2025-09-11 Thread Michael Paquier
Fix description of WAL record blocks in hash_xlog.h hash_xlog.h included descriptions for the blocks used in WAL records that were was not completely consistent with how the records are generated, with one block missing for SQUEEZE_PAGE, and inconsistent descriptions used for block 0 in VACUUM_ONE

pgsql: Fix description of WAL record blocks in hash_xlog.h

2025-09-11 Thread Michael Paquier
Fix description of WAL record blocks in hash_xlog.h hash_xlog.h included descriptions for the blocks used in WAL records that were was not completely consistent with how the records are generated, with one block missing for SQUEEZE_PAGE, and inconsistent descriptions used for block 0 in VACUUM_ONE

pgsql: Fix description of WAL record blocks in hash_xlog.h

2025-09-11 Thread Michael Paquier
Fix description of WAL record blocks in hash_xlog.h hash_xlog.h included descriptions for the blocks used in WAL records that were was not completely consistent with how the records are generated, with one block missing for SQUEEZE_PAGE, and inconsistent descriptions used for block 0 in VACUUM_ONE

pgsql: Fix incorrect file reference in guc.h

2025-09-10 Thread Michael Paquier
Fix incorrect file reference in guc.h GucSource_Names was documented as being in guc.c, but since 0a20ff54f5e6 it is located in guc_tables.c. The reference to the location of GucSource_Names is important, as GucSource needs to be kept in sync with GucSource_Names. Author: David G. Johnston Disc

pgsql: Fix incorrect file reference in guc.h

2025-09-10 Thread Michael Paquier
Fix incorrect file reference in guc.h GucSource_Names was documented as being in guc.c, but since 0a20ff54f5e6 it is located in guc_tables.c. The reference to the location of GucSource_Names is important, as GucSource needs to be kept in sync with GucSource_Names. Author: David G. Johnston Disc

pgsql: Fix incorrect file reference in guc.h

2025-09-10 Thread Michael Paquier
Fix incorrect file reference in guc.h GucSource_Names was documented as being in guc.c, but since 0a20ff54f5e6 it is located in guc_tables.c. The reference to the location of GucSource_Names is important, as GucSource needs to be kept in sync with GucSource_Names. Author: David G. Johnston Disc

pgsql: Remove dynahash.h

2025-09-09 Thread Michael Paquier
Remove dynahash.h All the callers of my_log2() are now limited inside dynahash.c, so let's remove this header. The same capability is provided by pg_bitutils.h already. Discussion: https://postgr.es/m/CAEZATCUJPQD_7sC-wErak2CQGNa6bj2hY-mr8wsBki=kx7f...@mail.gmail.com Branch -- master Deta

pgsql: Replace callers of dynahash.h's my_log() by equivalent in pg_bit

2025-09-09 Thread Michael Paquier
Replace callers of dynahash.h's my_log() by equivalent in pg_bitutils.h All the calls replaced by this commit use 4-byte integers for their variables used in input of my_log2(). Hence, the limit against too-large inputs does not really apply. Thresholds are also applied, as of: - In nodeAgg.c, t

pgsql: Fix leak with SMgrRelations in startup process

2025-09-09 Thread Michael Paquier
Fix leak with SMgrRelations in startup process The startup process does not process shared invalidation messages, only sending them, and never calls AtEOXact_SMgr() which clean up any unpinned SMgrRelations. Hence, it is never able to free SMgrRelations on a periodic basis, bloating its hashtable

pgsql: Fix leak with SMgrRelations in startup process

2025-09-09 Thread Michael Paquier
Fix leak with SMgrRelations in startup process The startup process does not process shared invalidation messages, only sending them, and never calls AtEOXact_SMgr() which clean up any unpinned SMgrRelations. Hence, it is never able to free SMgrRelations on a periodic basis, bloating its hashtable

pgsql: Fix corruption of pgstats shared hashtable due to OOM failures

2025-09-08 Thread Michael Paquier
Fix corruption of pgstats shared hashtable due to OOM failures A new pgstats entry is created as a two-step process: - The entry is looked at in the shared hashtable of pgstats, and is inserted if not found. - When not found and inserted, its fields are then initialized. This part include a DSA c

pgsql: Fix corruption of pgstats shared hashtable due to OOM failures

2025-09-07 Thread Michael Paquier
Fix corruption of pgstats shared hashtable due to OOM failures A new pgstats entry is created as a two-step process: - The entry is looked at in the shared hashtable of pgstats, and is inserted if not found. - When not found and inserted, its fields are then initialized. This part include a DSA c

pgsql: Fix corruption of pgstats shared hashtable due to OOM failures

2025-09-07 Thread Michael Paquier
Fix corruption of pgstats shared hashtable due to OOM failures A new pgstats entry is created as a two-step process: - The entry is looked at in the shared hashtable of pgstats, and is inserted if not found. - When not found and inserted, its fields are then initialized. This part include a DSA c

pgsql: Fix corruption of pgstats shared hashtable due to OOM failures

2025-09-07 Thread Michael Paquier
Fix corruption of pgstats shared hashtable due to OOM failures A new pgstats entry is created as a two-step process: - The entry is looked at in the shared hashtable of pgstats, and is inserted if not found. - When not found and inserted, its fields are then initialized. This part include a DSA c

pgsql: Update parser README to include parse_jsontable.c

2025-09-07 Thread Michael Paquier
Update parser README to include parse_jsontable.c The README was missing parse_jsontable.c which handles JSON_TABLE. Oversight in de3600452b61. Author: Karthik S Discussion: https://postgr.es/m/CAK4gQD9gdcj+vq_FZGp=Rv-W+41v8_C7cmCUmDeu=cfrodf...@mail.gmail.com Backpatch-through: 17 Branch

pgsql: Update parser README to include parse_jsontable.c

2025-09-07 Thread Michael Paquier
Update parser README to include parse_jsontable.c The README was missing parse_jsontable.c which handles JSON_TABLE. Oversight in de3600452b61. Author: Karthik S Discussion: https://postgr.es/m/CAK4gQD9gdcj+vq_FZGp=Rv-W+41v8_C7cmCUmDeu=cfrodf...@mail.gmail.com Backpatch-through: 17 Branch

pgsql: Update parser README to include parse_jsontable.c

2025-09-07 Thread Michael Paquier
Update parser README to include parse_jsontable.c The README was missing parse_jsontable.c which handles JSON_TABLE. Oversight in de3600452b61. Author: Karthik S Discussion: https://postgr.es/m/CAK4gQD9gdcj+vq_FZGp=Rv-W+41v8_C7cmCUmDeu=cfrodf...@mail.gmail.com Backpatch-through: 17 Branch

pgsql: Fix outdated comments in slru.c

2025-09-06 Thread Michael Paquier
Fix outdated comments in slru.c SlruRecentlyUsed() is an inline function since 53c2a97a9266, not a macro. The description of long_segment_names was missing at the top of SimpleLruInit(), part forgotten in 4ed8f0913bfd. Author: Julien Rouhaud Discussion: https://postgr.es/m/aLpBLMOYwEQkaleF@jrou

Re: pgsql: Allow to log raw parse tree.

2025-09-05 Thread Michael Paquier
On Fri, Sep 05, 2025 at 10:52:55PM +, Tatsuo Ishii wrote: > Allow to log raw parse tree. > > This commit allows to log the raw parse tree in the same way we > currently log the parse tree, rewritten tree, and plan tree. > > To avoid unnecessary log noise for users not interested in this > det

pgsql: Fix outdated comments in slru.c

2025-09-04 Thread Michael Paquier
Fix outdated comments in slru.c SlruRecentlyUsed() is an inline function since 53c2a97a9266, not a macro. The description of long_segment_names was missing at the top of SimpleLruInit(), part forgotten in 4ed8f0913bfd. Author: Julien Rouhaud Discussion: https://postgr.es/m/aLpBLMOYwEQkaleF@jrou

pgsql: Fix outdated comments in slru.c

2025-09-04 Thread Michael Paquier
Fix outdated comments in slru.c SlruRecentlyUsed() is an inline function since 53c2a97a9266, not a macro. The description of long_segment_names was missing at the top of SimpleLruInit(), part forgotten in 4ed8f0913bfd. Author: Julien Rouhaud Discussion: https://postgr.es/m/aLpBLMOYwEQkaleF@jrou

pgsql: Switch some numeric-related functions to use soft error reportin

2025-09-04 Thread Michael Paquier
Switch some numeric-related functions to use soft error reporting This commit changes some functions related to the data type numeric to use the soft error reporting rather than a custom boolean flag (called "have_error") that callers of these functions could rely on to bypass the generation of ER

pgsql: Change pg_lsn_in_internal() to use soft error reporting

2025-09-04 Thread Michael Paquier
Change pg_lsn_in_internal() to use soft error reporting pg_lsn includes pg_lsn_in_internal() for the purpose of parsing a LSN position for the GUC recovery_target_lsn (21f428ebde39). It relies on a boolean called "have_error" that would be set when the LSN parsing fails, then let its callers hand

pgsql: Fix incorrect comment in pgstat_backend.c

2025-09-04 Thread Michael Paquier
Fix incorrect comment in pgstat_backend.c The counters saved from pgWalUsage, used for the difference calculations when flushing the backend WAL stats, are updated when calling pgstat_flush_backend() under PGSTAT_BACKEND_FLUSH_WAL, and not pgstat_report_wal(). The comment updated in this commit r

pgsql: Fix incorrect comment in pgstat_backend.c

2025-09-03 Thread Michael Paquier
Fix incorrect comment in pgstat_backend.c The counters saved from pgWalUsage, used for the difference calculations when flushing the backend WAL stats, are updated when calling pgstat_flush_backend() under PGSTAT_BACKEND_FLUSH_WAL, and not pgstat_report_wal(). The comment updated in this commit r

pgsql: Update outdated references to the SLRU ControlLock

2025-09-03 Thread Michael Paquier
Update outdated references to the SLRU ControlLock SLRU bank locks are referred as "bank locks" or "SLRU bank locks" in the code comments. The comments updated in this commit use the latter term. Oversight in 53c2a97a9266, that has replaced the single ControlLock by the bank control locks. Auth

pgsql: libpq: Fix PQtrace() format for non-printable characters

2025-09-02 Thread Michael Paquier
libpq: Fix PQtrace() format for non-printable characters PQtrace() was generating its output for non-printable characters without casting the characters printed with unsigned char, leading to some extra "\xff" generated in the output due to the fact that char may be signed. Oversights introdu

pgsql: libpq: Fix PQtrace() format for non-printable characters

2025-09-02 Thread Michael Paquier
libpq: Fix PQtrace() format for non-printable characters PQtrace() was generating its output for non-printable characters without casting the characters printed with unsigned char, leading to some extra "\xff" generated in the output due to the fact that char may be signed. Oversights introdu

pgsql: libpq: Fix PQtrace() format for non-printable characters

2025-09-02 Thread Michael Paquier
libpq: Fix PQtrace() format for non-printable characters PQtrace() was generating its output for non-printable characters without casting the characters printed with unsigned char, leading to some extra "\xff" generated in the output due to the fact that char may be signed. Oversights introdu

pgsql: libpq: Fix PQtrace() format for non-printable characters

2025-09-02 Thread Michael Paquier
libpq: Fix PQtrace() format for non-printable characters PQtrace() was generating its output for non-printable characters without casting the characters printed with unsigned char, leading to some extra "\xff" generated in the output due to the fact that char may be signed. Oversights introdu

pgsql: libpq: Fix PQtrace() format for non-printable characters

2025-09-02 Thread Michael Paquier
libpq: Fix PQtrace() format for non-printable characters PQtrace() was generating its output for non-printable characters without casting the characters printed with unsigned char, leading to some extra "\xff" generated in the output due to the fact that char may be signed. Oversights introdu

pgsql: libpq: Fix PQtrace() format for non-printable characters

2025-09-02 Thread Michael Paquier
libpq: Fix PQtrace() format for non-printable characters PQtrace() was generating its output for non-printable characters without casting the characters printed with unsigned char, leading to some extra "\xff" generated in the output due to the fact that char may be signed. Oversights introdu

pgsql: Update outdated references to the SLRU ControlLock

2025-09-02 Thread Michael Paquier
Update outdated references to the SLRU ControlLock SLRU bank locks are referred as "bank locks" or "SLRU bank locks" in the code comments. The comments updated in this commit use the latter term. Oversight in 53c2a97a9266, that has replaced the single ControlLock by the bank control locks. Auth

pgsql: Update outdated references to the SLRU ControlLock

2025-09-02 Thread Michael Paquier
Update outdated references to the SLRU ControlLock SLRU bank locks are referred as "bank locks" or "SLRU bank locks" in the code comments. The comments updated in this commit use the latter term. Oversight in 53c2a97a9266, that has replaced the single ControlLock by the bank control locks. Auth

pgsql: Generate pgstat_count_slru*() functions for slru using macros

2025-09-02 Thread Michael Paquier
Generate pgstat_count_slru*() functions for slru using macros This change replaces seven functions definitions by macros, reducing a bit some repetitive patterns in the code. An interesting side effect is that this removes an inconsistency in the naming of SLRU increment functions with the field

pgsql: postgres_fdw: Use psql variables for connection parameters

2025-08-31 Thread Michael Paquier
postgres_fdw: Use psql variables for connection parameters Several statements need to reference the current connection's current database name and current port value. Until now, this has been accomplished by creating dynamic SQL statements inside of a DO block, which is not as easy to parse. It

pgsql: Change dynahash.c and hsearch.h to use int64 instead of long

2025-08-21 Thread Michael Paquier
Change dynahash.c and hsearch.h to use int64 instead of long This code was relying on "long", which is signed 8 bytes everywhere except on Windows where it is 4 bytes, that could potentially expose it to overflows, even if the current uses in the code are fine as far as I know. This code is now a

pgsql: Ignore temporary relations in RelidByRelfilenumber()

2025-08-21 Thread Michael Paquier
Reviewed-By: Ashutosh Bapat Reviewed-By: Robert Haas Reviewed-By: Kyotaro Horiguchi Reviewed-By: Takamichi Osumi Reviewed-By: Michael Paquier Reviewed-By: Masahiko Sawada Reported-By: Shenhao Wang Discussion: https://postgr.es/m/bbaaf9f9-ebb2-645f-54bb-34d6efc7a...@fujitsu.com Backpatch

pgsql: Ignore temporary relations in RelidByRelfilenumber()

2025-08-21 Thread Michael Paquier
Reviewed-By: Ashutosh Bapat Reviewed-By: Robert Haas Reviewed-By: Kyotaro Horiguchi Reviewed-By: Takamichi Osumi Reviewed-By: Michael Paquier Reviewed-By: Masahiko Sawada Reported-By: Shenhao Wang Discussion: https://postgr.es/m/bbaaf9f9-ebb2-645f-54bb-34d6efc7a...@fujitsu.com Backpatch

pgsql: Ignore temporary relations in RelidByRelfilenumber()

2025-08-21 Thread Michael Paquier
Reviewed-By: Ashutosh Bapat Reviewed-By: Robert Haas Reviewed-By: Kyotaro Horiguchi Reviewed-By: Takamichi Osumi Reviewed-By: Michael Paquier Reviewed-By: Masahiko Sawada Reported-By: Shenhao Wang Discussion: https://postgr.es/m/bbaaf9f9-ebb2-645f-54bb-34d6efc7a...@fujitsu.com Backpatch

pgsql: Ignore temporary relations in RelidByRelfilenumber()

2025-08-21 Thread Michael Paquier
Reviewed-By: Ashutosh Bapat Reviewed-By: Robert Haas Reviewed-By: Kyotaro Horiguchi Reviewed-By: Takamichi Osumi Reviewed-By: Michael Paquier Reviewed-By: Masahiko Sawada Reported-By: Shenhao Wang Discussion: https://postgr.es/m/bbaaf9f9-ebb2-645f-54bb-34d6efc7a...@fujitsu.com Backpatch

pgsql: Ignore temporary relations in RelidByRelfilenumber()

2025-08-21 Thread Michael Paquier
Reviewed-By: Ashutosh Bapat Reviewed-By: Robert Haas Reviewed-By: Kyotaro Horiguchi Reviewed-By: Takamichi Osumi Reviewed-By: Michael Paquier Reviewed-By: Masahiko Sawada Reported-By: Shenhao Wang Discussion: https://postgr.es/m/bbaaf9f9-ebb2-645f-54bb-34d6efc7a...@fujitsu.com Backpatch

pgsql: Ignore temporary relations in RelidByRelfilenumber()

2025-08-21 Thread Michael Paquier
Reviewed-By: Ashutosh Bapat Reviewed-By: Robert Haas Reviewed-By: Kyotaro Horiguchi Reviewed-By: Takamichi Osumi Reviewed-By: Michael Paquier Reviewed-By: Masahiko Sawada Reported-By: Shenhao Wang Discussion: https://postgr.es/m/bbaaf9f9-ebb2-645f-54bb-34d6efc7a...@fujitsu.com Backpatch

pgsql: Ignore temporary relations in RelidByRelfilenumber()

2025-08-21 Thread Michael Paquier
Reviewed-By: Ashutosh Bapat Reviewed-By: Robert Haas Reviewed-By: Kyotaro Horiguchi Reviewed-By: Takamichi Osumi Reviewed-By: Michael Paquier Reviewed-By: Masahiko Sawada Reported-By: Shenhao Wang Discussion: https://postgr.es/m/bbaaf9f9-ebb2-645f-54bb-34d6efc7a...@fujitsu.com Backpatch

pgsql: Apply some fat commas to commands of TAP tests

2025-08-20 Thread Michael Paquier
Apply some fat commas to commands of TAP tests This is similar to 19c6e92b13b2, in order to keep the style used in the scripts consistent for the option names and values used in commands. The places updated in this commit have been added recently in 71ea0d679543. These changes are cosmetic; there

pgsql: doc: Improve description of wal_compression

2025-08-20 Thread Michael Paquier
doc: Improve description of wal_compression The description of this GUC provides a list of the situations where full-page writes are generated. However, it is not completely exact, mentioning only the cases where full_page_writes=on or base backups. It is possible to generate full-page writes in

pgsql: doc: Improve description of wal_compression

2025-08-20 Thread Michael Paquier
doc: Improve description of wal_compression The description of this GUC provides a list of the situations where full-page writes are generated. However, it is not completely exact, mentioning only the cases where full_page_writes=on or base backups. It is possible to generate full-page writes in

pgsql: doc: Improve description of wal_compression

2025-08-20 Thread Michael Paquier
doc: Improve description of wal_compression The description of this GUC provides a list of the situations where full-page writes are generated. However, it is not completely exact, mentioning only the cases where full_page_writes=on or base backups. It is possible to generate full-page writes in

pgsql: doc: Improve description of wal_compression

2025-08-20 Thread Michael Paquier
doc: Improve description of wal_compression The description of this GUC provides a list of the situations where full-page writes are generated. However, it is not completely exact, mentioning only the cases where full_page_writes=on or base backups. It is possible to generate full-page writes in

pgsql: doc: Improve description of wal_compression

2025-08-20 Thread Michael Paquier
doc: Improve description of wal_compression The description of this GUC provides a list of the situations where full-page writes are generated. However, it is not completely exact, mentioning only the cases where full_page_writes=on or base backups. It is possible to generate full-page writes in

pgsql: doc: Improve description of wal_compression

2025-08-20 Thread Michael Paquier
doc: Improve description of wal_compression The description of this GUC provides a list of the situations where full-page writes are generated. However, it is not completely exact, mentioning only the cases where full_page_writes=on or base backups. It is possible to generate full-page writes in

pgsql: doc: Improve description of wal_compression

2025-08-20 Thread Michael Paquier
doc: Improve description of wal_compression The description of this GUC provides a list of the situations where full-page writes are generated. However, it is not completely exact, mentioning only the cases where full_page_writes=on or base backups. It is possible to generate full-page writes in

Re: pgsql: Move SQL-callable code related to multixacts into its own file

2025-08-20 Thread Michael Paquier
On Tue, Aug 19, 2025 at 12:31:14PM +0200, Alvaro Herrera wrote: > Hmm, don't you find strange that dbcommands.h is still included there? > I wondered about that and found out that we have get_database_name() > declared there. It sort-of makes sense, because it was originally done > by scanning pg_

pgsql: Fix assertion failure with replication slot release in single-us

2025-08-19 Thread Michael Paquier
Fix assertion failure with replication slot release in single-user mode Some replication slot manipulations (logical decoding via SQL, advancing) were failing an assertion when releasing a slot in single-user mode, because active_pid was not set in a ReplicationSlot when its slot is acquired. Rep

pgsql: Fix assertion failure with replication slot release in single-us

2025-08-19 Thread Michael Paquier
Fix assertion failure with replication slot release in single-user mode Some replication slot manipulations (logical decoding via SQL, advancing) were failing an assertion when releasing a slot in single-user mode, because active_pid was not set in a ReplicationSlot when its slot is acquired. Rep

pgsql: Fix assertion failure with replication slot release in single-us

2025-08-19 Thread Michael Paquier
Fix assertion failure with replication slot release in single-user mode Some replication slot manipulations (logical decoding via SQL, advancing) were failing an assertion when releasing a slot in single-user mode, because active_pid was not set in a ReplicationSlot when its slot is acquired. Rep

pgsql: Fix assertion failure with replication slot release in single-us

2025-08-19 Thread Michael Paquier
Fix assertion failure with replication slot release in single-user mode Some replication slot manipulations (logical decoding via SQL, advancing) were failing an assertion when releasing a slot in single-user mode, because active_pid was not set in a ReplicationSlot when its slot is acquired. Rep

pgsql: Fix assertion failure with replication slot release in single-us

2025-08-19 Thread Michael Paquier
Fix assertion failure with replication slot release in single-user mode Some replication slot manipulations (logical decoding via SQL, advancing) were failing an assertion when releasing a slot in single-user mode, because active_pid was not set in a ReplicationSlot when its slot is acquired. Rep

pgsql: Fix assertion failure with replication slot release in single-us

2025-08-19 Thread Michael Paquier
Fix assertion failure with replication slot release in single-user mode Some replication slot manipulations (logical decoding via SQL, advancing) were failing an assertion when releasing a slot in single-user mode, because active_pid was not set in a ReplicationSlot when its slot is acquired. Rep

pgsql: Fix assertion failure with replication slot release in single-us

2025-08-19 Thread Michael Paquier
Fix assertion failure with replication slot release in single-user mode Some replication slot manipulations (logical decoding via SQL, advancing) were failing an assertion when releasing a slot in single-user mode, because active_pid was not set in a ReplicationSlot when its slot is acquired. Rep

pgsql: Refactor ReadMultiXactCounts() into GetMultiXactInfo()

2025-08-18 Thread Michael Paquier
added to multixact.h, becoming available for out-of-core code. Extracted from a larger patch by the same author. Author: Naga Appani Reviewed-by: Ashutosh Bapat Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/ca+qey+aasyk6wvbw4qyzhz4bahhycday_q5ecmhkev_eb9c...@mail.gmail.com

pgsql: Remove useless pointer update in StatsShmemInit()

2025-08-18 Thread Michael Paquier
Remove useless pointer update in StatsShmemInit() This pointer was not used after its last update. This variable assignment was most likely a vestige artifact of the earlier versions of the patch set that have led to 5891c7a8ed8f. This pointer update is useless, so let's remove it. It removes o

pgsql: test_ddl_deparse: Rename test create_sequence_1 to create_sequen

2025-08-18 Thread Michael Paquier
test_ddl_deparse: Rename test create_sequence_1 to create_sequence This test was the only one named following the convention used for alternate output files. This was a little bit confusing when looking at the diffs of the test, because one would think that the diffs are based on an uncommon case

pgsql: Remove unneeded header declarations in multixact.c

2025-08-18 Thread Michael Paquier
Remove unneeded header declarations in multixact.c Two header declarations were related to SQL-callable functions, that should have been cleaned up in df9133fa6384. Some more includes can be removed on closer inspection, so let's clean up these as well, while on it. Reported-by: Tom Lane Discus

Re: pgsql: Move SQL-callable code related to multixacts into its own file

2025-08-18 Thread Michael Paquier
On Mon, Aug 18, 2025 at 09:47:14AM -0400, Tom Lane wrote: > Michael Paquier writes: > > Move SQL-callable code related to multixacts into its own file > > Couldn't this have removed some #include-s from multixact.c? Right. funcapi.h and fmgrprotos.h are direct dependencies

pgsql: Move SQL-callable code related to multixacts into its own file

2025-08-17 Thread Michael Paquier
mxstatus_to_string() to multixact.h. Extracted from a larger patch by the same author, tweaked by me. Author: Naga Appani Reviewed-by: Michael Paquier Reviewed-by: Ashutosh Bapat Discussion: https://postgr.es/m/ca+qey+aasyk6wvbw4qyzhz4bahhycday_q5ecmhkev_eb9c...@mail.gmail.com Branch

pgsql: Refactor init_params() in sequence.c to not use FormData_pg_sequ

2025-08-17 Thread Michael Paquier
s relates to WAL logging. We still need to depend on FormData_pg_sequence. Author: Michael Paquier Reviewed-by: Kirill Reshke Reviewed-by: Tomas Vondra Discussion: https://postgr.es/m/zwlohtkas0uvv...@paquier.xyz Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/

pgsql: Remove md5() call from isolation test for CLUSTER and TOAST

2025-08-17 Thread Michael Paquier
Remove md5() call from isolation test for CLUSTER and TOAST This test was failing because MD5 computations are not supported in these environments. This switches the test to rely on sha256() instead, providing the same coverage while avoiding the failure. Oversight in f57e214d1cbb. Per buildfar

Re: pgsql: Add isolation test for TOAST value reuse during CLUSTER

2025-08-17 Thread Michael Paquier
On Sun, Aug 17, 2025 at 06:27:57AM +, Michael Paquier wrote: > Add isolation test for TOAST value reuse during CLUSTER A couple of buildfarm members have been complaining about this test using md5(). Will fix in a bit. -- Michael signature.asc Description: PGP signature

pgsql: Add isolation test for TOAST value reuse during CLUSTER

2025-08-16 Thread Michael Paquier
Add isolation test for TOAST value reuse during CLUSTER This test exercises the corner case in toast_save_datum() where CLUSTER operations encounter duplicated TOAST references, reusing the existing TOAST data instead of creating redundant copies. During table rewrites like CLUSTER, both live and

pgsql: Add SQL test for TOAST value allocations on rewrite

2025-08-14 Thread Michael Paquier
. Author: Nikhil Kumar Veldanda Co-authored-by: Michael Paquier Discussion: https://postgr.es/m/cafafj_e+kw5p713s8_jzyvgqagvffzfitujprgo-tttjjoa...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/69f75d6714753e594fb383d2e53a8003a8b54dfd Modified

pgsql: Fix compilation warning with SerializeClientConnectionInfo()

2025-08-14 Thread Michael Paquier
Fix compilation warning with SerializeClientConnectionInfo() This function uses an argument named "maxsize" that is only used in assertions, being set once outside the assertion area. Recent gcc versions with -Wunused-but-set-parameter complain about a warning when building without assertions ena

  1   2   3   4   5   6   7   8   9   10   >