diff options
Diffstat (limited to 'src/backend/commands/indexcmds.c')
-rw-r--r-- | src/backend/commands/indexcmds.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 9afd10ec4e3..ea3967b7c28 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -26,6 +26,7 @@ #include "catalog/index.h" #include "catalog/indexing.h" #include "catalog/pg_am.h" +#include "catalog/pg_collation.h" #include "catalog/pg_constraint.h" #include "catalog/pg_database.h" #include "catalog/pg_inherits.h" @@ -352,10 +353,12 @@ static bool CompareOpclassOptions(Datum *opts1, Datum *opts2, int natts) { int i; + FmgrInfo fm; if (!opts1 && !opts2) return true; + fmgr_info(F_ARRAY_EQ, &fm); for (i = 0; i < natts; i++) { Datum opt1 = opts1 ? opts1[i] : (Datum) 0; @@ -371,8 +374,12 @@ CompareOpclassOptions(Datum *opts1, Datum *opts2, int natts) else if (opt2 == (Datum) 0) return false; - /* Compare non-NULL text[] datums. */ - if (!DatumGetBool(DirectFunctionCall2(array_eq, opt1, opt2))) + /* + * Compare non-NULL text[] datums. Use C collation to enforce binary + * equivalence of texts, because we don't know anything about the + * semantics of opclass options. + */ + if (!DatumGetBool(FunctionCall2Coll(&fm, C_COLLATION_OID, opt1, opt2))) return false; } |