pgsql: psql: fix order of join clauses when listing extensions

2025-06-05 Thread Magnus Hagander
psql: fix order of join clauses when listing extensions

Commit d696406a9b2 added a new join to the query for extensions, but did
so in the wrong place, causing the AND clause to be applied to the wrong
join.

Author: Suraj Kharage 
Reviewed-By: Dilip Kumar 
Discussion: 
https://postgr.es/m/CAF1DzPVBrN-cmPB2zb7ZU=2j4vef2fndargcg9w+9fnkq4v...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/112e40b867b3351ecc49b86a4fa07ec182b82e65

Modified Files
--
src/bin/psql/describe.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



pgsql: Doc: you must own the target object to use SECURITY LABEL.

2025-06-05 Thread Tom Lane
Doc: you must own the target object to use SECURITY LABEL.

For some reason this wasn't mentioned before.

Author: Patrick Stählin 
Reviewed-by: Tom Lane 
Discussion: https://postgr.es/m/931e012a-57ba-41ba-9b88-24323a46d...@packi.ch
Backpatch-through: 13

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/09498d2f2c739337f58a4412af9d425cfb3ac950

Modified Files
--
doc/src/sgml/ref/security_label.sgml | 4 
1 file changed, 4 insertions(+)



pgsql: Doc: you must own the target object to use SECURITY LABEL.

2025-06-05 Thread Tom Lane
Doc: you must own the target object to use SECURITY LABEL.

For some reason this wasn't mentioned before.

Author: Patrick Stählin 
Reviewed-by: Tom Lane 
Discussion: https://postgr.es/m/931e012a-57ba-41ba-9b88-24323a46d...@packi.ch
Backpatch-through: 13

Branch
--
REL_16_STABLE

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

Modified Files
--
doc/src/sgml/ref/security_label.sgml | 4 
1 file changed, 4 insertions(+)



pgsql: Doc: you must own the target object to use SECURITY LABEL.

2025-06-05 Thread Tom Lane
Doc: you must own the target object to use SECURITY LABEL.

For some reason this wasn't mentioned before.

Author: Patrick Stählin 
Reviewed-by: Tom Lane 
Discussion: https://postgr.es/m/931e012a-57ba-41ba-9b88-24323a46d...@packi.ch
Backpatch-through: 13

Branch
--
REL_17_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/767d38e2c0960658251c356fedbf15c52ecb8637

Modified Files
--
doc/src/sgml/ref/security_label.sgml | 4 
1 file changed, 4 insertions(+)



pgsql: Doc: you must own the target object to use SECURITY LABEL.

2025-06-05 Thread Tom Lane
Doc: you must own the target object to use SECURITY LABEL.

For some reason this wasn't mentioned before.

Author: Patrick Stählin 
Reviewed-by: Tom Lane 
Discussion: https://postgr.es/m/931e012a-57ba-41ba-9b88-24323a46d...@packi.ch
Backpatch-through: 13

Branch
--
REL_13_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/626b439e367d97f84901b12632976be157ddb696

Modified Files
--
doc/src/sgml/ref/security_label.sgml | 4 
1 file changed, 4 insertions(+)



pgsql: Doc: you must own the target object to use SECURITY LABEL.

2025-06-05 Thread Tom Lane
Doc: you must own the target object to use SECURITY LABEL.

For some reason this wasn't mentioned before.

Author: Patrick Stählin 
Reviewed-by: Tom Lane 
Discussion: https://postgr.es/m/931e012a-57ba-41ba-9b88-24323a46d...@packi.ch
Backpatch-through: 13

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/74637fb797778e7eec6f0c40f95680d21768

Modified Files
--
doc/src/sgml/ref/security_label.sgml | 4 
1 file changed, 4 insertions(+)



pgsql: Doc: you must own the target object to use SECURITY LABEL.

2025-06-05 Thread Tom Lane
Doc: you must own the target object to use SECURITY LABEL.

For some reason this wasn't mentioned before.

Author: Patrick Stählin 
Reviewed-by: Tom Lane 
Discussion: https://postgr.es/m/931e012a-57ba-41ba-9b88-24323a46d...@packi.ch
Backpatch-through: 13

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/04acad82b0f912e779795a4661f7d63f5e35b9da

