Fix accidental use of = instead of ==
authorPeter Eisentraut <[email protected]>
Tue, 4 Mar 2025 08:45:01 +0000 (09:45 +0100)
committerPeter Eisentraut <[email protected]>
Tue, 4 Mar 2025 08:45:01 +0000 (09:45 +0100)
Fix for commit 630f9a43cec.  It used = instead of ==.  The result
would be an incorrect error message.

Author: Jacob Brazeal <[email protected]>
Reviewed-by: Michael Paquier <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/CA%2BCOZaC-JMbhQ4O0Q8V1Bxa0R%2BNex_RN9D6UyuLPiEx_CK4Heg%40mail.gmail.com

src/backend/commands/indexcmds.c

index c92f5620ec1f575d5068175dfdd1551e4b4c0f0b..32ff3ca9a28d510bae69dd26c1e196730c9c1a45 100644 (file)
@@ -2472,7 +2472,7 @@ GetOperatorFromCompareType(Oid opclass, Oid rhstype, CompareType cmptype,
        if (*strat == InvalidStrategy)
            ereport(ERROR,
                    errcode(ERRCODE_UNDEFINED_OBJECT),
-                   cmptype = COMPARE_EQ ? errmsg("could not identify an equality operator for type %s", format_type_be(opcintype)) :
+                   cmptype == COMPARE_EQ ? errmsg("could not identify an equality operator for type %s", format_type_be(opcintype)) :
                    cmptype == COMPARE_OVERLAP ? errmsg("could not identify an overlaps operator for type %s", format_type_be(opcintype)) :
                    cmptype == COMPARE_CONTAINED_BY ? errmsg("could not identify a contained-by operator for type %s", format_type_be(opcintype)) : 0,
                    errdetail("Could not translate compare type %d for operator family \"%s\", input type %s, access method \"%s\".",