pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix dependency of partitioned table and table AM with CREATE TAB
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix dependency of partitioned table and table AM with CREATE TAB
@ 2024-10-28 23:42  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2024-10-28 23:42 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix dependency of partitioned table and table AM with CREATE TABLE .. USING

A pg_depend entry between a partitioned table and its table access
method was missing when using CREATE TABLE .. USING with an unpinned
access method.  DROP ACCESS METHOD could be used, while it should be
blocked if CASCADE is not specified, even if there was a partitioned
table that depends on the table access method.  pg_class.relam would
then hold an orphaned OID value still pointing to the AM dropped.

The problem is fixed by adding a dependency between the partitioned
table and its table access method if set when the relation is created.
A test checking the contents of pg_depend in this case is added.

Issue introduced in 374c7a229042, that has added support for CREATE
TABLE .. USING for partitioned tables.

Reviewed-by: Alexander Lakhin
Discussion: https://postgr.es/m/18674-1ef01eceec278fab@postgresql.org
Backpatch-through: 17

Branch
------
REL_17_STABLE

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

Modified Files
--------------
src/backend/catalog/heap.c              |  6 ++++--
src/test/regress/expected/create_am.out | 14 ++++++++++++++
src/test/regress/sql/create_am.sql      | 10 ++++++++++
3 files changed, 28 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix dependency of partitioned table and table AM with CREATE TAB
@ 2024-10-28 23:42  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2024-10-28 23:42 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix dependency of partitioned table and table AM with CREATE TABLE .. USING

A pg_depend entry between a partitioned table and its table access
method was missing when using CREATE TABLE .. USING with an unpinned
access method.  DROP ACCESS METHOD could be used, while it should be
blocked if CASCADE is not specified, even if there was a partitioned
table that depends on the table access method.  pg_class.relam would
then hold an orphaned OID value still pointing to the AM dropped.

The problem is fixed by adding a dependency between the partitioned
table and its table access method if set when the relation is created.
A test checking the contents of pg_depend in this case is added.

Issue introduced in 374c7a229042, that has added support for CREATE
TABLE .. USING for partitioned tables.

Reviewed-by: Alexander Lakhin
Discussion: https://postgr.es/m/18674-1ef01eceec278fab@postgresql.org
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/49a23441ca7f314c25794a9a547011c0a858cfaa

Modified Files
--------------
src/backend/catalog/heap.c              |  6 ++++--
src/test/regress/expected/create_am.out | 14 ++++++++++++++
src/test/regress/sql/create_am.sql      | 10 ++++++++++
3 files changed, 28 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-10-28 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-10-28 23:42 pgsql: Fix dependency of partitioned table and table AM with CREATE TAB Michael Paquier <michael@paquier.xyz>
2024-10-28 23:42 pgsql: Fix dependency of partitioned table and table AM with CREATE TAB Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox