Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit debe43d

Browse filesBrowse 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
Copy full SHA for debe43d

File tree

1 file changed

+4
-0
lines changed
Filter options

1 file changed

+4
-0
lines changed

‎init.sql

Copy file name to clipboardExpand all lines: init.sql
+4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.