aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/createdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/scripts/createdb.c')
-rw-r--r--src/bin/scripts/createdb.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/bin/scripts/createdb.c b/src/bin/scripts/createdb.c
index b4205c4fa51..9ca86a3e53d 100644
--- a/src/bin/scripts/createdb.c
+++ b/src/bin/scripts/createdb.c
@@ -164,14 +164,6 @@ main(int argc, char *argv[])
exit(1);
}
- if (locale)
- {
- if (!lc_ctype)
- lc_ctype = locale;
- if (!lc_collate)
- lc_collate = locale;
- }
-
if (encoding)
{
if (pg_char_to_encoding(encoding) < 0)
@@ -219,6 +211,11 @@ main(int argc, char *argv[])
appendPQExpBuffer(&sql, " STRATEGY %s", fmtId(strategy));
if (template)
appendPQExpBuffer(&sql, " TEMPLATE %s", fmtId(template));
+ if (locale)
+ {
+ appendPQExpBufferStr(&sql, " LOCALE ");
+ appendStringLiteralConn(&sql, locale, conn);
+ }
if (lc_collate)
{
appendPQExpBufferStr(&sql, " LC_COLLATE ");