aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/commands/indexcmds.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index cf7b264cd11..c6234326206 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1003,10 +1003,13 @@ DefineIndex(Oid relationId,
{
if (key->partattrs[i] == indexInfo->ii_IndexAttrNumbers[j])
{
- /* Matched the column, now what about the equality op? */
+ /* Matched the column, now what about the collation and equality op? */
Oid idx_opfamily;
Oid idx_opcintype;
+ if (key->partcollation[i] != collationObjectId[j])
+ continue;
+
if (get_opclass_opfamily_and_input_type(classObjectId[j],
&idx_opfamily,
&idx_opcintype))