diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2019-07-23 14:40:42 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2019-07-23 14:47:24 +0200 |
commit | 06140c201b982436974d71e756d7331767a41e57 (patch) | |
tree | e663a180e7f1f4645dc48e0ae741845f52b6652d /doc/src | |
parent | 3cae75f4209bcbb06285544de0f1c59f717a3159 (diff) | |
download | postgresql-06140c201b982436974d71e756d7331767a41e57.tar.gz postgresql-06140c201b982436974d71e756d7331767a41e57.zip |
Add CREATE DATABASE LOCALE option
This sets both LC_COLLATE and LC_CTYPE with one option. Similar
behavior is already supported in initdb, CREATE COLLATION, and
createdb.
Reviewed-by: Fabien COELHO <coelho@cri.ensmp.fr>
Discussion: https://www.postgresql.org/message-id/flat/d9d5043a-dc70-da8a-0166-1e218e6e34d4%402ndquadrant.com
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/create_database.sgml | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/doc/src/sgml/ref/create_database.sgml b/doc/src/sgml/ref/create_database.sgml index b2c9e241c2f..4014f6703bb 100644 --- a/doc/src/sgml/ref/create_database.sgml +++ b/doc/src/sgml/ref/create_database.sgml @@ -25,6 +25,7 @@ CREATE DATABASE <replaceable class="parameter">name</replaceable> [ [ WITH ] [ OWNER [=] <replaceable class="parameter">user_name</replaceable> ] [ TEMPLATE [=] <replaceable class="parameter">template</replaceable> ] [ ENCODING [=] <replaceable class="parameter">encoding</replaceable> ] + [ LOCALE [=] <replaceable class="parameter">locale</replaceable> ] [ LC_COLLATE [=] <replaceable class="parameter">lc_collate</replaceable> ] [ LC_CTYPE [=] <replaceable class="parameter">lc_ctype</replaceable> ] [ TABLESPACE [=] <replaceable class="parameter">tablespace_name</replaceable> ] @@ -112,6 +113,26 @@ CREATE DATABASE <replaceable class="parameter">name</replaceable> </listitem> </varlistentry> <varlistentry> + <term><replaceable class="parameter">locale</replaceable></term> + <listitem> + <para> + This is a shortcut for setting <symbol>LC_COLLATE</symbol> + and <symbol>LC_CTYPE</symbol> at once. If you specify this, + you cannot specify either of those parameters. + </para> + <tip> + <para> + The other locale settings <xref linkend="guc-lc-messages"/>, <xref + linkend="guc-lc-monetary"/>, <xref linkend="guc-lc-numeric"/>, and + <xref linkend="guc-lc-time"/> are not fixed per database and are not + set by this command. If you want to make them the default for a + specific database, you can use <literal>ALTER DATABASE + ... SET</literal>. + </para> + </tip> + </listitem> + </varlistentry> + <varlistentry> <term><replaceable class="parameter">lc_collate</replaceable></term> <listitem> <para> @@ -287,7 +308,7 @@ CREATE DATABASE sales OWNER salesapp TABLESPACE salesspace; To create a database <literal>music</literal> with a different locale: <programlisting> CREATE DATABASE music - LC_COLLATE 'sv_SE.utf8' LC_CTYPE 'sv_SE.utf8' + LOCALE 'sv_SE.utf8' TEMPLATE template0; </programlisting> In this example, the <literal>TEMPLATE template0</literal> clause is required if @@ -300,7 +321,7 @@ CREATE DATABASE music different character set encoding: <programlisting> CREATE DATABASE music2 - LC_COLLATE 'sv_SE.iso885915' LC_CTYPE 'sv_SE.iso885915' + LOCALE 'sv_SE.iso885915' ENCODING LATIN9 TEMPLATE template0; </programlisting> |