pgsql: Make CREATE TABLE LIKE copy comments on NOT NULL constraints whe

2025-06-26 Thread Fujii Masao
Make CREATE TABLE LIKE copy comments on NOT NULL constraints when requested.

Commit 14e87ffa5c5 introduced support for adding comments to NOT NULL
constraints. However, CREATE TABLE LIKE INCLUDING COMMENTS did not copy
these comments to the new table. This was an oversight in that commit.

This commit corrects the behavior by ensuring CREATE TABLE LIKE to also copy
the comments on NOT NULL constraints when INCLUDING COMMENTS is specified.

Author: Jian He 
Co-authored-by: Álvaro Herrera 
Reviewed-by: Fujii Masao 
Discussion: 
https://postgr.es/m/127debef-e558-4784-9e24-0d5eaf91e...@oss.nttdata.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/81ce602d48e8b9cbc3c3a7d5b9d9ddbea7789c02

Modified Files
--
src/backend/parser/parse_utilcmd.c  | 22 ++
src/test/regress/expected/create_table_like.out | 30 +
src/test/regress/sql/create_table_like.sql  | 16 +++--
3 files changed, 62 insertions(+), 6 deletions(-)



pgsql: Fix typo in comment

2025-06-26 Thread Álvaro Herrera
Fix typo in comment

Introduced by c2da1a5d6325

Reported-by: Michael Paquier 
Discussion: https://postgr.es/m/aft4qerwrv-3q...@paquier.xyz

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/a3994ec6acb27545300ce1e336e4d119d8000ba9

Modified Files
--
contrib/pg_stat_statements/pg_stat_statements.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)



pgsql: pg_dump: include comments on valid not-null constraints, too

2025-06-26 Thread Álvaro Herrera
pg_dump: include comments on valid not-null constraints, too

We were missing collecting comments for not-null constraints that are
dumped inline with the table definition (i.e., valid ones), because they
aren't represented by a separately dumpable object.  Fix by creating
separate TocEntries for the comments.

Co-Authored-By: Jian He 
Co-Authored-By: Álvaro Herrera 
Reported-By: Fujii Masao 
Reviewed-By: Fujii Masao 
Discussion: 
https://postgr.es/m/d50ff977-c728-4e9e-8488-fc2688e08...@oss.nttdata.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/47fb87563bf3cca2244840241dde2eb93830559b

Modified Files
--
doc/src/sgml/ref/pg_dump.sgml |  2 +-
src/bin/pg_dump/pg_dump.c | 92 +++
src/bin/pg_dump/pg_dump.h |  1 +
src/bin/pg_dump/t/002_pg_dump.pl  | 32 ++-
src/test/regress/expected/constraints.out |  2 +
src/test/regress/sql/constraints.sql  |  3 +
6 files changed, 118 insertions(+), 14 deletions(-)



pgsql: Simplify vacuum VM update logging counters

2025-06-26 Thread Melanie Plageman
Simplify vacuum VM update logging counters

We can simplify the VM counters added in dc6acfd910b8 to
lazy_vacuum_heap_page() and lazy_scan_new_or_empty().

We won't invoke lazy_vacuum_heap_page() unless there are dead line
pointers, so we know the page can't be all-visible.

In lazy_scan_new_or_empty(), we only update the VM if the page-level
hint PD_ALL_VISIBLE is clear, and the VM bit cannot be set if the page
level bit is clear because a subsequent page update would fail to clear
the visibility map bit.

Simplify the logic for determining which log counters to increment based
on this knowledge. Doing so is worthwhile because the old logic was
confusing and misguided.

Author: Melanie Plageman 
Reviewed-by: Nazir Bilal Yavuz 
Reviewed-by: Masahiko Sawada 
Discussion: 
https://postgr.es/m/flat/CAAKRu_a9w_n2mwY%3DG4LjfWTvRTJtjbfvnYAKi4WjO8QXHHrA0g%40mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/060f420a03a8d8186423e7d64302b72e01365c20

Modified Files
--
src/backend/access/heap/vacuumlazy.c | 53 +++-
1 file changed, 16 insertions(+), 37 deletions(-)



pgsql: Remove unused check in heap_xlog_insert()

2025-06-26 Thread Melanie Plageman
Remove unused check in heap_xlog_insert()

8e03eb92e9a reverted the commit 39b66a91bd which allowed freezing
in the heap_insert() code path but forgot to remove the corresponding
check in heap_xlog_insert(). This code is extraneous but not harmful.
However, cleaning it up makes it very clear that, as of now, we do not
support any freezing of pages in the heap_insert() path.

Author: Melanie Plageman 
Reviewed-by: Tomas Vondra 
Discussion: 
https://postgr.es/m/flat/CAAKRu_Zp4Pi-t51OFWm1YZ-cctDfBhHCMZ%3DEx6PKxv0o8y2GvA%40mail.gmail.com
Backpatch-through: 14

