summaryrefslogtreecommitdiff
path: root/src/backend/utils/init/postinit.c
diff options
context:
space:
mode:
authorJeff Davis <jdavis@postgresql.org>2023-03-17 11:47:35 -0700
committerJeff Davis <jdavis@postgresql.org>2023-03-17 12:08:46 -0700
commitf413941f41d370a7893caa3e6ed384b89a0577fd (patch)
tree05a69d2b5ddd453939f3a5346c525fc51ec304ba /src/backend/utils/init/postinit.c
parent064709f803c05559d2849a62fdb855fbb91ffeb8 (diff)
downloadpostgresql-f413941f41d370a7893caa3e6ed384b89a0577fd.tar.gz
Fix t_isspace(), etc., when datlocprovider=i and datctype=C.
Check whether the datctype is C to determine whether t_isspace() and related functions use isspace() or iswspace(). Previously, t_isspace() checked whether the database default collation was C; which is incorrect when the default collation uses the ICU provider. Discussion: https://postgr.es/m/79e4354d9eccfdb00483146a6b9f6295202e7890.camel@j-davis.com Reviewed-by: Peter Eisentraut Backpatch-through: 15
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r--src/backend/utils/init/postinit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index 92bac8b63f..31d6a05426 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -419,6 +419,10 @@ 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;
+
if (dbform->datlocprovider == COLLPROVIDER_ICU)
{
char *icurules;