aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_utilcmd.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-03-19 10:39:06 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-03-19 10:39:06 +0100
commit190dc27998d5b7b4c36e12bebe62f7176f4b4507 (patch)
tree96f02ac2e228921a47a7955cfe5c823ff5b649d9 /src/backend/parser/parse_utilcmd.c
parent4f7f7b0375854e2f89876473405a8f21c95012af (diff)
downloadpostgresql-190dc27998d5b7b4c36e12bebe62f7176f4b4507.tar.gz
postgresql-190dc27998d5b7b4c36e12bebe62f7176f4b4507.zip
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
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
-rw-r--r--src/backend/parser/parse_utilcmd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index abbe1bb45a3..896a7f2c59b 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -2486,11 +2486,10 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt)
parser_errposition(cxt->pstate, constraint->location)));
/*
- * Insist on it being a btree. That's the only kind that supports
- * uniqueness at the moment anyway; but we must have an index that
- * exactly matches what you'd get from plain ADD CONSTRAINT syntax,
- * else dump and reload will produce a different index (breaking
- * pg_upgrade in particular).
+ * Insist on it being a btree. We must have an index that exactly
+ * matches what you'd get from plain ADD CONSTRAINT syntax, else dump
+ * and reload will produce a different index (breaking pg_upgrade in
+ * particular).
*/
if (index_rel->rd_rel->relam != get_index_am_oid(DEFAULT_INDEX_TYPE, false))
ereport(ERROR,