diff options
Diffstat (limited to 'src/bin/scripts/createdb.c')
-rw-r--r-- | src/bin/scripts/createdb.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/bin/scripts/createdb.c b/src/bin/scripts/createdb.c index b0c6805bc97..6f612abf7c6 100644 --- a/src/bin/scripts/createdb.c +++ b/src/bin/scripts/createdb.c @@ -38,6 +38,8 @@ main(int argc, char *argv[]) {"lc-ctype", required_argument, NULL, 2}, {"locale", required_argument, NULL, 'l'}, {"maintenance-db", required_argument, NULL, 3}, + {"locale-provider", required_argument, NULL, 4}, + {"icu-locale", required_argument, NULL, 5}, {NULL, 0, NULL, 0} }; @@ -61,6 +63,8 @@ main(int argc, char *argv[]) char *lc_collate = NULL; char *lc_ctype = NULL; char *locale = NULL; + char *locale_provider = NULL; + char *icu_locale = NULL; PQExpBufferData sql; @@ -119,6 +123,12 @@ main(int argc, char *argv[]) case 3: maintenance_db = pg_strdup(optarg); break; + case 4: + locale_provider = pg_strdup(optarg); + break; + case 5: + icu_locale = pg_strdup(optarg); + break; default: fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname); exit(1); @@ -217,6 +227,13 @@ main(int argc, char *argv[]) appendPQExpBufferStr(&sql, " LC_CTYPE "); appendStringLiteralConn(&sql, lc_ctype, conn); } + if (locale_provider) + appendPQExpBuffer(&sql, " LOCALE_PROVIDER %s", locale_provider); + if (icu_locale) + { + appendPQExpBufferStr(&sql, " ICU_LOCALE "); + appendStringLiteralConn(&sql, icu_locale, conn); + } appendPQExpBufferChar(&sql, ';'); @@ -273,6 +290,9 @@ help(const char *progname) printf(_(" -l, --locale=LOCALE locale settings for the database\n")); printf(_(" --lc-collate=LOCALE LC_COLLATE setting for the database\n")); printf(_(" --lc-ctype=LOCALE LC_CTYPE setting for the database\n")); + printf(_(" --icu-locale=LOCALE ICU locale setting for the database\n")); + printf(_(" --locale-provider={libc|icu}\n" + " locale provider for the database's default collation\n")); printf(_(" -O, --owner=OWNER database user to own the new database\n")); printf(_(" -T, --template=TEMPLATE template database to copy\n")); printf(_(" -V, --version output version information, then exit\n")); |