Branch
--
REL_17_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/40c9b4d8dafc7e573df1f783d22be292a0ed323b

Modified Files
--
src/backend/access/heap/heapam.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)



pgsql: Remove unused check in heap_xlog_insert()

2025-06-26 Thread Melanie Plageman
Remove unused check in heap_xlog_insert()

8e03eb92e9a reverted the commit 39b66a91bd which allowed freezing
in the heap_insert() code path but forgot to remove the corresponding
check in heap_xlog_insert(). This code is extraneous but not harmful.
However, cleaning it up makes it very clear that, as of now, we do not
support any freezing of pages in the heap_insert() path.

Author: Melanie Plageman 
Reviewed-by: Tomas Vondra 
Discussion: 
https://postgr.es/m/flat/CAAKRu_Zp4Pi-t51OFWm1YZ-cctDfBhHCMZ%3DEx6PKxv0o8y2GvA%40mail.gmail.com
Backpatch-through: 14

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/98dd121fc8fce85da3ad20382fe3deb1586f9cb1

Modified Files
--
src/backend/access/heap/heapam.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)



pgsql: Remove unused check in heap_xlog_insert()

2025-06-26 Thread Melanie Plageman
Remove unused check in heap_xlog_insert()

8e03eb92e9a reverted the commit 39b66a91bd which allowed freezing
in the heap_insert() code path but forgot to remove the corresponding
check in heap_xlog_insert(). This code is extraneous but not harmful.
However, cleaning it up makes it very clear that, as of now, we do not
support any freezing of pages in the heap_insert() path.

Author: Melanie Plageman 
Reviewed-by: Tomas Vondra 
Discussion: 
https://postgr.es/m/flat/CAAKRu_Zp4Pi-t51OFWm1YZ-cctDfBhHCMZ%3DEx6PKxv0o8y2GvA%40mail.gmail.com
Backpatch-through: 14

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/483f7246f39b3af250fed1e613d962b85b568861

Modified Files
--
src/backend/access/heap/heapam_xlog.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)



pgsql: Remove unused check in heap_xlog_insert()

2025-06-26 Thread Melanie Plageman
Remove unused check in heap_xlog_insert()

8e03eb92e9a reverted the commit 39b66a91bd which allowed freezing
in the heap_insert() code path but forgot to remove the corresponding
check in heap_xlog_insert(). This code is extraneous but not harmful.
However, cleaning it up makes it very clear that, as of now, we do not
support any freezing of pages in the heap_insert() path.

Author: Melanie Plageman 
Reviewed-by: Tomas Vondra 
Discussion: 
https://postgr.es/m/flat/CAAKRu_Zp4Pi-t51OFWm1YZ-cctDfBhHCMZ%3DEx6PKxv0o8y2GvA%40mail.gmail.com
Backpatch-through: 14

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/5a24c20c8442168fd75ff878eb6f99026a31b58b

Modified Files
--
src/backend/access/heap/heapam.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)



pgsql: Remove unused check in heap_xlog_insert()

2025-06-26 Thread Melanie Plageman
Remove unused check in heap_xlog_insert()

8e03eb92e9a reverted the commit 39b66a91bd which allowed freezing
in the heap_insert() code path but forgot to remove the corresponding
check in heap_xlog_insert(). This code is extraneous but not harmful.
However, cleaning it up makes it very clear that, as of now, we do not
support any freezing of pages in the heap_insert() path.

Author: Melanie Plageman 
Reviewed-by: Tomas Vondra 
Discussion: 
https://postgr.es/m/flat/CAAKRu_Zp4Pi-t51OFWm1YZ-cctDfBhHCMZ%3DEx6PKxv0o8y2GvA%40mail.gmail.com
Backpatch-through: 14

Branch
--
REL_16_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/13a449fc5d4896452958fd4aa5b007aa24c0287f

Modified Files
--
src/backend/access/heap/heapam.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)



pgsql: Correct list of files in src/backend/lib/README

2025-06-26 Thread Michael Paquier
Correct list of files in src/backend/lib/README

binaryheap.c and stringinfo.c have been moved to src/common/ by
respectively 5af0263afd7b and 26aaf97b683d, and the README patched here
still mentioned these two files as available in src/backend/lib/.

Author: Aleksander Alekseev 
Discussion: 
https://postgr.es/m/CAJ7c6TPg-=tc+fzq0tgttml7r79-awecmpwayqigu0n+skg...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/94e2e150ec72a3b37e3847be99c4aca3320c38f9

Modified Files
--
src/backend/lib/README | 4 
1 file changed, 4 deletions(-)



pgsql: doc: Updates for RETURNING OLD/NEW.

2025-06-26 Thread Dean Rasheed
doc: Updates for RETURNING OLD/NEW.

Fix a couple of sentences in the documentation that were missed in
commit 80feb727c8.

