char *strategy;
strategy = defGetString(dstrategy);
- if (strcmp(strategy, "wal_log") == 0)
+ if (pg_strcasecmp(strategy, "wal_log") == 0)
dbstrategy = CREATEDB_WAL_LOG;
- else if (strcmp(strategy, "file_copy") == 0)
+ else if (pg_strcasecmp(strategy, "file_copy") == 0)
dbstrategy = CREATEDB_FILE_COPY;
else
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("invalid create database strategy \"%s\"", strategy),
- errhint("Valid strategies are \"wal_log\", and \"file_copy\".")));
+ errhint("Valid strategies are \"wal_log\" and \"file_copy\".")));
}
/* If encoding or locales are defaulted, use source's setting */
appendStringLiteralConn(&sql, lc_ctype, conn);
}
if (locale_provider)
- appendPQExpBuffer(&sql, " LOCALE_PROVIDER %s", locale_provider);
+ appendPQExpBuffer(&sql, " LOCALE_PROVIDER %s", fmtId(locale_provider));
if (icu_locale)
{
appendPQExpBufferStr(&sql, " ICU_LOCALE ");
qr/statement: CREATE DATABASE foobar6 STRATEGY wal_log TEMPLATE foobar2/,
'create database with WAL_LOG strategy');
+$node->issues_sql_like(
+ [ 'createdb', '-T', 'foobar2', '-S', 'WAL_LOG', 'foobar6s' ],
+ qr/statement: CREATE DATABASE foobar6s STRATEGY "WAL_LOG" TEMPLATE foobar2/,
+ 'create database with WAL_LOG strategy');
+
$node->issues_sql_like(
[ 'createdb', '-T', 'foobar2', '-S', 'file_copy', 'foobar7' ],
qr/statement: CREATE DATABASE foobar7 STRATEGY file_copy TEMPLATE foobar2/,
'create database with FILE_COPY strategy');
+$node->issues_sql_like(
+ [ 'createdb', '-T', 'foobar2', '-S', 'FILE_COPY', 'foobar7s' ],
+ qr/statement: CREATE DATABASE foobar7s STRATEGY "FILE_COPY" TEMPLATE foobar2/,
+ 'create database with FILE_COPY strategy');
+
# Create database owned by role_foobar.
$node->issues_sql_like(
[ 'createdb', '-T', 'foobar2', '-O', 'role_foobar', 'foobar8' ],