aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pg_locale.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt/pg_locale.c')
-rw-r--r--src/backend/utils/adt/pg_locale.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index d82e816230f..cb9f1b4f78e 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -1266,33 +1266,6 @@ lookup_collation_cache(Oid collation)
return cache_entry;
}
-
-/*
- * Detect whether collation's LC_COLLATE property is C
- */
-bool
-lc_collate_is_c(Oid collation)
-{
- /*
- * If we're asked about "collation 0", return false, so that the code will
- * go into the non-C path and report that the collation is bogus.
- */
- if (!OidIsValid(collation))
- return false;
-
- /*
- * If we're asked about the built-in C/POSIX collations, we know that.
- */
- if (collation == C_COLLATION_OID ||
- collation == POSIX_COLLATION_OID)
- return true;
-
- /*
- * Otherwise, we have to consult pg_collation, but we cache that.
- */
- return pg_newlocale_from_collation(collation)->collate_is_c;
-}
-
/*
* Detect whether collation's LC_CTYPE property is C
*/
@@ -1571,12 +1544,12 @@ pg_newlocale_from_collation(Oid collid)
{
collation_cache_entry *cache_entry;
- /* Callers must pass a valid OID */
- Assert(OidIsValid(collid));
-
if (collid == DEFAULT_COLLATION_OID)
return &default_locale;
+ if (!OidIsValid(collid))
+ elog(ERROR, "cache lookup failed for collation %u", collid);
+
if (last_collation_cache_oid == collid)
return last_collation_cache_locale;