Author: Dean Rasheed 
Reviewed-by: Robert Treat 
Discussion: 
https://postgr.es/m/caezatcucqadjuapzsjpf2b6hfj6agouwefrvh8ht3uzoqqw...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/3ba9639e39ed8cf2d9dd30f6b8a3b3e9fffb9a64

Modified Files
--
doc/src/sgml/ref/merge.sgml  | 7 ---
doc/src/sgml/ref/update.sgml | 3 ++-
2 files changed, 6 insertions(+), 4 deletions(-)



pgsql: doc: Fix indentation of MERGE synopsis.

2025-06-26 Thread Dean Rasheed
doc: Fix indentation of MERGE synopsis.

The convention in the documentation for other SQL commands is to
indent continuation lines and sub-clauses in the "Synopsis" section by
4 spaces, so do the same for MERGE.

Author: Dean Rasheed 
Reviewed-by: Nathan Bossart 
Discussion: 
https://postgr.es/m/caezatcv+9tr9+wm-sccdbez3x7wvxupadd5jx9wegx97z4l...@mail.gmail.com
Backpatch-through: 15

Branch
--
REL_17_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/457f1a92034b657bd0b5a2b739dfb4a7f0e1b03e

Modified Files
--
doc/src/sgml/ref/merge.sgml | 30 +++---
1 file changed, 15 insertions(+), 15 deletions(-)



pgsql: doc: Fix indentation of MERGE synopsis.

2025-06-26 Thread Dean Rasheed
doc: Fix indentation of MERGE synopsis.

The convention in the documentation for other SQL commands is to
indent continuation lines and sub-clauses in the "Synopsis" section by
4 spaces, so do the same for MERGE.

Author: Dean Rasheed 
Reviewed-by: Nathan Bossart 
Discussion: 
https://postgr.es/m/caezatcv+9tr9+wm-sccdbez3x7wvxupadd5jx9wegx97z4l...@mail.gmail.com
Backpatch-through: 15

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/eca624c6591be14a1a03f0b2d374043cdf276431

Modified Files
--
doc/src/sgml/ref/merge.sgml | 32 
1 file changed, 16 insertions(+), 16 deletions(-)



pgsql: doc: Fix indentation of MERGE synopsis.

2025-06-26 Thread Dean Rasheed
doc: Fix indentation of MERGE synopsis.

The convention in the documentation for other SQL commands is to
indent continuation lines and sub-clauses in the "Synopsis" section by
4 spaces, so do the same for MERGE.

Author: Dean Rasheed 
Reviewed-by: Nathan Bossart 
Discussion: 
https://postgr.es/m/caezatcv+9tr9+wm-sccdbez3x7wvxupadd5jx9wegx97z4l...@mail.gmail.com
Backpatch-through: 15

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/ba33505c5fe47d793aeec25b1b321b6d39dec8fb

Modified Files
--
doc/src/sgml/ref/merge.sgml | 26 +-
1 file changed, 13 insertions(+), 13 deletions(-)



pgsql: doc: Fix indentation of MERGE synopsis.

2025-06-26 Thread Dean Rasheed
doc: Fix indentation of MERGE synopsis.

The convention in the documentation for other SQL commands is to
indent continuation lines and sub-clauses in the "Synopsis" section by
4 spaces, so do the same for MERGE.

Author: Dean Rasheed 
Reviewed-by: Nathan Bossart 
Discussion: 
https://postgr.es/m/caezatcv+9tr9+wm-sccdbez3x7wvxupadd5jx9wegx97z4l...@mail.gmail.com
Backpatch-through: 15

Branch
--
REL_16_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/5d4033a066151c41939b8dc92a3301e385aaffcc

Modified Files
--
doc/src/sgml/ref/merge.sgml | 26 +-
1 file changed, 13 insertions(+), 13 deletions(-)



pgsql: docs: fix typo

2025-06-26 Thread Álvaro Herrera
docs: fix typo

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/48c80aba7538d7c515d0c89f4d11f88974fee851

Modified Files
--
doc/src/sgml/ref/pg_dump.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgsql: Correct misleading error messages

2025-06-26 Thread Peter Eisentraut
Correct misleading error messages

Commit 7d6d2c4bbd7 dropped opcintype from the index AM strategy
translation API.  But some error messages about failed lookups still
mentioned it, even though it was not used for the lookup.  Fix by
removing ipcintype from the error messages as well.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/95e12d4d9b228855af8a2a34ca28c33924d4edd1

Modified Files
--
src/backend/commands/indexcmds.c | 4 ++--
src/backend/commands/tablecmds.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)



pgsql: libpq: Message style improvements

2025-06-26 Thread Peter Eisentraut
libpq: Message style improvements

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/7fb3c38e7d7d12a742e1e7600879570251e1886a

Modified Files
--
src/interfaces/libpq/fe-connect.c| 2 +-
src/interfaces/libpq/fe-protocol3.c  | 7 ---
src/interfaces/libpq/fe-secure-openssl.c | 4 ++--
3 files changed, 7 insertions(+), 6 deletions(-)