diff options
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
-rw-r--r-- | src/backend/parser/parse_utilcmd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index ee2d2b54a1d..973eab6ae2c 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -3698,8 +3698,16 @@ transformPartitionCmd(CreateStmtContext *cxt, PartitionCmd *cmd) cmd->bound); break; case RELKIND_PARTITIONED_INDEX: - /* nothing to check */ - Assert(cmd->bound == NULL); + + /* + * A partitioned index cannot have a partition bound set. ALTER + * INDEX prevents that with its grammar, but not ALTER TABLE. + */ + if (cmd->bound != NULL) + ereport(ERROR, + (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), + errmsg("\"%s\" is not a partitioned table", + RelationGetRelationName(parentRel)))); break; case RELKIND_RELATION: /* the table must be partitioned */ |