Skip to content

Commit 190dc27

Browse files
committed
Update a code comment
The comment explained that ALTER TABLE ADD CONSTRAINT USING INDEX is only supported with a btree index. (This is not being changed.) The reason is to keep upgrades robust, as explained there. The other part of the comment, that btree is the only unique index kind anyway, is somewhat less true as we're trying to enable unique indexes other than btree, and it's irrelevant to this check. There is a check for indisunique earlier already. So just remove this part of the comment. Author: Mark Dilger <mark.dilger@enterprisedb.com> Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.com
1 parent 4f7f7b0 commit 190dc27

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/backend/parser/parse_utilcmd.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,11 +2486,10 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt)
24862486
parser_errposition(cxt->pstate, constraint->location)));
24872487

24882488
/*
2489-
* Insist on it being a btree. That's the only kind that supports
2490-
* uniqueness at the moment anyway; but we must have an index that
2491-
* exactly matches what you'd get from plain ADD CONSTRAINT syntax,
2492-
* else dump and reload will produce a different index (breaking
2493-
* pg_upgrade in particular).
2489+
* Insist on it being a btree. We must have an index that exactly
2490+
* matches what you'd get from plain ADD CONSTRAINT syntax, else dump
2491+
* and reload will produce a different index (breaking pg_upgrade in
2492+
* particular).
24942493
*/
24952494
if (index_rel->rd_rel->relam != get_index_am_oid(DEFAULT_INDEX_TYPE, false))
24962495
ereport(ERROR,

0 commit comments

Comments
 (0)