0001-fixup-CREATE-DATABASE-make-LOCALE-apply-to-all-colla.patch
text/plain
Filename: 0001-fixup-CREATE-DATABASE-make-LOCALE-apply-to-all-colla.patch
Type: text/plain
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch 0001
Subject: fixup! CREATE DATABASE: make LOCALE apply to all collation providers.
| File | + | − |
|---|---|---|
| doc/src/sgml/ref/create_database.sgml | 6 | 6 |
| src/test/icu/t/010_database.pl | 13 | 10 |
From 0cd2154f364999091aba52136a139df75f58d1b7 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Fri, 16 Jun 2023 16:46:36 +0200
Subject: [PATCH] fixup! CREATE DATABASE: make LOCALE apply to all collation
providers.
---
doc/src/sgml/ref/create_database.sgml | 12 ++++++------
src/test/icu/t/010_database.pl | 23 +++++++++++++----------
2 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/doc/src/sgml/ref/create_database.sgml b/doc/src/sgml/ref/create_database.sgml
index dab05950ed..b2c8aef1ad 100644
--- a/doc/src/sgml/ref/create_database.sgml
+++ b/doc/src/sgml/ref/create_database.sgml
@@ -147,9 +147,9 @@ <title>Parameters</title>
<para>
Sets the default collation order and character classification in the
new database. Collation affects the sort order applied to strings,
- e.g., in queries with ORDER BY, as well as the order used in indexes
+ e.g., in queries with <literal>ORDER BY</literal>, as well as the order used in indexes
on text columns. Character classification affects the categorization
- of characters, e.g., lower, - upper and digit. Also sets the
+ of characters, e.g., lower, upper, and digit. Also sets the
associated aspects of the operating system environment,
<literal>LC_COLLATE</literal> and <literal>LC_CTYPE</literal>. The
default is the same setting as the template database. See <xref
@@ -180,7 +180,7 @@ <title>Parameters</title>
<para>
Sets <literal>LC_COLLATE</literal> in the database server's operating
system environment. The default is the setting of <xref
- linkend="create-database-locale"/> if specified; otherwise the same
+ linkend="create-database-locale"/> if specified, otherwise the same
setting as the template database. See below for additional
restrictions.
</para>
@@ -198,7 +198,7 @@ <title>Parameters</title>
<para>
Sets <literal>LC_CTYPE</literal> in the database server's operating
system environment. The default is the setting of <xref
- linkend="create-database-locale"/> if specified; otherwise the same
+ linkend="create-database-locale"/> if specified, otherwise the same
setting as the template database. See below for additional
restrictions.
</para>
@@ -218,8 +218,8 @@ <title>Parameters</title>
Specifies the ICU locale (see <xref
linkend="collation-managing-create-icu"/>) for the database default
collation order and character classification, overriding the setting
- <xref linkend="create-database-locale"/>. The <xref
- linkend="create-database-locale-provider"/> must be ICU. The default
+ <xref linkend="create-database-locale"/>. The <link
+ linkend="create-database-locale-provider">locale provider</link> must be ICU. The default
is the setting of <xref linkend="create-database-locale"/> if
specified; otherwise the same setting as the template database.
</para>
diff --git a/src/test/icu/t/010_database.pl b/src/test/icu/t/010_database.pl
index b417b1a409..cbe5467f3c 100644
--- a/src/test/icu/t/010_database.pl
+++ b/src/test/icu/t/010_database.pl
@@ -52,27 +52,30 @@
# Test that LOCALE='C' works for ICU
-my $ret1 = $node1->psql('postgres',
- q{CREATE DATABASE dbicu1 LOCALE_PROVIDER icu LOCALE 'C' TEMPLATE template0 ENCODING UTF8}
-);
-is($ret1, 0,
+is( $node1->psql(
+ 'postgres',
+ q{CREATE DATABASE dbicu1 LOCALE_PROVIDER icu LOCALE 'C' TEMPLATE template0 ENCODING UTF8}
+ ),
+ 0,
"C locale works for ICU");
# Test that LOCALE works for ICU locales if LC_COLLATE and LC_CTYPE
# are specified
-my $ret2 = $node1->psql('postgres',
- q{CREATE DATABASE dbicu2 LOCALE_PROVIDER icu LOCALE '@colStrength=primary'
+is( $node1->psql(
+ 'postgres',
+ q{CREATE DATABASE dbicu2 LOCALE_PROVIDER icu LOCALE '@colStrength=primary'
LC_COLLATE='C' LC_CTYPE='C' TEMPLATE template0 ENCODING UTF8}
-);
-is($ret2, 0,
+ ),
+ 0,
"LOCALE works for ICU locales if LC_COLLATE and LC_CTYPE are specified");
# Test that ICU-specific LOCALE without LC_COLLATE and LC_CTYPE must
# be specified with ICU_LOCALE
-my ($ret3, $stdout, $stderr) = $node1->psql('postgres',
+my ($ret, $stdout, $stderr) = $node1->psql(
+ 'postgres',
q{CREATE DATABASE dbicu3 LOCALE_PROVIDER icu LOCALE '@colStrength=primary'
TEMPLATE template0 ENCODING UTF8});
-isnt($ret3, 0,
+isnt($ret, 0,
"ICU-specific locale must be specified with ICU_LOCALE: exit code not 0");
like(
$stderr,
--
2.41.0