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.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bin/scripts/createdb.c b/src/bin/scripts/createdb.c
index 6f612abf7c6..0bffa2f3ee4 100644
--- a/src/bin/scripts/createdb.c
+++ b/src/bin/scripts/createdb.c
@@ -34,6 +34,7 @@ main(int argc, char *argv[])
{"tablespace", required_argument, NULL, 'D'},
{"template", required_argument, NULL, 'T'},
{"encoding", required_argument, NULL, 'E'},
+ {"strategy", required_argument, NULL, 'S'},
{"lc-collate", required_argument, NULL, 1},
{"lc-ctype", required_argument, NULL, 2},
{"locale", required_argument, NULL, 'l'},
@@ -60,6 +61,7 @@ main(int argc, char *argv[])
char *tablespace = NULL;
char *template = NULL;
char *encoding = NULL;
+ char *strategy = NULL;
char *lc_collate = NULL;
char *lc_ctype = NULL;
char *locale = NULL;
@@ -77,7 +79,7 @@ main(int argc, char *argv[])
handle_help_version_opts(argc, argv, "createdb", help);
- while ((c = getopt_long(argc, argv, "h:p:U:wWeO:D:T:E:l:", long_options, &optindex)) != -1)
+ while ((c = getopt_long(argc, argv, "h:p:U:wWeO:D:T:E:l:S:", long_options, &optindex)) != -1)
{
switch (c)
{
@@ -111,6 +113,9 @@ main(int argc, char *argv[])
case 'E':
encoding = pg_strdup(optarg);
break;
+ case 'S':
+ strategy = pg_strdup(optarg);
+ break;
case 1:
lc_collate = pg_strdup(optarg);
break;
@@ -215,6 +220,8 @@ main(int argc, char *argv[])
appendPQExpBufferStr(&sql, " ENCODING ");
appendStringLiteralConn(&sql, encoding, conn);
}
+ if (strategy)
+ appendPQExpBuffer(&sql, " STRATEGY %s", fmtId(strategy));
if (template)
appendPQExpBuffer(&sql, " TEMPLATE %s", fmtId(template));
if (lc_collate)
@@ -294,6 +301,7 @@ help(const char *progname)
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(_(" -S, --strategy=STRATEGY database creation strategy wal_log or file_copy\n"));
printf(_(" -T, --template=TEMPLATE template database to copy\n"));
printf(_(" -V, --version output version information, then exit\n"));
printf(_(" -?, --help show this help, then exit\n"));