Skip to content

Commit debe43d

Browse files
committed
Forbid to partition tables with children.
Since pathman doesn't check for children existence anyway and duplicates them. This doesn't explain 'attempted to update invisible tuple' in PGPRO-2507 though, but let's leave this for another time.
1 parent 0299398 commit debe43d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

init.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,10 @@ BEGIN
455455
RAISE EXCEPTION 'table "%" has already been partitioned', parent_relid;
456456
END IF;
457457

458+
IF EXISTS (SELECT 1 FROM pg_inherits WHERE inhparent = parent_relid) THEN
459+
RAISE EXCEPTION 'can''t partition table "%" with existing children', parent_relid;
460+
END IF;
461+
458462
/* Check if there are foreign keys that reference the relation */
459463
FOR constr_name IN (SELECT conname FROM pg_catalog.pg_constraint
460464
WHERE confrelid = parent_relid::REGCLASS::OID)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy