mirror of
https://github.com/postgres/postgres.git
synced 2025-05-11 05:41:32 +03:00
Replace createdb's obsolete --location switch with --tablespace.
I kept the same abbreviated letter -D, in hopes of maintaining some modicum of backwards compatibility (though it's doubtful whether anyone is really using scripts that invoke createdb -D ...)
This commit is contained in:
parent
984c8a48f4
commit
f7ca71a76b
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/createdb.sgml,v 1.39 2004/06/18 21:24:02 tgl Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/createdb.sgml,v 1.40 2004/06/18 21:47:23 tgl Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -67,8 +67,8 @@ PostgreSQL documentation
|
|||||||
<term><replaceable class="parameter">dbname</replaceable></term>
|
<term><replaceable class="parameter">dbname</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the name of the database to be created. The name must be
|
Specifies the name of the database to be created. The name must be
|
||||||
unique among all <productname>PostgreSQL</productname> databases in this cluster.
|
unique among all <productname>PostgreSQL</productname> databases in this cluster.
|
||||||
The default is to create a database with the same name as the
|
The default is to create a database with the same name as the
|
||||||
current system user.
|
current system user.
|
||||||
</para>
|
</para>
|
||||||
@ -79,18 +79,18 @@ PostgreSQL documentation
|
|||||||
<term><replaceable class="parameter">description</replaceable></term>
|
<term><replaceable class="parameter">description</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This optionally specifies a comment to be associated with the newly created
|
Specifies a comment to be associated with the newly created
|
||||||
database.
|
database.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>-D <replaceable class="parameter">location</replaceable></></term>
|
<term><option>-D <replaceable class="parameter">tablespace</replaceable></></term>
|
||||||
<term><option>--location <replaceable class="parameter">location</replaceable></></term>
|
<term><option>--tablespace <replaceable class="parameter">tablespace</replaceable></></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the alternative location for the database.
|
Specifies the default tablespace for the database.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -101,7 +101,7 @@ PostgreSQL documentation
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Echo the commands that <application>createdb</application> generates
|
Echo the commands that <application>createdb</application> generates
|
||||||
and sends to the server.
|
and sends to the server.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -124,7 +124,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--owner <replaceable class="parameter">owner</replaceable></></term>
|
<term><option>--owner <replaceable class="parameter">owner</replaceable></></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the database user who will own the new database.
|
Specifies the database user who will own the new database.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -170,9 +170,9 @@ PostgreSQL documentation
|
|||||||
<term><option>--host <replaceable class="parameter">host</replaceable></></term>
|
<term><option>--host <replaceable class="parameter">host</replaceable></></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the host name of the machine on which the
|
Specifies the host name of the machine on which the
|
||||||
server is running. If the value begins with a slash, it is used
|
server is running. If the value begins with a slash, it is used
|
||||||
as the directory for the Unix domain socket.
|
as the directory for the Unix domain socket.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -182,8 +182,8 @@ PostgreSQL documentation
|
|||||||
<term><option>--port <replaceable class="parameter">port</replaceable></></term>
|
<term><option>--port <replaceable class="parameter">port</replaceable></></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the TCP port or the local Unix domain socket file
|
Specifies the TCP port or the local Unix domain socket file
|
||||||
extension on which the server is listening for connections.
|
extension on which the server is listening for connections.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.11 2004/06/03 00:07:38 momjian Exp $
|
* $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.12 2004/06/18 21:47:24 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -31,7 +31,7 @@ main(int argc, char *argv[])
|
|||||||
{"echo", no_argument, NULL, 'e'},
|
{"echo", no_argument, NULL, 'e'},
|
||||||
{"quiet", no_argument, NULL, 'q'},
|
{"quiet", no_argument, NULL, 'q'},
|
||||||
{"owner", required_argument, NULL, 'O'},
|
{"owner", required_argument, NULL, 'O'},
|
||||||
{"location", required_argument, NULL, 'D'},
|
{"tablespace", required_argument, NULL, 'D'},
|
||||||
{"template", required_argument, NULL, 'T'},
|
{"template", required_argument, NULL, 'T'},
|
||||||
{"encoding", required_argument, NULL, 'E'},
|
{"encoding", required_argument, NULL, 'E'},
|
||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
@ -50,7 +50,7 @@ main(int argc, char *argv[])
|
|||||||
bool echo = false;
|
bool echo = false;
|
||||||
bool quiet = false;
|
bool quiet = false;
|
||||||
char *owner = NULL;
|
char *owner = NULL;
|
||||||
char *location = NULL;
|
char *tablespace = NULL;
|
||||||
char *template = NULL;
|
char *template = NULL;
|
||||||
char *encoding = NULL;
|
char *encoding = NULL;
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ main(int argc, char *argv[])
|
|||||||
owner = optarg;
|
owner = optarg;
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
location = optarg;
|
tablespace = optarg;
|
||||||
break;
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
template = optarg;
|
template = optarg;
|
||||||
@ -149,11 +149,8 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (owner)
|
if (owner)
|
||||||
appendPQExpBuffer(&sql, " OWNER %s", fmtId(owner));
|
appendPQExpBuffer(&sql, " OWNER %s", fmtId(owner));
|
||||||
if (location)
|
if (tablespace)
|
||||||
{
|
appendPQExpBuffer(&sql, " TABLESPACE %s", fmtId(tablespace));
|
||||||
appendPQExpBuffer(&sql, " LOCATION ");
|
|
||||||
appendStringLiteral(&sql, location, false);
|
|
||||||
}
|
|
||||||
if (encoding)
|
if (encoding)
|
||||||
appendPQExpBuffer(&sql, " ENCODING '%s'", encoding);
|
appendPQExpBuffer(&sql, " ENCODING '%s'", encoding);
|
||||||
if (template)
|
if (template)
|
||||||
@ -221,19 +218,19 @@ help(const char *progname)
|
|||||||
printf(_("Usage:\n"));
|
printf(_("Usage:\n"));
|
||||||
printf(_(" %s [OPTION]... [DBNAME] [DESCRIPTION]\n"), progname);
|
printf(_(" %s [OPTION]... [DBNAME] [DESCRIPTION]\n"), progname);
|
||||||
printf(_("\nOptions:\n"));
|
printf(_("\nOptions:\n"));
|
||||||
printf(_(" -D, --location=PATH alternative place to store the database\n"));
|
printf(_(" -D, --tablespace=TABLESPACE default tablespace for the database\n"));
|
||||||
printf(_(" -E, --encoding=ENCODING encoding for the database\n"));
|
printf(_(" -E, --encoding=ENCODING encoding for the database\n"));
|
||||||
printf(_(" -O, --owner=OWNER database user to own the new database\n"));
|
printf(_(" -O, --owner=OWNER database user to own the new database\n"));
|
||||||
printf(_(" -T, --template=TEMPLATE template database to copy\n"));
|
printf(_(" -T, --template=TEMPLATE template database to copy\n"));
|
||||||
printf(_(" -e, --echo show the commands being sent to the server\n"));
|
printf(_(" -e, --echo show the commands being sent to the server\n"));
|
||||||
printf(_(" -q, --quiet don't write any messages\n"));
|
printf(_(" -q, --quiet don't write any messages\n"));
|
||||||
printf(_(" --help show this help, then exit\n"));
|
printf(_(" --help show this help, then exit\n"));
|
||||||
printf(_(" --version output version information, then exit\n"));
|
printf(_(" --version output version information, then exit\n"));
|
||||||
printf(_("\nConnection options:\n"));
|
printf(_("\nConnection options:\n"));
|
||||||
printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));
|
printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));
|
||||||
printf(_(" -p, --port=PORT database server port\n"));
|
printf(_(" -p, --port=PORT database server port\n"));
|
||||||
printf(_(" -U, --username=USERNAME user name to connect as\n"));
|
printf(_(" -U, --username=USERNAME user name to connect as\n"));
|
||||||
printf(_(" -W, --password prompt for password\n"));
|
printf(_(" -W, --password prompt for password\n"));
|
||||||
printf(_("\nBy default, a database with the same name as the current user is created.\n"));
|
printf(_("\nBy default, a database with the same name as the current user is created.\n"));
|
||||||
printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"));
|
printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user