postgresql/src
Alexander Korotkov 881033ae8b 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 <noah@leadboat.com>
Discussion: https://postgr.es/m/20260707185751.f9.noahmisch@microsoft.com
Backpatch-through: 19
2026-07-09 02:17:08 +03:00
..
backend Don't create SPLIT/MERGE partitions as internal relations 2026-07-09 02:17:08 +03:00
bin Remove sketchy TerminateThread() call on Ctrl-C on Windows 2026-07-08 18:45:09 +03:00
common unicode_case.c: change API to signal UTF8 decoding error. 2026-07-07 15:34:05 -07:00
fe_utils Add comment to describe the various frontend cancel methods 2026-07-06 19:11:04 +03:00
include Refactor how some aux processes advertise their ProcNumber 2026-07-08 20:33:36 +03:00
interfaces libpq: Drain all pending bytes from SSL/GSS during pqReadData() 2026-07-07 18:45:37 +03:00
makefiles Add CONCURRENTLY option to REPACK 2026-04-06 21:55:08 +02:00
pl Make PLy_elog() use pg_integer_constant_p(). 2026-07-06 13:48:42 -04:00
port Use C11 alignas instead of pg_attribute_aligned 2026-07-01 08:36:43 +02:00
template Switch the semaphore API on Solaris to unnamed POSIX. 2026-03-14 14:10:32 -04:00
test Remove the refint extension. 2026-07-08 16:22:12 -05:00
timezone Fix macro-redefinition warning introduced by aeb07c55f. 2026-07-01 13:44:45 -04:00
tools Fix qual pushdown past grouping with mismatched equivalence 2026-07-06 16:13:14 +09:00
tutorial Pre-beta mechanical code beautification, step 1: run pgindent. 2026-05-13 10:34:17 -04:00
.gitignore
DEVELOPERS
Makefile Add CONCURRENTLY option to REPACK 2026-04-06 21:55:08 +02:00
Makefile.global.in Update Unicode data to CLDR 48.2 2026-04-13 11:13:36 +02:00
Makefile.shlib Restore AIX support. 2026-02-23 13:34:22 -05:00
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00