Modified Files
--
doc/src/sgml/ref/security_label.sgml | 4 
1 file changed, 4 insertions(+)



pgsql: Avoid bogus scans of partitions when marking FKs enforced

2025-06-05 Thread Álvaro Herrera
Avoid bogus scans of partitions when marking FKs enforced

Similar to commit cc733ed164c5: when an unenforced foreign key that
references a partitioned table is altered to be enforced, we scan
the constrained table based on each partition on the referenced
partitioned table.  This is bogus and likely to cause the ALTER TABLE to
fail: we must only scan the constrained table as pointing to the
top-level partitioned table.  Oversight in commit eec0040c4bcd.  Fix by
eliding those scans.

Author: Amul Sul 
Reported-by: jian he 
Discussion: 
https://postgr.es/m/CACJufxF1e_gPOLtsDoaE4VCgQPC8KZW_kPAjPR5Rvv4Ew=f...@mail.gmail.com

Branch
--
master

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

Modified Files
--
src/backend/commands/tablecmds.c  |  7 --
src/test/regress/expected/foreign_key.out | 41 +++
src/test/regress/sql/foreign_key.sql  | 11 ++---
3 files changed, 37 insertions(+), 22 deletions(-)



pgsql: nbtree: Remove useless row compare arg.

2025-06-05 Thread Peter Geoghegan
nbtree: Remove useless row compare arg.

Use of a RowCompare key makes nbtree index scans ineligible to use
pstate.forcenonrequired following recent bugfix commit 5f4d98d4.
There's no longer any need for _bt_check_rowcompare to accept a
forcenonrequired argument, so remove it.

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/54c6ea8c81db718508eeea50991d3c1c5dff54a5

Modified Files
--
src/backend/access/nbtree/nbtutils.c | 25 +
1 file changed, 9 insertions(+), 16 deletions(-)



pgsql: Doc: improve description of which role runs a trigger.

2025-06-05 Thread Tom Lane
Doc: improve description of which role runs a trigger.

Refine wording from commit 01463e1cc.

Author: Noah Misch 
Reviewed-by: Tom Lane 
Discussion: https://postgr.es/m/20250605163441.2f.nmi...@google.com

Branch
--
master

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

Modified Files
--
doc/src/sgml/trigger.sgml | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)



pgsql: Change role names used in trigger test.

2025-06-05 Thread Tom Lane
Change role names used in trigger test.

The choices made in commit 01463e1cc might pose copyright hazards,
and are more cutesy than informative anyway.

Reported-by: Noah Misch 
Author: Tom Lane 
Discussion: https://postgr.es/m/20250415155850.9b.nmi...@google.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/4b05ebf0957bc796b9ea8f4d2ab5985714ef3252

Modified Files
--
src/test/regress/expected/triggers.out | 26 +-
src/test/regress/sql/triggers.sql  | 18 +-
2 files changed, 22 insertions(+), 22 deletions(-)



pgsql: Avoid bogus scans of partitions when validating FKs to partition

2025-06-05 Thread Álvaro Herrera
Avoid bogus scans of partitions when validating FKs to partitioned tables

Validating an unvalidated foreign key that references a partitioned
table would try to queue validations for each individual partition of
the referenced table, but this is wrong: each individual partition would
not necessarily have all the referenced rows, so errors would be raised.
Avoid doing that.  The pg_constraint rows that cause this to happen are
only there to support the action triggers that implement the DELETE/
UPDATE actions of the FK, so no validating scan is necessary.

This was an oversight in commit b663b9436e75.

An equivalent oversight exists for NOT ENFORCED constraints, which is
not fixed in this commit.

Author: Amul Sul 
Reported-by: Antonin Houska 
Reviewed-by: jian he 
Reviewed-by: Tender Wang 
Discussion: https://postgr.es/m/26983.1748418675@localhost

Branch
--
master

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

Modified Files
--
src/backend/commands/tablecmds.c  | 51 ---
src/test/regress/expected/foreign_key.out | 68 ---
src/test/regress/sql/foreign_key.sql  | 29 ++---
3 files changed, 114 insertions(+), 34 deletions(-)