aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pg_locale.c
diff options
context:
space:
mode:
authorJeff Davis <jdavis@postgresql.org>2024-09-06 13:23:21 -0700
committerJeff Davis <jdavis@postgresql.org>2024-09-06 13:23:21 -0700
commit51edc4ca54f826cfac012c7306eee479f07a5dc7 (patch)
tree0a3c3a700a4e317cec6231d0e14782928cc19639 /src/backend/utils/adt/pg_locale.c
parent129a2f6679fd8891384016b6e2cde6cefda22a7d (diff)
downloadpostgresql-51edc4ca54f826cfac012c7306eee479f07a5dc7.tar.gz
postgresql-51edc4ca54f826cfac012c7306eee479f07a5dc7.zip
Remove lc_ctype_is_c().
Instead always fetch the locale and look at the ctype_is_c field. hba.c relies on regexes working for the C locale without needing catalog access, which worked before due to a special case for C_COLLATION_OID in lc_ctype_is_c(). Move the special case to pg_set_regex_collation() now that lc_ctype_is_c() is gone. Author: Andreas Karlsson Discussion: https://postgr.es/m/60929555-4709-40a7-b136-bcb44cff5a3c@proxel.se
Diffstat (limited to 'src/backend/utils/adt/pg_locale.c')
-rw-r--r--src/backend/utils/adt/pg_locale.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index cb9f1b4f78e..a738da5674f 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -1266,32 +1266,6 @@ lookup_collation_cache(Oid collation)
return cache_entry;
}
-/*
- * Detect whether collation's LC_CTYPE property is C
- */
-bool
-lc_ctype_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)->ctype_is_c;
-}
-
/* simple subroutine for reporting errors from newlocale() */
static void
report_newlocale_failure(const char *localename)