Skip to content

Commit f7ca71a

Browse files
committed
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 ...)
1 parent 984c8a4 commit f7ca71a

File tree

2 files changed

+33
-36
lines changed

2 files changed

+33
-36
lines changed

doc/src/sgml/ref/createdb.sgml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/createdb.sgml,v 1.39 2004/06/18 21:24:02 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/createdb.sgml,v 1.40 2004/06/18 21:47:23 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -67,8 +67,8 @@ PostgreSQL documentation
6767
<term><replaceable class="parameter">dbname</replaceable></term>
6868
<listitem>
6969
<para>
70-
Specifies the name of the database to be created. The name must be
71-
unique among all <productname>PostgreSQL</productname> databases in this cluster.
70+
Specifies the name of the database to be created. The name must be
71+
unique among all <productname>PostgreSQL</productname> databases in this cluster.
7272
The default is to create a database with the same name as the
7373
current system user.
7474
</para>
@@ -79,18 +79,18 @@ PostgreSQL documentation
7979
<term><replaceable class="parameter">description</replaceable></term>
8080
<listitem>
8181
<para>
82-
This optionally specifies a comment to be associated with the newly created
83-
database.
82+
Specifies a comment to be associated with the newly created
83+
database.
8484
</para>
8585
</listitem>
8686
</varlistentry>
8787

8888
<varlistentry>
89-
<term><option>-D <replaceable class="parameter">location</replaceable></></term>
90-
<term><option>--location <replaceable class="parameter">location</replaceable></></term>
89+
<term><option>-D <replaceable class="parameter">tablespace</replaceable></></term>
90+
<term><option>--tablespace <replaceable class="parameter">tablespace</replaceable></></term>
9191
<listitem>
9292
<para>
93-
Specifies the alternative location for the database.
93+
Specifies the default tablespace for the database.
9494
</para>
9595
</listitem>
9696
</varlistentry>
@@ -101,7 +101,7 @@ PostgreSQL documentation
101101
<listitem>
102102
<para>
103103
Echo the commands that <application>createdb</application> generates
104-
and sends to the server.
104+
and sends to the server.
105105
</para>
106106
</listitem>
107107
</varlistentry>
@@ -124,7 +124,7 @@ PostgreSQL documentation
124124
<term><option>--owner <replaceable class="parameter">owner</replaceable></></term>
125125
<listitem>
126126
<para>
127-
Specifies the database user who will own the new database.
127+
Specifies the database user who will own the new database.
128128
</para>
129129
</listitem>
130130
</varlistentry>
@@ -170,9 +170,9 @@ PostgreSQL documentation
170170
<term><option>--host <replaceable class="parameter">host</replaceable></></term>
171171
<listitem>
172172
<para>
173-
Specifies the host name of the machine on which the
174-
server is running. If the value begins with a slash, it is used
175-
as the directory for the Unix domain socket.
173+
Specifies the host name of the machine on which the
174+
server is running. If the value begins with a slash, it is used
175+
as the directory for the Unix domain socket.
176176
</para>
177177
</listitem>
178178
</varlistentry>
@@ -182,8 +182,8 @@ PostgreSQL documentation
182182
<term><option>--port <replaceable class="parameter">port</replaceable></></term>
183183
<listitem>
184184
<para>
185-
Specifies the TCP port or the local Unix domain socket file
186-
extension on which the server is listening for connections.
185+
Specifies the TCP port or the local Unix domain socket file
186+
extension on which the server is listening for connections.
187187
</para>
188188
</listitem>
189189
</varlistentry>

src/bin/scripts/createdb.c

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.11 2004/06/03 00:07:38 momjian Exp $
8+
* $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.12 2004/06/18 21:47:24 tgl Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -31,7 +31,7 @@ main(int argc, char *argv[])
3131
{"echo", no_argument, NULL, 'e'},
3232
{"quiet", no_argument, NULL, 'q'},
3333
{"owner", required_argument, NULL, 'O'},
34-
{"location", required_argument, NULL, 'D'},
34+
{"tablespace", required_argument, NULL, 'D'},
3535
{"template", required_argument, NULL, 'T'},
3636
{"encoding", required_argument, NULL, 'E'},
3737
{NULL, 0, NULL, 0}
@@ -50,7 +50,7 @@ main(int argc, char *argv[])
5050
bool echo = false;
5151
bool quiet = false;
5252
char *owner = NULL;
53-
char *location = NULL;
53+
char *tablespace = NULL;
5454
char *template = NULL;
5555
char *encoding = NULL;
5656

@@ -90,7 +90,7 @@ main(int argc, char *argv[])
9090
owner = optarg;
9191
break;
9292
case 'D':
93-
location = optarg;
93+
tablespace = optarg;
9494
break;
9595
case 'T':
9696
template = optarg;
@@ -149,11 +149,8 @@ main(int argc, char *argv[])
149149

150150
if (owner)
151151
appendPQExpBuffer(&sql, " OWNER %s", fmtId(owner));
152-
if (location)
153-
{
154-
appendPQExpBuffer(&sql, " LOCATION ");
155-
appendStringLiteral(&sql, location, false);
156-
}
152+
if (tablespace)
153+
appendPQExpBuffer(&sql, " TABLESPACE %s", fmtId(tablespace));
157154
if (encoding)
158155
appendPQExpBuffer(&sql, " ENCODING '%s'", encoding);
159156
if (template)
@@ -221,19 +218,19 @@ help(const char *progname)
221218
printf(_("Usage:\n"));
222219
printf(_(" %s [OPTION]... [DBNAME] [DESCRIPTION]\n"), progname);
223220
printf(_("\nOptions:\n"));
224-
printf(_(" -D, --location=PATH alternative place to store the database\n"));
225-
printf(_(" -E, --encoding=ENCODING encoding for the database\n"));
226-
printf(_(" -O, --owner=OWNER database user to own the new database\n"));
227-
printf(_(" -T, --template=TEMPLATE template database to copy\n"));
228-
printf(_(" -e, --echo show the commands being sent to the server\n"));
229-
printf(_(" -q, --quiet don't write any messages\n"));
230-
printf(_(" --help show this help, then exit\n"));
231-
printf(_(" --version output version information, then exit\n"));
221+
printf(_(" -D, --tablespace=TABLESPACE default tablespace for the database\n"));
222+
printf(_(" -E, --encoding=ENCODING encoding for the database\n"));
223+
printf(_(" -O, --owner=OWNER database user to own the new database\n"));
224+
printf(_(" -T, --template=TEMPLATE template database to copy\n"));
225+
printf(_(" -e, --echo show the commands being sent to the server\n"));
226+
printf(_(" -q, --quiet don't write any messages\n"));
227+
printf(_(" --help show this help, then exit\n"));
228+
printf(_(" --version output version information, then exit\n"));
232229
printf(_("\nConnection options:\n"));
233-
printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));
234-
printf(_(" -p, --port=PORT database server port\n"));
235-
printf(_(" -U, --username=USERNAME user name to connect as\n"));
236-
printf(_(" -W, --password prompt for password\n"));
230+
printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));
231+
printf(_(" -p, --port=PORT database server port\n"));
232+
printf(_(" -U, --username=USERNAME user name to connect as\n"));
233+
printf(_(" -W, --password prompt for password\n"));
237234
printf(_("\nBy default, a database with the same name as the current user is created.\n"));
238235
printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"));
239236
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy