public inbox for [email protected]  
help / color / mirror / Atom feed
pgsql: Don't create SPLIT/MERGE partitions as internal relations
2+ messages / 1 participants
[nested] [flat]

* pgsql: Don't create SPLIT/MERGE partitions as internal relations
@ 2026-07-08 23:42 Alexander Korotkov <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Alexander Korotkov @ 2026-07-08 23:42 UTC (permalink / raw)
  To: [email protected]

Don't create SPLIT/MERGE partitions as internal relations

The new partitions built for ALTER TABLE ... SPLIT PARTITION and
ALTER TABLE ... MERGE PARTITIONS are created at the explicit request of
the user, just like a plain CREATE TABLE.  createPartitionTable() passes
is_internal=true to heap_create_with_catalog(), while createTableConstraints()
does the same to StoreAttrDefault() and AddRelationNewConstraints().
Pass is_internal=false in all these places instead, so that object-access
hooks treat them as user-requested objects.  The is_internal flag is intended
for objects created as internal implementation details, such as a transient
heap built during CLUSTER.

While at it, pass 0 rather than PERFORM_DELETION_INTERNAL to the
performDeletionCheck() calls that pre-check the drop eligibility of the
old partitions, to match the subsequent performDeletion().  The flag has
no functional effect on performDeletionCheck(), but change this for code
consistency.

Reported-by: Noah Misch <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/881033ae8b55dbd22f7ee9c26991b6c4e67d6bd5

Modified Files
--------------
src/backend/commands/tablecmds.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)



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

* pgsql: Don't create SPLIT/MERGE partitions as internal relations
@ 2026-07-08 23:42 Alexander Korotkov <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Alexander Korotkov @ 2026-07-08 23:42 UTC (permalink / raw)
  To: [email protected]

Don't create SPLIT/MERGE partitions as internal relations

The new partitions built for ALTER TABLE ... SPLIT PARTITION and
ALTER TABLE ... MERGE PARTITIONS are created at the explicit request of
the user, just like a plain CREATE TABLE.  createPartitionTable() passes
is_internal=true to heap_create_with_catalog(), while createTableConstraints()
does the same to StoreAttrDefault() and AddRelationNewConstraints().
Pass is_internal=false in all these places instead, so that object-access
hooks treat them as user-requested objects.  The is_internal flag is intended
for objects created as internal implementation details, such as a transient
heap built during CLUSTER.

While at it, pass 0 rather than PERFORM_DELETION_INTERNAL to the
performDeletionCheck() calls that pre-check the drop eligibility of the
old partitions, to match the subsequent performDeletion().  The flag has
no functional effect on performDeletionCheck(), but change this for code
consistency.

Reported-by: Noah Misch <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6120d01c9f5c985c5154d226181295137e57c552

Modified Files
--------------
src/backend/commands/tablecmds.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)



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


end of thread, other threads:[~2026-07-08 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-07-08 23:42 pgsql: Don't create SPLIT/MERGE partitions as internal relations Alexander Korotkov <[email protected]>
2026-07-08 23:42 pgsql: Don't create SPLIT/MERGE partitions as internal relations Alexander Korotkov <[email protected]>

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