pgsql: Remove duplicate line

2025-07-16 Thread Amit Langote
Remove duplicate line In 231b7d670b21, while copy-pasting some code into ExecEvalJsonCoercionFinish(), I (amitlan) accidentally introduced a duplicate line. Remove it. Reported-by: Jian He Discussion: https://postgr.es/m/CACJufxHcf=bpmrajcjgfjoufv76mwknyz1x3erxswl26eaf...@mail.gmail.com Branc

pgsql: Remove duplicate line

2025-07-16 Thread Amit Langote
Remove duplicate line In 231b7d670b21, while copy-pasting some code into ExecEvalJsonCoercionFinish(), I (amitlan) accidentally introduced a duplicate line. Remove it. Reported-by: Jian He Discussion: https://postgr.es/m/CACJufxHcf=bpmrajcjgfjoufv76mwknyz1x3erxswl26eaf...@mail.gmail.com Branc

pgsql: Remove duplicate line

2025-07-16 Thread Amit Langote
Remove duplicate line In 231b7d670b21, while copy-pasting some code into ExecEvalJsonCoercionFinish(), I (amitlan) accidentally introduced a duplicate line. Remove it. Reported-by: Jian He Discussion: https://postgr.es/m/CACJufxHcf=bpmrajcjgfjoufv76mwknyz1x3erxswl26eaf...@mail.gmail.com Branc

pgsql: Split regression tests for TOAST compression methods into two fi

2025-07-16 Thread Michael Paquier
Split regression tests for TOAST compression methods into two files The regression tests for TOAST compression methods are split into two independent files: one specific to LZ4 and interactions between two different TOAST compression methods, now called compression_lz4, and a second one for the "c

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

2025-07-16 Thread Tom Lane
David Rowley writes: > On Thu, 17 Jul 2025 at 15:19, Tom Lane wrote: >> Hmph. I doubt we are ready to require C11 everywhere, but maybe >> we could require it in MSVC builds? Which MSVC versions would >> that eliminate? > Going by [1] it's Visual Studio 2019, which as of 8fd9bb1d9 is now our >

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

2025-07-16 Thread David Rowley
On Thu, 17 Jul 2025 at 15:19, Tom Lane wrote: > > David Rowley writes: > > I spent a bit more time searching for a solution and did find > > something that works well enough for this case in [1]. Unfortunately, > > it only works with C11. See attached .c file and output below. > > Hmph. I doubt

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

2025-07-16 Thread Tom Lane
David Rowley writes: > On Thu, 17 Jul 2025 at 02:56, Tom Lane wrote: >> Looking again at the code for ereport_domain(), I wondered if >> something like this would help MSVC see through it: > I tried this and it unfortunately doesn't fix the issue. I didn't have huge hopes for that, but thanks f

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

2025-07-16 Thread David Rowley
On Thu, 17 Jul 2025 at 02:56, Tom Lane wrote: > Looking again at the code for ereport_domain(), I wondered if > something like this would help MSVC see through it: > > #define ereport_domain(elevel, domain, ...)\ > do { \ > const int elevel_ = (elevel); \ > + const bool is_e

pgsql: Fix inconsistent LWLock tranche names for MultiXact*

2025-07-16 Thread Michael Paquier
Fix inconsistent LWLock tranche names for MultiXact* The terms used in wait_event_names.txt and lwlock.c were inconsistent for MultiXactOffsetSLRU and MultiXactMemberSLRU, which could cause joins between pg_wait_events and pg_stat_activity to fail. lwlock.c is adjusted in this commit to what the

pgsql: Fix inconsistent LWLock tranche names for MultiXact*

2025-07-16 Thread Michael Paquier
Fix inconsistent LWLock tranche names for MultiXact* The terms used in wait_event_names.txt and lwlock.c were inconsistent for MultiXactOffsetSLRU and MultiXactMemberSLRU, which could cause joins between pg_wait_events and pg_stat_activity to fail. lwlock.c is adjusted in this commit to what the

pgsql: Fix inconsistent LWLock tranche names for MultiXact*

2025-07-16 Thread Michael Paquier
Fix inconsistent LWLock tranche names for MultiXact* The terms used in wait_event_names.txt and lwlock.c were inconsistent for MultiXactOffsetSLRU and MultiXactMemberSLRU, which could cause joins between pg_wait_events and pg_stat_activity to fail. lwlock.c is adjusted in this commit to what the

pgsql: doc: Add example file for COPY

