aboutsummaryrefslogtreecommitdiff
path: root/src/backend/catalog/pg_depend.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/catalog/pg_depend.c')
-rw-r--r--src/backend/catalog/pg_depend.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c
index 2ea05f350b3..c6f75c5aa8f 100644
--- a/src/backend/catalog/pg_depend.c
+++ b/src/backend/catalog/pg_depend.c
@@ -616,8 +616,8 @@ getOwnedSequence(Oid relid, AttrNumber attnum)
/*
* get_constraint_index
- * Given the OID of a unique or primary-key constraint, return the
- * OID of the underlying unique index.
+ * Given the OID of a unique, primary-key, or exclusion constraint,
+ * return the OID of the underlying index.
*
* Return InvalidOid if the index couldn't be found; this suggests the
* given OID is bogus, but we leave it to caller to decide what to do.
@@ -664,10 +664,13 @@ get_constraint_index(Oid constraintId)
{
char relkind = get_rel_relkind(deprec->objid);
- /* This is pure paranoia; there shouldn't be any such */
+ /*
+ * This is pure paranoia; there shouldn't be any other relkinds
+ * dependent on a constraint.
+ */
if (relkind != RELKIND_INDEX &&
relkind != RELKIND_PARTITIONED_INDEX)
- break;
+ continue;
indexId = deprec->objid;
break;
@@ -682,8 +685,9 @@ get_constraint_index(Oid constraintId)
/*
* get_index_constraint
- * Given the OID of an index, return the OID of the owning unique or
- * primary-key constraint, or InvalidOid if no such constraint.
+ * Given the OID of an index, return the OID of the owning unique,
+ * primary-key, or exclusion constraint, or InvalidOid if there
+ * is no owning constraint.
*/
Oid
get_index_constraint(Oid indexId)