aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/t/020_createdb.pl
diff options
context:
space:
mode:
authorJeff Davis <jdavis@postgresql.org>2023-06-16 10:27:32 -0700
committerJeff Davis <jdavis@postgresql.org>2023-06-16 10:27:32 -0700
commita14e75eb0b6a73821e0d66c0d407372ec8376105 (patch)
treeb0fd40e450cdb4f498f911b54a195dcd3ebd1a58 /src/bin/scripts/t/020_createdb.pl
parentc0d951262c80f42b3bfe037f940e103a24da84f4 (diff)
downloadpostgresql-a14e75eb0b6a73821e0d66c0d407372ec8376105.tar.gz
postgresql-a14e75eb0b6a73821e0d66c0d407372ec8376105.zip
CREATE DATABASE: make LOCALE apply to all collation providers.
For CREATE DATABASE, make LOCALE parameter apply regardless of the provider used. Also affects initdb and createdb --locale arguments. Previously, LOCALE (and --locale) only affected the database default collation when using the libc provider. Discussion: https://postgr.es/m/1a63084d-221e-4075-619e-6b3e590f673e@enterprisedb.com Reviewed-by: Peter Eisentraut
Diffstat (limited to 'src/bin/scripts/t/020_createdb.pl')
-rw-r--r--src/bin/scripts/t/020_createdb.pl15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/bin/scripts/t/020_createdb.pl b/src/bin/scripts/t/020_createdb.pl
index d0830a4a1d3..694ec568047 100644
--- a/src/bin/scripts/t/020_createdb.pl
+++ b/src/bin/scripts/t/020_createdb.pl
@@ -86,6 +86,15 @@ if ($ENV{with_icu} eq 'yes')
],
'create database with icu locale from template database with icu provider'
);
+
+ $node2->command_ok(
+ [
+ 'createdb', '-T', 'template0', '--locale-provider', 'icu',
+ '--locale', 'en', '--lc-collate', 'C', '--lc-ctype', 'C',
+ 'foobar57'
+ ],
+ 'create database with locale as ICU locale'
+ );
}
else
{
@@ -110,7 +119,7 @@ ALTER TABLE tab_foobar owner to role_foobar;
CREATE POLICY pol_foobar ON tab_foobar FOR ALL TO role_foobar;');
$node->issues_sql_like(
[ 'createdb', '-l', 'C', '-T', 'foobar2', 'foobar3' ],
- qr/statement: CREATE DATABASE foobar3 TEMPLATE foobar2/,
+ qr/statement: CREATE DATABASE foobar3 TEMPLATE foobar2 LOCALE 'C'/,
'create database with template');
($ret, $stdout, $stderr) = $node->psql(
'foobar3',
@@ -137,7 +146,7 @@ $node->command_checks_all(
1,
[qr/^$/],
[
- qr/^createdb: error: database creation failed: ERROR: invalid locale name|^createdb: error: database creation failed: ERROR: new collation \(foo'; SELECT '1\) is incompatible with the collation of the template database/s
+ qr/^createdb: error: database creation failed: ERROR: invalid LC_COLLATE locale name|^createdb: error: database creation failed: ERROR: new collation \(foo'; SELECT '1\) is incompatible with the collation of the template database/s
],
'createdb with incorrect --lc-collate');
$node->command_checks_all(
@@ -145,7 +154,7 @@ $node->command_checks_all(
1,
[qr/^$/],
[
- qr/^createdb: error: database creation failed: ERROR: invalid locale name|^createdb: error: database creation failed: ERROR: new LC_CTYPE \(foo'; SELECT '1\) is incompatible with the LC_CTYPE of the template database/s
+ qr/^createdb: error: database creation failed: ERROR: invalid LC_CTYPE locale name|^createdb: error: database creation failed: ERROR: new LC_CTYPE \(foo'; SELECT '1\) is incompatible with the LC_CTYPE of the template database/s
],
'createdb with incorrect --lc-ctype');