2025-07-16 Thread Daniel Gustafsson
doc: Add example file for COPY The paragraph for introducing INSERT and COPY discussed how a file could be used for bulk loading with COPY, without actually showing what the file would look like. This adds a programlisting for the file contents. Backpatch to all supported branches since this exa

pgsql: doc: Add example file for COPY

2025-07-16 Thread Daniel Gustafsson
doc: Add example file for COPY The paragraph for introducing INSERT and COPY discussed how a file could be used for bulk loading with COPY, without actually showing what the file would look like. This adds a programlisting for the file contents. Backpatch to all supported branches since this exa

pgsql: doc: Add example file for COPY

2025-07-16 Thread Daniel Gustafsson
doc: Add example file for COPY The paragraph for introducing INSERT and COPY discussed how a file could be used for bulk loading with COPY, without actually showing what the file would look like. This adds a programlisting for the file contents. Backpatch to all supported branches since this exa

pgsql: doc: Add example file for COPY

2025-07-16 Thread Daniel Gustafsson
doc: Add example file for COPY The paragraph for introducing INSERT and COPY discussed how a file could be used for bulk loading with COPY, without actually showing what the file would look like. This adds a programlisting for the file contents. Backpatch to all supported branches since this exa

pgsql: doc: Add example file for COPY

2025-07-16 Thread Daniel Gustafsson
doc: Add example file for COPY The paragraph for introducing INSERT and COPY discussed how a file could be used for bulk loading with COPY, without actually showing what the file would look like. This adds a programlisting for the file contents. Backpatch to all supported branches since this exa

pgsql: doc: Add example file for COPY

2025-07-16 Thread Daniel Gustafsson
doc: Add example file for COPY The paragraph for introducing INSERT and COPY discussed how a file could be used for bulk loading with COPY, without actually showing what the file would look like. This adds a programlisting for the file contents. Backpatch to all supported branches since this exa

pgsql: doc: Add example file for COPY

2025-07-16 Thread Daniel Gustafsson
doc: Add example file for COPY The paragraph for introducing INSERT and COPY discussed how a file could be used for bulk loading with COPY, without actually showing what the file would look like. This adds a programlisting for the file contents. Backpatch to all supported branches since this exa

pgsql: Force LC_COLLATE to C in postmaster.

2025-07-16 Thread Jeff Davis
Force LC_COLLATE to C in postmaster. Avoid dependence on setlocale(). strcoll(), etc., are not called directly; all collation-sensitive calls should go through pg_locale.c and use the appropriate provider. By setting LC_COLLATE to C, we avoid accidentally depending on libc behavior when using a d

pgsql: Fix dumping of comments on invalid constraints on domains

2025-07-16 Thread Álvaro Herrera
Fix dumping of comments on invalid constraints on domains We skip dumping constraints together with domains if they are invalid ('separate') so that they appear after data -- but their comments were dumped together with the domain definition, which in effect leads to the comment being dumped when

pgsql: Fix dumping of comments on invalid constraints on domains

2025-07-16 Thread Álvaro Herrera
Fix dumping of comments on invalid constraints on domains We skip dumping constraints together with domains if they are invalid ('separate') so that they appear after data -- but their comments were dumped together with the domain definition, which in effect leads to the comment being dumped when

pgsql: Fix dumping of comments on invalid constraints on domains

2025-07-16 Thread Álvaro Herrera
Fix dumping of comments on invalid constraints on domains We skip dumping constraints together with domains if they are invalid ('separate') so that they appear after data -- but their comments were dumped together with the domain definition, which in effect leads to the comment being dumped when

pgsql: Fix dumping of comments on invalid constraints on domains

2025-07-16 Thread Álvaro Herrera
Fix dumping of comments on invalid constraints on domains We skip dumping constraints together with domains if they are invalid ('separate') so that they appear after data -- but their comments were dumped together with the domain definition, which in effect leads to the comment being dumped when

pgsql: Fix dumping of comments on invalid constraints on domains

2025-07-16 Thread Álvaro Herrera
Fix dumping of comments on invalid constraints on domains We skip dumping constraints together with domains if they are invalid ('separate') so that they appear after data -- but their comments were dumped together with the domain definition, which in effect leads to the comment being dumped when

pgsql: Fix dumping of comments on invalid constraints on domains

2025-07-16 Thread Álvaro Herrera
Fix dumping of comments on invalid constraints on domains We skip dumping constraints together with domains if they are invalid ('separate') so that they appear after data -- but their comments were dumped together with the domain definition, which in effect leads to the comment being dumped when

