<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/createdb.sgml,v 1.47 2007/12/11 19:57:32 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/createdb.sgml,v 1.48 2008/11/10 16:25:41 alvherre Exp $
PostgreSQL documentation
-->
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>-l <replaceable class="parameter">locale</replaceable></></term>
+ <term><option>--locale <replaceable class="parameter">locale</replaceable></></term>
+ <listitem>
+ <para>
+ Specifies the locale to be used in this database. This is equivalent
+ to specifying both <option>--lc-collate</option> and <option>--lc-ctype</option>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--lc-collate <replaceable class="parameter">locale</replaceable></></term>
+ <listitem>
+ <para>
+ Specifies the LC_COLLATE setting to be used in this database.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--lc-ctype <replaceable class="parameter">locale</replaceable></></term>
+ <listitem>
+ <para>
+ Specifies the LC_CTYPE setting to be used in this database.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><option>-E <replaceable class="parameter">encoding</replaceable></></term>
<term><option>--encoding <replaceable class="parameter">encoding</replaceable></></term>
</para>
<para>
- The options <option>-D</option>, <option>-E</option>,
+ The options <option>-D</option>, <option>-E</option>, <option>-l</option>,
<option>-O</option>, and
<option>-T</option> correspond to options of the underlying
SQL command <xref linkend="SQL-CREATEDATABASE"
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.27 2008/09/23 09:20:38 heikki Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.28 2008/11/10 16:25:41 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
{"encoding", required_argument, NULL, 'E'},
{"lc-collate", required_argument, NULL, 1},
{"lc-ctype", required_argument, NULL, 2},
+ {"locale", required_argument, NULL, 'l'},
{NULL, 0, NULL, 0}
};
char *encoding = NULL;
char *lc_collate = NULL;
char *lc_ctype = NULL;
+ char *locale = NULL;
PQExpBufferData sql;
handle_help_version_opts(argc, argv, "createdb", help);
- while ((c = getopt_long(argc, argv, "h:p:U:WeqO:D:T:E:", long_options, &optindex)) != -1)
+ while ((c = getopt_long(argc, argv, "h:p:U:WeqO:D:T:E:l:", long_options, &optindex)) != -1)
{
switch (c)
{
case 2:
lc_ctype = optarg;
break;
+ case 'l':
+ locale = optarg;
+ break;
default:
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
exit(1);
exit(1);
}
+ if (locale)
+ {
+ if (lc_ctype)
+ {
+ fprintf(stderr, _("%s: only one of --locale and --lc-ctype can be specified\n"),
+ progname);
+ exit(1);
+ }
+ if (lc_collate)
+ {
+ fprintf(stderr, _("%s: only one of --locale and --lc-collate can be specified\n"),
+ progname);
+ exit(1);
+ }
+ lc_ctype = locale;
+ lc_collate = locale;
+ }
+
if (encoding)
{
if (pg_char_to_encoding(encoding) < 0)
printf(_("\nOptions:\n"));
printf(_(" -D, --tablespace=TABLESPACE default tablespace for the database\n"));
printf(_(" -E, --encoding=ENCODING encoding for the database\n"));
+ printf(_(" -l, --locale=LOCALE locale settings for the database\n"));
printf(_(" --lc-collate=LOCALE LC_COLLATE setting for the database\n"));
printf(_(" --lc-ctype=LOCALE LC_CTYPE setting for the database\n"));
printf(_(" -O, --owner=OWNER database user to own the new database\n"));