aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_utilcmd.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2020-03-03 13:56:11 +0900
committerMichael Paquier <michael@paquier.xyz>2020-03-03 13:56:11 +0900
commitdc8364824f80cf60f8d2f5a617b0470992e293dd (patch)
treeab4d90dc9cc8ea04bbaf368afea122b1e97cc67f /src/backend/parser/parse_utilcmd.c
parentf22feedc253502771533a48197050e6c5f9f5ab9 (diff)
downloadpostgresql-dc8364824f80cf60f8d2f5a617b0470992e293dd.tar.gz
postgresql-dc8364824f80cf60f8d2f5a617b0470992e293dd.zip
Fix assertion failure with ALTER TABLE ATTACH PARTITION and indexes
Using ALTER TABLE ATTACH PARTITION causes an assertion failure when attempting to work on a partitioned index, because partitioned indexes cannot have partition bounds. The grammar of ALTER TABLE ATTACH PARTITION requires partition bounds, but not ALTER INDEX, so mixing ALTER TABLE with partitioned indexes is confusing. Hence, on HEAD, prevent ALTER TABLE to attach a partition if the relation involved is a partitioned index. On back-branches, as applications may rely on the existing behavior, just remove the culprit assertion. Reported-by: Alexander Lakhin Author: Amit Langote, Michael Paquier Discussion: https://postgr.es/m/16276-5cd1dcc8fb8be7b5@postgresql.org Backpatch-through: 11
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
-rw-r--r--src/backend/parser/parse_utilcmd.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index 2406ca7a5d0..484ca40ddf4 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -3685,7 +3685,6 @@ transformPartitionCmd(CreateStmtContext *cxt, PartitionCmd *cmd)
break;
case RELKIND_PARTITIONED_INDEX:
/* nothing to check */
- Assert(cmd->bound == NULL);
break;
case RELKIND_RELATION:
/* the table must be partitioned */