aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2024-04-10 01:47:00 +0300
committerAlexander Korotkov <akorotkov@postgresql.org>2024-04-10 01:47:21 +0300
commitc99ef1811a064a94fb78917f35bb5853059a92b7 (patch)
tree7cfcc33973cd34cdd4b6ead434415cd0059163ef /src/backend/commands/tablecmds.c
parentb1b13d2b524e64e3bf3538441366bdc8f6d3beda (diff)
downloadpostgresql-c99ef1811a064a94fb78917f35bb5853059a92b7.tar.gz
postgresql-c99ef1811a064a94fb78917f35bb5853059a92b7.zip
Checks for ALTER TABLE ... SPLIT/MERGE PARTITIONS ... commands
Check that the target partition actually belongs to the parent table. Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/cd842601-cf1a-9806-f7b7-d2509b93ba61%40gmail.com Author: Dmitry Koval
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 865c6331c1f..8a98a0af482 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -21223,12 +21223,6 @@ ATExecSplitPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
*/
splitRel = table_openrv(cmd->name, AccessExclusiveLock);
- if (splitRel->rd_rel->relkind != RELKIND_RELATION)
- ereport(ERROR,
- (errcode(ERRCODE_WRONG_OBJECT_TYPE),
- errmsg("cannot split non-table partition \"%s\"",
- RelationGetRelationName(splitRel))));
-
splitRelOid = RelationGetRelid(splitRel);
/* Check descriptions of new partitions. */
@@ -21463,12 +21457,6 @@ ATExecMergePartitions(List **wqueue, AlteredTableInfo *tab, Relation rel,
*/
mergingPartition = table_openrv(name, AccessExclusiveLock);
- if (mergingPartition->rd_rel->relkind != RELKIND_RELATION)
- ereport(ERROR,
- (errcode(ERRCODE_WRONG_OBJECT_TYPE),
- errmsg("cannot merge non-table partition \"%s\"",
- RelationGetRelationName(mergingPartition))));
-
/*
* Checking that two partitions have the same name was before, in
* function transformPartitionCmdForMerge().