Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit da5d4ea

Browse files
committed
Make locale option behavior more consistent
Locale options can be specified for initdb, createdb, and CREATE DATABASE. In initdb, it has always been possible to specify --locale and then some --lc-* option to override a category. CREATE DATABASE and createdb didn't allow that, requiring either the all-categories option or only per-category options. In f2553d4, this was changed in CREATE DATABASE (perhaps by accident?) to be more like the initdb behavior, but createdb still had the old behavior. Now we change createdb to match the behavior of CREATE DATABASE and initdb, and also update the documentation of CREATE DATABASE to match the new behavior, which was not done in the above commit. Author: Marina Polyakova <m.polyakova@postgrespro.ru> Reviewed-by: Justin Pryzby <pryzby@telsasoft.com> Discussion: https://www.postgresql.org/message-id/7c99c132dc9c0ac630e0127f032ac480@postgrespro.ru
1 parent 8e7a0b4 commit da5d4ea

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

doc/src/sgml/ref/create_database.sgml

+1-2
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ CREATE DATABASE <replaceable class="parameter">name</replaceable>
145145
<listitem>
146146
<para>
147147
This is a shortcut for setting <symbol>LC_COLLATE</symbol>
148-
and <symbol>LC_CTYPE</symbol> at once. If you specify this,
149-
you cannot specify either of those parameters.
148+
and <symbol>LC_CTYPE</symbol> at once.
150149
</para>
151150
<tip>
152151
<para>

src/bin/scripts/createdb.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,10 @@ main(int argc, char *argv[])
161161

162162
if (locale)
163163
{
164-
if (lc_ctype)
165-
pg_fatal("only one of --locale and --lc-ctype can be specified");
166-
if (lc_collate)
167-
pg_fatal("only one of --locale and --lc-collate can be specified");
168-
lc_ctype = locale;
169-
lc_collate = locale;
164+
if (!lc_ctype)
165+
lc_ctype = locale;
166+
if (!lc_collate)
167+
lc_collate = locale;
170168
}
171169

172170
if (encoding)

0 commit comments

Comments
 (0)