doc: Update CREATE DATABASE examples
authorPeter Eisentraut
Thu, 2 Feb 2017 19:57:46 +0000 (14:57 -0500)
committerPeter Eisentraut
Mon, 6 Feb 2017 16:55:39 +0000 (11:55 -0500)
The example of using CREATE DATABASE with the ENCODING option did not
work anymore (except in special circumstances) and did not represent a
good general-purpose example, so write some new examples.

Reported-by: [email protected]
doc/src/sgml/ref/create_database.sgml

index cf0d53b3014bda73cd561c88c9b747fb7aa772af..48386a29f92c2b45acfd3b66f9de0e633baaf940 100644 (file)
@@ -284,17 +284,33 @@ CREATE DATABASE sales OWNER salesapp TABLESPACE salesspace;
   
 
   
-   To create a database music which supports the ISO-8859-1
-   character set:
+   To create a database music with a different locale:
+
+CREATE DATABASE music
+    LC_COLLATE 'sv_SE.utf8' LC_CTYPE 'sv_SE.utf8'
+    TEMPLATE template0;
+
+    In this example, the TEMPLATE template0 clause is required if
+    the specified locale is different from the one in template1.
+    (If it is not, then specifying the locale explicitly is redundant.)
+  
 
+  
+   To create a database music2 with a different locale and a
+   different character set encoding:
 
-CREATE DATABASE music ENCODING 'LATIN1' TEMPLATE template0;
+CREATE DATABASE music2
+    LC_COLLATE 'sv_SE.iso885915' LC_CTYPE 'sv_SE.iso885915'
+    ENCODING LATIN9
+    TEMPLATE template0;
 
+   The specified locale and encoding settings must match, or an error will be
+   reported.
+  
 
-   In this example, the TEMPLATE template0 clause would only
-   be required if template1's encoding is not ISO-8859-1.
-   Note that changing encoding might require selecting new
-   LC_COLLATE and LC_CTYPE settings as well.
+  
+   Note that locale names are specific to the operating system, so that the
+   above commands might not work in the same way everywhere.