Remove obsolete global database_ctype_is_c.
authorJeff Davis <jdavis@postgresql.org>
Tue, 21 Oct 2025 16:32:04 +0000 (09:32 -0700)
committerJeff Davis <jdavis@postgresql.org>
Tue, 21 Oct 2025 16:32:04 +0000 (09:32 -0700)
Now that tsearch uses the database default locale, there's no need to
track the database CTYPE separately.

Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/0151ad01239e2cc7b3139644358cf8f7b9622ff7.camel@j-davis.com

src/backend/utils/adt/pg_locale.c
src/backend/utils/init/postinit.c
src/include/utils/pg_locale.h

index 00d1e03147243e6bb26f5430083882b93cbb15d5..67299c55ed8a84e16f2db0964b17cafb38f76dde 100644 (file)
@@ -100,9 +100,6 @@ char       *localized_full_days[7 + 1];
 char      *localized_abbrev_months[12 + 1];
 char      *localized_full_months[12 + 1];
 
-/* is the databases's LC_CTYPE the C locale? */
-bool       database_ctype_is_c = false;
-
 static pg_locale_t default_locale = NULL;
 
 /* indicates whether locale information cache is valid */
index 641e535a73c7c0bf2b00f04e1688b4ff8052719f..98f9598cd789df520f91ca14fc8d11229b745e84 100644 (file)
@@ -430,10 +430,6 @@ CheckMyDatabase(const char *name, bool am_superuser, bool override_allow_connect
                           " which is not recognized by setlocale().", ctype),
                 errhint("Recreate the database with another locale or install the missing locale.")));
 
-   if (strcmp(ctype, "C") == 0 ||
-       strcmp(ctype, "POSIX") == 0)
-       database_ctype_is_c = true;
-
    init_database_collation();
 
    /*
index 86c48c34f2646b04c7fa863a7b1bd4dd8edf2945..e6f939cb085b1089530ed22a288b70904abfbbac 100644 (file)
@@ -39,9 +39,6 @@ extern PGDLLIMPORT char *localized_full_days[];
 extern PGDLLIMPORT char *localized_abbrev_months[];
 extern PGDLLIMPORT char *localized_full_months[];
 
-/* is the databases's LC_CTYPE the C locale? */
-extern PGDLLIMPORT bool database_ctype_is_c;
-
 extern bool check_locale(int category, const char *locale, char **canonname);
 extern char *pg_perm_setlocale(int category, const char *locale);