summaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 7557b49dd82..971a8721e1c 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -1751,6 +1751,14 @@ MergeAttributes(List *schema, List *supers, char relpersistence,
relation = heap_openrv(parent, AccessExclusiveLock);
/*
+ * Check for active uses of the parent partitioned table in the
+ * current transaction, such as being used in some manner by an
+ * enclosing command.
+ */
+ if (is_partition)
+ CheckTableNotInUse(relation, "CREATE TABLE .. PARTITION OF");
+
+ /*
* We do not allow partitioned tables and partitions to participate in
* regular inheritance.
*/