1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Rename the new CREATE DATABASE options to set collation and ctype into

LC_COLLATE and LC_CTYPE, per discussion on pgsql-hackers.
This commit is contained in:
Heikki Linnakangas
2009-04-06 08:42:53 +00:00
parent f2110a757d
commit 1eef90d0a2
10 changed files with 48 additions and 45 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.92 2009/03/26 20:55:49 tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.93 2009/04/06 08:42:52 heikki Exp $ -->
<chapter id="charset">
<title>Localization</>
@ -749,7 +749,7 @@ createdb -E EUC_KR -T template0 --lc-collate=ko_KR.euckr --lc-ctype=ko_KR.euckr
Another way to accomplish this is to use this SQL command:
<programlisting>
CREATE DATABASE korean WITH ENCODING 'EUC_KR' COLLATE='ko_KR.euckr' CTYPE='ko_KR.euckr' TEMPLATE=template0;
CREATE DATABASE korean WITH ENCODING 'EUC_KR' LC_COLLATE='ko_KR.euckr' LC_CTYPE='ko_KR.euckr' TEMPLATE=template0;
</programlisting>
The encoding for a database is stored in the system catalog

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/keywords.sgml,v 2.23 2009/02/24 10:06:31 petere Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/keywords.sgml,v 2.24 2009/04/06 08:42:52 heikki Exp $ -->
<appendix id="sql-keywords-appendix">
<title><acronym>SQL</acronym> Key Words</title>
@ -800,7 +800,7 @@
<entry>non-reserved</entry>
</row>
<row>
<entry><token>COLLATE</token></entry>
<entry><token>LC_COLLATE</token></entry>
<entry>reserved</entry>
<entry>reserved</entry>
<entry>reserved</entry>
@ -1168,7 +1168,7 @@
<entry></entry>
</row>
<row>
<entry><token>CTYPE</token></entry>
<entry><token>LC_CTYPE</token></entry>
<entry>non-reserved</entry>
<entry></entry>
<entry></entry>

View File

@ -1,5 +1,5 @@
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/create_database.sgml,v 1.50 2008/11/14 10:22:46 petere Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/create_database.sgml,v 1.51 2009/04/06 08:42:52 heikki Exp $
PostgreSQL documentation
-->
@ -25,8 +25,8 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
[ [ WITH ] [ OWNER [=] <replaceable class="parameter">dbowner</replaceable> ]
[ TEMPLATE [=] <replaceable class="parameter">template</replaceable> ]
[ ENCODING [=] <replaceable class="parameter">encoding</replaceable> ]
[ COLLATE [=] <replaceable class="parameter">collate</replaceable> ]
[ CTYPE [=] <replaceable class="parameter">ctype</replaceable> ]
[ LC_COLLATE [=] <replaceable class="parameter">lc_collate</replaceable> ]
[ LC_CTYPE [=] <replaceable class="parameter">lc_ctype</replaceable> ]
[ TABLESPACE [=] <replaceable class="parameter">tablespace</replaceable> ]
[ CONNECTION LIMIT [=] <replaceable class="parameter">connlimit</replaceable> ] ]
</synopsis>
@ -207,7 +207,7 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
<para>
The character set encoding specified for the new database must be
compatible with the chosen COLLATE and CTYPE settings.
compatible with the chosen LC_COLLATE and LC_CTYPE settings.
If <envar>LC_CTYPE</> is <literal>C</> (or equivalently
<literal>POSIX</>), then all encodings are allowed, but for other
locale settings there is only one encoding that will work properly.
@ -219,9 +219,9 @@ CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
</para>
<para>
The <literal>COLLATE</> and <literal>CTYPE</> settings must match
The <literal>LC_COLLATE</> and <literal>LC_CTYPE</> settings must match
those of the template database, except when template0 is used as
template. This is because <literal>COLLATE</> and <literal>CTYPE</>
template. This is because <literal>LC_COLLATE</> and <literal>LC_CTYPE</>
affects the ordering in indexes, so that any indexes copied from the
template database would be invalid in the new database with different
settings. <literal>template0</literal>, however, is known to not