pgsql: Fix dumping of comments on invalid constraints on domains

2025-07-16 Thread Álvaro Herrera
Fix dumping of comments on invalid constraints on domains We skip dumping constraints together with domains if they are invalid ('separate') so that they appear after data -- but their comments were dumped together with the domain definition, which in effect leads to the comment being dumped when

pgsql: nbtree: Use only one notnullkey ScanKeyData.

2025-07-16 Thread Peter Geoghegan
nbtree: Use only one notnullkey ScanKeyData. _bt_first need only store one ScanKeyData struct on the stack for the purposes of building an IS NOT NULL key based on an implied NOT NULL constraint. We don't need INDEX_MAX_KEYS-many ScanKeyData structs. This saves us a little over 2KB in stack spac

pgsql: pg_dumpall: Skip global objects with --statistics-only or --no-s

2025-07-16 Thread Jeff Davis
pg_dumpall: Skip global objects with --statistics-only or --no-schema. Previously, pg_dumpall would still dump global objects such as roles and tablespaces even when --statistics-only or --no-schema was specified. Since these global objects are treated as schema-level data, they should be skipped

pgsql: pg_dumpall: Skip global objects with --statistics-only or --no-s

2025-07-16 Thread Jeff Davis
pg_dumpall: Skip global objects with --statistics-only or --no-schema. Previously, pg_dumpall would still dump global objects such as roles and tablespaces even when --statistics-only or --no-schema was specified. Since these global objects are treated as schema-level data, they should be skipped

pgsql: psql: Fix note on project naming in output of \copyright.

2025-07-16 Thread Nathan Bossart
psql: Fix note on project naming in output of \copyright. This adjusts the wording to match the changes in commits 5987553fde, a233a603ba, and pgweb commit 2d764dbc08. Reviewed-by: Tom Lane Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/aHVo791guQR6uqwT%40nathan Backpatch-throug

pgsql: psql: Fix note on project naming in output of \copyright.

2025-07-16 Thread Nathan Bossart
psql: Fix note on project naming in output of \copyright. This adjusts the wording to match the changes in commits 5987553fde, a233a603ba, and pgweb commit 2d764dbc08. Reviewed-by: Tom Lane Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/aHVo791guQR6uqwT%40nathan Backpatch-throug

pgsql: psql: Fix note on project naming in output of \copyright.

2025-07-16 Thread Nathan Bossart
psql: Fix note on project naming in output of \copyright. This adjusts the wording to match the changes in commits 5987553fde, a233a603ba, and pgweb commit 2d764dbc08. Reviewed-by: Tom Lane Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/aHVo791guQR6uqwT%40nathan Backpatch-throug

pgsql: psql: Fix note on project naming in output of \copyright.

2025-07-16 Thread Nathan Bossart
psql: Fix note on project naming in output of \copyright. This adjusts the wording to match the changes in commits 5987553fde, a233a603ba, and pgweb commit 2d764dbc08. Reviewed-by: Tom Lane Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/aHVo791guQR6uqwT%40nathan Backpatch-throug

pgsql: psql: Fix note on project naming in output of \copyright.

2025-07-16 Thread Nathan Bossart
psql: Fix note on project naming in output of \copyright. This adjusts the wording to match the changes in commits 5987553fde, a233a603ba, and pgweb commit 2d764dbc08. Reviewed-by: Tom Lane Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/aHVo791guQR6uqwT%40nathan Backpatch-throug

pgsql: psql: Fix note on project naming in output of \copyright.

2025-07-16 Thread Nathan Bossart
psql: Fix note on project naming in output of \copyright. This adjusts the wording to match the changes in commits 5987553fde, a233a603ba, and pgweb commit 2d764dbc08. Reviewed-by: Tom Lane Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/aHVo791guQR6uqwT%40nathan Backpatch-throug

pgsql: psql: Fix note on project naming in output of \copyright.

2025-07-16 Thread Nathan Bossart
psql: Fix note on project naming in output of \copyright. This adjusts the wording to match the changes in commits 5987553fde, a233a603ba, and pgweb commit 2d764dbc08. Reviewed-by: Tom Lane Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/aHVo791guQR6uqwT%40nathan Backpatch-throug

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

2025-07-16 Thread Tom Lane
[ this thread was referenced recently, bringing it back top-of-mind ] David Rowley writes: > On Thu, 13 Mar 2025 at 21:33, Peter Eisentraut wrote: >> Is there a way to reshuffle those conditionals to make this actually do >> something useful on MSVC? > I've just been experimenting with this and