2003-03-18 23:19:47 +01:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* createdb
|
|
|
|
*
|
2022-01-08 01:04:57 +01:00
|
|
|
* Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
|
2003-03-18 23:19:47 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/bin/scripts/createdb.c
|
2003-03-18 23:19:47 +01:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#include "postgres_fe.h"
|
2007-10-13 22:18:42 +02:00
|
|
|
|
2003-03-18 23:19:47 +01:00
|
|
|
#include "common.h"
|
2019-05-14 20:19:49 +02:00
|
|
|
#include "common/logging.h"
|
Move some code from src/bin/scripts to src/fe_utils to permit reuse.
The parallel slots infrastructure (which implements client-side
multiplexing of server connections doing similar things, not
threading or multiple processes or anything like that) are moved from
src/bin/scripts/scripts_parallel.c to src/fe_utils/parallel_slot.c.
The functions consumeQueryResult() and processQueryResult() which were
previously part of src/bin/scripts/common.c are now moved into that
file as well, becoming static helper functions. This might need to be
changed in the future, but currently they're not used for anything
else.
Some other functions from src/bin/scripts/common.c are moved to to
src/fe_utils and are split up among several files. connectDatabase(),
connectMaintenanceDatabase(), and disconnectDatabase() are moved to
connect_utils.c. executeQuery(), executeCommand(), and
executeMaintenanceCommand() are move to query_utils.c.
handle_help_version_opts() is moved to option_utils.c.
Mark Dilger, reviewed by me. The larger patch series of which this is
a part has also had review from Peter Geoghegan, Andres Freund, Álvaro
Herrera, Michael Paquier, and Amul Sul, but I don't know whether any
of them have reviewed this bit specifically.
Discussion: http://postgr.es/m/12ED3DA8-25F0-4B68-937D-D907CFBF08E7@enterprisedb.com
Discussion: http://postgr.es/m/5F743835-3399-419C-8324-2D424237E999@enterprisedb.com
Discussion: http://postgr.es/m/70655DF3-33CE-4527-9A4D-DDEB582B6BA0@enterprisedb.com
2021-02-05 19:33:38 +01:00
|
|
|
#include "fe_utils/option_utils.h"
|
2016-03-24 20:55:44 +01:00
|
|
|
#include "fe_utils/string_utils.h"
|
2003-03-18 23:19:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
static void help(const char *progname);
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
static struct option long_options[] = {
|
|
|
|
{"host", required_argument, NULL, 'h'},
|
|
|
|
{"port", required_argument, NULL, 'p'},
|
|
|
|
{"username", required_argument, NULL, 'U'},
|
2009-02-26 17:02:39 +01:00
|
|
|
{"no-password", no_argument, NULL, 'w'},
|
2003-03-18 23:19:47 +01:00
|
|
|
{"password", no_argument, NULL, 'W'},
|
|
|
|
{"echo", no_argument, NULL, 'e'},
|
|
|
|
{"owner", required_argument, NULL, 'O'},
|
2004-06-18 23:47:24 +02:00
|
|
|
{"tablespace", required_argument, NULL, 'D'},
|
2003-03-18 23:19:47 +01:00
|
|
|
{"template", required_argument, NULL, 'T'},
|
|
|
|
{"encoding", required_argument, NULL, 'E'},
|
Add new block-by-block strategy for CREATE DATABASE.
Because this strategy logs changes on a block-by-block basis, it
avoids the need to checkpoint before and after the operation.
However, because it logs each changed block individually, it might
generate a lot of extra write-ahead logging if the template database
is large. Therefore, the older strategy remains available via a new
STRATEGY parameter to CREATE DATABASE, and a corresponding --strategy
option to createdb.
Somewhat controversially, this patch assembles the list of relations
to be copied to the new database by reading the pg_class relation of
the template database. Cross-database access like this isn't normally
possible, but it can be made to work here because there can't be any
connections to the database being copied, nor can it contain any
in-doubt transactions. Even so, we have to use lower-level interfaces
than normal, since the table scan and relcache interfaces will not
work for a database to which we're not connected. The advantage of
this approach is that we do not need to rely on the filesystem to
determine what ought to be copied, but instead on PostgreSQL's own
knowledge of the database structure. This avoids, for example,
copying stray files that happen to be located in the source database
directory.
Dilip Kumar, with a fairly large number of cosmetic changes by me.
Reviewed and tested by Ashutosh Sharma, Andres Freund, John Naylor,
Greg Nancarrow, Neha Sharma. Additional feedback from Bruce Momjian,
Heikki Linnakangas, Julien Rouhaud, Adam Brusselback, Kyotaro
Horiguchi, Tomas Vondra, Andrew Dunstan, Álvaro Herrera, and others.
Discussion: http://postgr.es/m/CA+TgmoYtcdxBjLh31DLxUXHxFVMPGzrU5_T=CYCvRyFHywSBUQ@mail.gmail.com
2022-03-29 17:31:43 +02:00
|
|
|
{"strategy", required_argument, NULL, 'S'},
|
2008-09-23 11:20:39 +02:00
|
|
|
{"lc-collate", required_argument, NULL, 1},
|
|
|
|
{"lc-ctype", required_argument, NULL, 2},
|
2008-11-10 17:25:41 +01:00
|
|
|
{"locale", required_argument, NULL, 'l'},
|
2011-12-06 14:48:15 +01:00
|
|
|
{"maintenance-db", required_argument, NULL, 3},
|
2022-03-17 11:11:21 +01:00
|
|
|
{"locale-provider", required_argument, NULL, 4},
|
|
|
|
{"icu-locale", required_argument, NULL, 5},
|
2003-03-18 23:19:47 +01:00
|
|
|
{NULL, 0, NULL, 0}
|
|
|
|
};
|
|
|
|
|
2004-05-12 15:38:49 +02:00
|
|
|
const char *progname;
|
2003-03-18 23:19:47 +01:00
|
|
|
int optindex;
|
|
|
|
int c;
|
|
|
|
|
|
|
|
const char *dbname = NULL;
|
2011-12-06 14:48:15 +01:00
|
|
|
const char *maintenance_db = NULL;
|
2003-03-18 23:19:47 +01:00
|
|
|
char *comment = NULL;
|
|
|
|
char *host = NULL;
|
|
|
|
char *port = NULL;
|
|
|
|
char *username = NULL;
|
2009-02-26 17:02:39 +01:00
|
|
|
enum trivalue prompt_password = TRI_DEFAULT;
|
Fix connection string handling in src/bin/scripts/ programs.
When told to process all databases, clusterdb, reindexdb, and vacuumdb
would reconnect by replacing their --maintenance-db parameter with the
name of the target database. If that parameter is a connstring (which
has been allowed for a long time, though we failed to document that
before this patch), we'd lose any other options it might specify, for
example SSL or GSS parameters, possibly resulting in failure to connect.
Thus, this is the same bug as commit a45bc8a4f fixed in pg_dump and
pg_restore. We can fix it in the same way, by using libpq's rules for
handling multiple "dbname" parameters to add the target database name
separately. I chose to apply the same refactoring approach as in that
patch, with a struct to handle the command line parameters that need to
be passed through to connectDatabase. (Maybe someday we can unify the
very similar functions here and in pg_dump/pg_restore.)
Per Peter Eisentraut's comments on bug #16604. Back-patch to all
supported branches.
Discussion: https://postgr.es/m/16604-933f4b8791227b15@postgresql.org
2020-10-20 01:03:46 +02:00
|
|
|
ConnParams cparams;
|
2003-03-18 23:19:47 +01:00
|
|
|
bool echo = false;
|
|
|
|
char *owner = NULL;
|
2004-06-18 23:47:24 +02:00
|
|
|
char *tablespace = NULL;
|
2003-03-18 23:19:47 +01:00
|
|
|
char *template = NULL;
|
|
|
|
char *encoding = NULL;
|
Add new block-by-block strategy for CREATE DATABASE.
Because this strategy logs changes on a block-by-block basis, it
avoids the need to checkpoint before and after the operation.
However, because it logs each changed block individually, it might
generate a lot of extra write-ahead logging if the template database
is large. Therefore, the older strategy remains available via a new
STRATEGY parameter to CREATE DATABASE, and a corresponding --strategy
option to createdb.
Somewhat controversially, this patch assembles the list of relations
to be copied to the new database by reading the pg_class relation of
the template database. Cross-database access like this isn't normally
possible, but it can be made to work here because there can't be any
connections to the database being copied, nor can it contain any
in-doubt transactions. Even so, we have to use lower-level interfaces
than normal, since the table scan and relcache interfaces will not
work for a database to which we're not connected. The advantage of
this approach is that we do not need to rely on the filesystem to
determine what ought to be copied, but instead on PostgreSQL's own
knowledge of the database structure. This avoids, for example,
copying stray files that happen to be located in the source database
directory.
Dilip Kumar, with a fairly large number of cosmetic changes by me.
Reviewed and tested by Ashutosh Sharma, Andres Freund, John Naylor,
Greg Nancarrow, Neha Sharma. Additional feedback from Bruce Momjian,
Heikki Linnakangas, Julien Rouhaud, Adam Brusselback, Kyotaro
Horiguchi, Tomas Vondra, Andrew Dunstan, Álvaro Herrera, and others.
Discussion: http://postgr.es/m/CA+TgmoYtcdxBjLh31DLxUXHxFVMPGzrU5_T=CYCvRyFHywSBUQ@mail.gmail.com
2022-03-29 17:31:43 +02:00
|
|
|
char *strategy = NULL;
|
2008-09-23 11:20:39 +02:00
|
|
|
char *lc_collate = NULL;
|
|
|
|
char *lc_ctype = NULL;
|
2008-11-10 17:25:41 +01:00
|
|
|
char *locale = NULL;
|
2022-03-17 11:11:21 +01:00
|
|
|
char *locale_provider = NULL;
|
|
|
|
char *icu_locale = NULL;
|
2003-03-18 23:19:47 +01:00
|
|
|
|
|
|
|
PQExpBufferData sql;
|
|
|
|
|
|
|
|
PGconn *conn;
|
|
|
|
PGresult *result;
|
|
|
|
|
Unified logging system for command-line programs
This unifies the various ad hoc logging (message printing, error
printing) systems used throughout the command-line programs.
Features:
- Program name is automatically prefixed.
- Message string does not end with newline. This removes a common
source of inconsistencies and omissions.
- Additionally, a final newline is automatically stripped, simplifying
use of PQerrorMessage() etc., another common source of mistakes.
- I converted error message strings to use %m where possible.
- As a result of the above several points, more translatable message
strings can be shared between different components and between
frontends and backend, without gratuitous punctuation or whitespace
differences.
- There is support for setting a "log level". This is not meant to be
user-facing, but can be used internally to implement debug or
verbose modes.
- Lazy argument evaluation, so no significant overhead if logging at
some level is disabled.
- Some color in the messages, similar to gcc and clang. Set
PG_COLOR=auto to try it out. Some colors are predefined, but can be
customized by setting PG_COLORS.
- Common files (common/, fe_utils/, etc.) can handle logging much more
simply by just using one API without worrying too much about the
context of the calling program, requiring callbacks, or having to
pass "progname" around everywhere.
- Some programs called setvbuf() to make sure that stderr is
unbuffered, even on Windows. But not all programs did that. This
is now done centrally.
Soft goals:
- Reduces vertical space use and visual complexity of error reporting
in the source code.
- Encourages more deliberate classification of messages. For example,
in some cases it wasn't clear without analyzing the surrounding code
whether a message was meant as an error or just an info.
- Concepts and terms are vaguely aligned with popular logging
frameworks such as log4j and Python logging.
This is all just about printing stuff out. Nothing affects program
flow (e.g., fatal exits). The uses are just too varied to do that.
Some existing code had wrappers that do some kind of print-and-exit,
and I adapted those.
I tried to keep the output mostly the same, but there is a lot of
historical baggage to unwind and special cases to consider, and I
might not always have succeeded. One significant change is that
pg_rewind used to write all error messages to stdout. That is now
changed to stderr.
Reviewed-by: Donald Dong <xdong@csumb.edu>
Reviewed-by: Arthur Zakirov <a.zakirov@postgrespro.ru>
Discussion: https://www.postgresql.org/message-id/flat/6a609b43-4f57-7348-6480-bd022f924310@2ndquadrant.com
2019-04-01 14:24:37 +02:00
|
|
|
pg_logging_init(argv[0]);
|
2003-03-18 23:19:47 +01:00
|
|
|
progname = get_progname(argv[0]);
|
2008-12-11 08:34:09 +01:00
|
|
|
set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pgscripts"));
|
2004-06-01 04:54:09 +02:00
|
|
|
|
2003-03-18 23:19:47 +01:00
|
|
|
handle_help_version_opts(argc, argv, "createdb", help);
|
|
|
|
|
Add new block-by-block strategy for CREATE DATABASE.
Because this strategy logs changes on a block-by-block basis, it
avoids the need to checkpoint before and after the operation.
However, because it logs each changed block individually, it might
generate a lot of extra write-ahead logging if the template database
is large. Therefore, the older strategy remains available via a new
STRATEGY parameter to CREATE DATABASE, and a corresponding --strategy
option to createdb.
Somewhat controversially, this patch assembles the list of relations
to be copied to the new database by reading the pg_class relation of
the template database. Cross-database access like this isn't normally
possible, but it can be made to work here because there can't be any
connections to the database being copied, nor can it contain any
in-doubt transactions. Even so, we have to use lower-level interfaces
than normal, since the table scan and relcache interfaces will not
work for a database to which we're not connected. The advantage of
this approach is that we do not need to rely on the filesystem to
determine what ought to be copied, but instead on PostgreSQL's own
knowledge of the database structure. This avoids, for example,
copying stray files that happen to be located in the source database
directory.
Dilip Kumar, with a fairly large number of cosmetic changes by me.
Reviewed and tested by Ashutosh Sharma, Andres Freund, John Naylor,
Greg Nancarrow, Neha Sharma. Additional feedback from Bruce Momjian,
Heikki Linnakangas, Julien Rouhaud, Adam Brusselback, Kyotaro
Horiguchi, Tomas Vondra, Andrew Dunstan, Álvaro Herrera, and others.
Discussion: http://postgr.es/m/CA+TgmoYtcdxBjLh31DLxUXHxFVMPGzrU5_T=CYCvRyFHywSBUQ@mail.gmail.com
2022-03-29 17:31:43 +02:00
|
|
|
while ((c = getopt_long(argc, argv, "h:p:U:wWeO:D:T:E:l:S:", long_options, &optindex)) != -1)
|
2003-03-18 23:19:47 +01:00
|
|
|
{
|
|
|
|
switch (c)
|
|
|
|
{
|
|
|
|
case 'h':
|
2012-10-12 19:35:40 +02:00
|
|
|
host = pg_strdup(optarg);
|
2003-03-18 23:19:47 +01:00
|
|
|
break;
|
|
|
|
case 'p':
|
2012-10-12 19:35:40 +02:00
|
|
|
port = pg_strdup(optarg);
|
2003-03-18 23:19:47 +01:00
|
|
|
break;
|
|
|
|
case 'U':
|
2012-10-12 19:35:40 +02:00
|
|
|
username = pg_strdup(optarg);
|
2003-03-18 23:19:47 +01:00
|
|
|
break;
|
2009-02-26 17:02:39 +01:00
|
|
|
case 'w':
|
|
|
|
prompt_password = TRI_NO;
|
|
|
|
break;
|
2003-03-18 23:19:47 +01:00
|
|
|
case 'W':
|
2009-02-26 17:02:39 +01:00
|
|
|
prompt_password = TRI_YES;
|
2003-03-18 23:19:47 +01:00
|
|
|
break;
|
|
|
|
case 'e':
|
|
|
|
echo = true;
|
|
|
|
break;
|
|
|
|
case 'O':
|
2012-10-12 19:35:40 +02:00
|
|
|
owner = pg_strdup(optarg);
|
2003-03-18 23:19:47 +01:00
|
|
|
break;
|
|
|
|
case 'D':
|
2012-10-12 19:35:40 +02:00
|
|
|
tablespace = pg_strdup(optarg);
|
2003-03-18 23:19:47 +01:00
|
|
|
break;
|
|
|
|
case 'T':
|
2012-10-12 19:35:40 +02:00
|
|
|
template = pg_strdup(optarg);
|
2003-03-18 23:19:47 +01:00
|
|
|
break;
|
|
|
|
case 'E':
|
2012-10-12 19:35:40 +02:00
|
|
|
encoding = pg_strdup(optarg);
|
2003-03-18 23:19:47 +01:00
|
|
|
break;
|
Add new block-by-block strategy for CREATE DATABASE.
Because this strategy logs changes on a block-by-block basis, it
avoids the need to checkpoint before and after the operation.
However, because it logs each changed block individually, it might
generate a lot of extra write-ahead logging if the template database
is large. Therefore, the older strategy remains available via a new
STRATEGY parameter to CREATE DATABASE, and a corresponding --strategy
option to createdb.
Somewhat controversially, this patch assembles the list of relations
to be copied to the new database by reading the pg_class relation of
the template database. Cross-database access like this isn't normally
possible, but it can be made to work here because there can't be any
connections to the database being copied, nor can it contain any
in-doubt transactions. Even so, we have to use lower-level interfaces
than normal, since the table scan and relcache interfaces will not
work for a database to which we're not connected. The advantage of
this approach is that we do not need to rely on the filesystem to
determine what ought to be copied, but instead on PostgreSQL's own
knowledge of the database structure. This avoids, for example,
copying stray files that happen to be located in the source database
directory.
Dilip Kumar, with a fairly large number of cosmetic changes by me.
Reviewed and tested by Ashutosh Sharma, Andres Freund, John Naylor,
Greg Nancarrow, Neha Sharma. Additional feedback from Bruce Momjian,
Heikki Linnakangas, Julien Rouhaud, Adam Brusselback, Kyotaro
Horiguchi, Tomas Vondra, Andrew Dunstan, Álvaro Herrera, and others.
Discussion: http://postgr.es/m/CA+TgmoYtcdxBjLh31DLxUXHxFVMPGzrU5_T=CYCvRyFHywSBUQ@mail.gmail.com
2022-03-29 17:31:43 +02:00
|
|
|
case 'S':
|
|
|
|
strategy = pg_strdup(optarg);
|
|
|
|
break;
|
2008-09-23 11:20:39 +02:00
|
|
|
case 1:
|
2012-10-12 19:35:40 +02:00
|
|
|
lc_collate = pg_strdup(optarg);
|
2008-09-23 11:20:39 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-10-12 19:35:40 +02:00
|
|
|
lc_ctype = pg_strdup(optarg);
|
2008-09-23 11:20:39 +02:00
|
|
|
break;
|
2008-11-10 17:25:41 +01:00
|
|
|
case 'l':
|
2012-10-12 19:35:40 +02:00
|
|
|
locale = pg_strdup(optarg);
|
2008-11-10 17:25:41 +01:00
|
|
|
break;
|
2011-12-06 14:48:15 +01:00
|
|
|
case 3:
|
2012-10-12 19:35:40 +02:00
|
|
|
maintenance_db = pg_strdup(optarg);
|
2011-12-06 14:48:15 +01:00
|
|
|
break;
|
2022-03-17 11:11:21 +01:00
|
|
|
case 4:
|
|
|
|
locale_provider = pg_strdup(optarg);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
icu_locale = pg_strdup(optarg);
|
|
|
|
break;
|
2003-03-18 23:19:47 +01:00
|
|
|
default:
|
2003-07-23 10:47:41 +02:00
|
|
|
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
|
2003-03-18 23:19:47 +01:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (argc - optind)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
dbname = argv[optind];
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
dbname = argv[optind];
|
|
|
|
comment = argv[optind + 1];
|
|
|
|
break;
|
|
|
|
default:
|
Unified logging system for command-line programs
This unifies the various ad hoc logging (message printing, error
printing) systems used throughout the command-line programs.
Features:
- Program name is automatically prefixed.
- Message string does not end with newline. This removes a common
source of inconsistencies and omissions.
- Additionally, a final newline is automatically stripped, simplifying
use of PQerrorMessage() etc., another common source of mistakes.
- I converted error message strings to use %m where possible.
- As a result of the above several points, more translatable message
strings can be shared between different components and between
frontends and backend, without gratuitous punctuation or whitespace
differences.
- There is support for setting a "log level". This is not meant to be
user-facing, but can be used internally to implement debug or
verbose modes.
- Lazy argument evaluation, so no significant overhead if logging at
some level is disabled.
- Some color in the messages, similar to gcc and clang. Set
PG_COLOR=auto to try it out. Some colors are predefined, but can be
customized by setting PG_COLORS.
- Common files (common/, fe_utils/, etc.) can handle logging much more
simply by just using one API without worrying too much about the
context of the calling program, requiring callbacks, or having to
pass "progname" around everywhere.
- Some programs called setvbuf() to make sure that stderr is
unbuffered, even on Windows. But not all programs did that. This
is now done centrally.
Soft goals:
- Reduces vertical space use and visual complexity of error reporting
in the source code.
- Encourages more deliberate classification of messages. For example,
in some cases it wasn't clear without analyzing the surrounding code
whether a message was meant as an error or just an info.
- Concepts and terms are vaguely aligned with popular logging
frameworks such as log4j and Python logging.
This is all just about printing stuff out. Nothing affects program
flow (e.g., fatal exits). The uses are just too varied to do that.
Some existing code had wrappers that do some kind of print-and-exit,
and I adapted those.
I tried to keep the output mostly the same, but there is a lot of
historical baggage to unwind and special cases to consider, and I
might not always have succeeded. One significant change is that
pg_rewind used to write all error messages to stdout. That is now
changed to stderr.
Reviewed-by: Donald Dong <xdong@csumb.edu>
Reviewed-by: Arthur Zakirov <a.zakirov@postgrespro.ru>
Discussion: https://www.postgresql.org/message-id/flat/6a609b43-4f57-7348-6480-bd022f924310@2ndquadrant.com
2019-04-01 14:24:37 +02:00
|
|
|
pg_log_error("too many command-line arguments (first is \"%s\")",
|
|
|
|
argv[optind + 2]);
|
2003-07-23 10:47:41 +02:00
|
|
|
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
|
2003-03-18 23:19:47 +01:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2008-11-10 17:25:41 +01:00
|
|
|
if (locale)
|
|
|
|
{
|
|
|
|
if (lc_ctype)
|
|
|
|
{
|
Unified logging system for command-line programs
This unifies the various ad hoc logging (message printing, error
printing) systems used throughout the command-line programs.
Features:
- Program name is automatically prefixed.
- Message string does not end with newline. This removes a common
source of inconsistencies and omissions.
- Additionally, a final newline is automatically stripped, simplifying
use of PQerrorMessage() etc., another common source of mistakes.
- I converted error message strings to use %m where possible.
- As a result of the above several points, more translatable message
strings can be shared between different components and between
frontends and backend, without gratuitous punctuation or whitespace
differences.
- There is support for setting a "log level". This is not meant to be
user-facing, but can be used internally to implement debug or
verbose modes.
- Lazy argument evaluation, so no significant overhead if logging at
some level is disabled.
- Some color in the messages, similar to gcc and clang. Set
PG_COLOR=auto to try it out. Some colors are predefined, but can be
customized by setting PG_COLORS.
- Common files (common/, fe_utils/, etc.) can handle logging much more
simply by just using one API without worrying too much about the
context of the calling program, requiring callbacks, or having to
pass "progname" around everywhere.
- Some programs called setvbuf() to make sure that stderr is
unbuffered, even on Windows. But not all programs did that. This
is now done centrally.
Soft goals:
- Reduces vertical space use and visual complexity of error reporting
in the source code.
- Encourages more deliberate classification of messages. For example,
in some cases it wasn't clear without analyzing the surrounding code
whether a message was meant as an error or just an info.
- Concepts and terms are vaguely aligned with popular logging
frameworks such as log4j and Python logging.
This is all just about printing stuff out. Nothing affects program
flow (e.g., fatal exits). The uses are just too varied to do that.
Some existing code had wrappers that do some kind of print-and-exit,
and I adapted those.
I tried to keep the output mostly the same, but there is a lot of
historical baggage to unwind and special cases to consider, and I
might not always have succeeded. One significant change is that
pg_rewind used to write all error messages to stdout. That is now
changed to stderr.
Reviewed-by: Donald Dong <xdong@csumb.edu>
Reviewed-by: Arthur Zakirov <a.zakirov@postgrespro.ru>
Discussion: https://www.postgresql.org/message-id/flat/6a609b43-4f57-7348-6480-bd022f924310@2ndquadrant.com
2019-04-01 14:24:37 +02:00
|
|
|
pg_log_error("only one of --locale and --lc-ctype can be specified");
|
2008-11-10 17:25:41 +01:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (lc_collate)
|
|
|
|
{
|
Unified logging system for command-line programs
This unifies the various ad hoc logging (message printing, error
printing) systems used throughout the command-line programs.
Features:
- Program name is automatically prefixed.
- Message string does not end with newline. This removes a common
source of inconsistencies and omissions.
- Additionally, a final newline is automatically stripped, simplifying
use of PQerrorMessage() etc., another common source of mistakes.
- I converted error message strings to use %m where possible.
- As a result of the above several points, more translatable message
strings can be shared between different components and between
frontends and backend, without gratuitous punctuation or whitespace
differences.
- There is support for setting a "log level". This is not meant to be
user-facing, but can be used internally to implement debug or
verbose modes.
- Lazy argument evaluation, so no significant overhead if logging at
some level is disabled.
- Some color in the messages, similar to gcc and clang. Set
PG_COLOR=auto to try it out. Some colors are predefined, but can be
customized by setting PG_COLORS.
- Common files (common/, fe_utils/, etc.) can handle logging much more
simply by just using one API without worrying too much about the
context of the calling program, requiring callbacks, or having to
pass "progname" around everywhere.
- Some programs called setvbuf() to make sure that stderr is
unbuffered, even on Windows. But not all programs did that. This
is now done centrally.
Soft goals:
- Reduces vertical space use and visual complexity of error reporting
in the source code.
- Encourages more deliberate classification of messages. For example,
in some cases it wasn't clear without analyzing the surrounding code
whether a message was meant as an error or just an info.
- Concepts and terms are vaguely aligned with popular logging
frameworks such as log4j and Python logging.
This is all just about printing stuff out. Nothing affects program
flow (e.g., fatal exits). The uses are just too varied to do that.
Some existing code had wrappers that do some kind of print-and-exit,
and I adapted those.
I tried to keep the output mostly the same, but there is a lot of
historical baggage to unwind and special cases to consider, and I
might not always have succeeded. One significant change is that
pg_rewind used to write all error messages to stdout. That is now
changed to stderr.
Reviewed-by: Donald Dong <xdong@csumb.edu>
Reviewed-by: Arthur Zakirov <a.zakirov@postgrespro.ru>
Discussion: https://www.postgresql.org/message-id/flat/6a609b43-4f57-7348-6480-bd022f924310@2ndquadrant.com
2019-04-01 14:24:37 +02:00
|
|
|
pg_log_error("only one of --locale and --lc-collate can be specified");
|
2008-11-10 17:25:41 +01:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
lc_ctype = locale;
|
|
|
|
lc_collate = locale;
|
|
|
|
}
|
|
|
|
|
2003-03-18 23:19:47 +01:00
|
|
|
if (encoding)
|
|
|
|
{
|
|
|
|
if (pg_char_to_encoding(encoding) < 0)
|
|
|
|
{
|
Unified logging system for command-line programs
This unifies the various ad hoc logging (message printing, error
printing) systems used throughout the command-line programs.
Features:
- Program name is automatically prefixed.
- Message string does not end with newline. This removes a common
source of inconsistencies and omissions.
- Additionally, a final newline is automatically stripped, simplifying
use of PQerrorMessage() etc., another common source of mistakes.
- I converted error message strings to use %m where possible.
- As a result of the above several points, more translatable message
strings can be shared between different components and between
frontends and backend, without gratuitous punctuation or whitespace
differences.
- There is support for setting a "log level". This is not meant to be
user-facing, but can be used internally to implement debug or
verbose modes.
- Lazy argument evaluation, so no significant overhead if logging at
some level is disabled.
- Some color in the messages, similar to gcc and clang. Set
PG_COLOR=auto to try it out. Some colors are predefined, but can be
customized by setting PG_COLORS.
- Common files (common/, fe_utils/, etc.) can handle logging much more
simply by just using one API without worrying too much about the
context of the calling program, requiring callbacks, or having to
pass "progname" around everywhere.
- Some programs called setvbuf() to make sure that stderr is
unbuffered, even on Windows. But not all programs did that. This
is now done centrally.
Soft goals:
- Reduces vertical space use and visual complexity of error reporting
in the source code.
- Encourages more deliberate classification of messages. For example,
in some cases it wasn't clear without analyzing the surrounding code
whether a message was meant as an error or just an info.
- Concepts and terms are vaguely aligned with popular logging
frameworks such as log4j and Python logging.
This is all just about printing stuff out. Nothing affects program
flow (e.g., fatal exits). The uses are just too varied to do that.
Some existing code had wrappers that do some kind of print-and-exit,
and I adapted those.
I tried to keep the output mostly the same, but there is a lot of
historical baggage to unwind and special cases to consider, and I
might not always have succeeded. One significant change is that
pg_rewind used to write all error messages to stdout. That is now
changed to stderr.
Reviewed-by: Donald Dong <xdong@csumb.edu>
Reviewed-by: Arthur Zakirov <a.zakirov@postgrespro.ru>
Discussion: https://www.postgresql.org/message-id/flat/6a609b43-4f57-7348-6480-bd022f924310@2ndquadrant.com
2019-04-01 14:24:37 +02:00
|
|
|
pg_log_error("\"%s\" is not a valid encoding name", encoding);
|
2003-03-18 23:19:47 +01:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dbname == NULL)
|
|
|
|
{
|
|
|
|
if (getenv("PGDATABASE"))
|
|
|
|
dbname = getenv("PGDATABASE");
|
|
|
|
else if (getenv("PGUSER"))
|
|
|
|
dbname = getenv("PGUSER");
|
|
|
|
else
|
2013-12-18 18:16:16 +01:00
|
|
|
dbname = get_user_name_or_exit(progname);
|
2003-03-18 23:19:47 +01:00
|
|
|
}
|
|
|
|
|
2020-02-27 03:20:46 +01:00
|
|
|
/* No point in trying to use postgres db when creating postgres db. */
|
|
|
|
if (maintenance_db == NULL && strcmp(dbname, "postgres") == 0)
|
|
|
|
maintenance_db = "template1";
|
|
|
|
|
Fix connection string handling in src/bin/scripts/ programs.
When told to process all databases, clusterdb, reindexdb, and vacuumdb
would reconnect by replacing their --maintenance-db parameter with the
name of the target database. If that parameter is a connstring (which
has been allowed for a long time, though we failed to document that
before this patch), we'd lose any other options it might specify, for
example SSL or GSS parameters, possibly resulting in failure to connect.
Thus, this is the same bug as commit a45bc8a4f fixed in pg_dump and
pg_restore. We can fix it in the same way, by using libpq's rules for
handling multiple "dbname" parameters to add the target database name
separately. I chose to apply the same refactoring approach as in that
patch, with a struct to handle the command line parameters that need to
be passed through to connectDatabase. (Maybe someday we can unify the
very similar functions here and in pg_dump/pg_restore.)
Per Peter Eisentraut's comments on bug #16604. Back-patch to all
supported branches.
Discussion: https://postgr.es/m/16604-933f4b8791227b15@postgresql.org
2020-10-20 01:03:46 +02:00
|
|
|
cparams.dbname = maintenance_db;
|
|
|
|
cparams.pghost = host;
|
|
|
|
cparams.pgport = port;
|
|
|
|
cparams.pguser = username;
|
|
|
|
cparams.prompt_password = prompt_password;
|
|
|
|
cparams.override_dbname = NULL;
|
|
|
|
|
|
|
|
conn = connectMaintenanceDatabase(&cparams, progname, echo);
|
2020-02-27 03:20:46 +01:00
|
|
|
|
2003-03-18 23:19:47 +01:00
|
|
|
initPQExpBuffer(&sql);
|
|
|
|
|
2003-05-14 05:26:03 +02:00
|
|
|
appendPQExpBuffer(&sql, "CREATE DATABASE %s",
|
2003-03-18 23:19:47 +01:00
|
|
|
fmtId(dbname));
|
|
|
|
|
|
|
|
if (owner)
|
|
|
|
appendPQExpBuffer(&sql, " OWNER %s", fmtId(owner));
|
2004-06-18 23:47:24 +02:00
|
|
|
if (tablespace)
|
|
|
|
appendPQExpBuffer(&sql, " TABLESPACE %s", fmtId(tablespace));
|
2003-03-18 23:19:47 +01:00
|
|
|
if (encoding)
|
2020-02-27 03:20:46 +01:00
|
|
|
{
|
|
|
|
appendPQExpBufferStr(&sql, " ENCODING ");
|
|
|
|
appendStringLiteralConn(&sql, encoding, conn);
|
|
|
|
}
|
Add new block-by-block strategy for CREATE DATABASE.
Because this strategy logs changes on a block-by-block basis, it
avoids the need to checkpoint before and after the operation.
However, because it logs each changed block individually, it might
generate a lot of extra write-ahead logging if the template database
is large. Therefore, the older strategy remains available via a new
STRATEGY parameter to CREATE DATABASE, and a corresponding --strategy
option to createdb.
Somewhat controversially, this patch assembles the list of relations
to be copied to the new database by reading the pg_class relation of
the template database. Cross-database access like this isn't normally
possible, but it can be made to work here because there can't be any
connections to the database being copied, nor can it contain any
in-doubt transactions. Even so, we have to use lower-level interfaces
than normal, since the table scan and relcache interfaces will not
work for a database to which we're not connected. The advantage of
this approach is that we do not need to rely on the filesystem to
determine what ought to be copied, but instead on PostgreSQL's own
knowledge of the database structure. This avoids, for example,
copying stray files that happen to be located in the source database
directory.
Dilip Kumar, with a fairly large number of cosmetic changes by me.
Reviewed and tested by Ashutosh Sharma, Andres Freund, John Naylor,
Greg Nancarrow, Neha Sharma. Additional feedback from Bruce Momjian,
Heikki Linnakangas, Julien Rouhaud, Adam Brusselback, Kyotaro
Horiguchi, Tomas Vondra, Andrew Dunstan, Álvaro Herrera, and others.
Discussion: http://postgr.es/m/CA+TgmoYtcdxBjLh31DLxUXHxFVMPGzrU5_T=CYCvRyFHywSBUQ@mail.gmail.com
2022-03-29 17:31:43 +02:00
|
|
|
if (strategy)
|
|
|
|
appendPQExpBuffer(&sql, " STRATEGY %s", fmtId(strategy));
|
2003-03-18 23:19:47 +01:00
|
|
|
if (template)
|
|
|
|
appendPQExpBuffer(&sql, " TEMPLATE %s", fmtId(template));
|
2008-09-23 11:20:39 +02:00
|
|
|
if (lc_collate)
|
2020-02-27 03:20:46 +01:00
|
|
|
{
|
|
|
|
appendPQExpBufferStr(&sql, " LC_COLLATE ");
|
|
|
|
appendStringLiteralConn(&sql, lc_collate, conn);
|
|
|
|
}
|
2008-09-23 11:20:39 +02:00
|
|
|
if (lc_ctype)
|
2020-02-27 03:20:46 +01:00
|
|
|
{
|
|
|
|
appendPQExpBufferStr(&sql, " LC_CTYPE ");
|
|
|
|
appendStringLiteralConn(&sql, lc_ctype, conn);
|
|
|
|
}
|
2022-03-17 11:11:21 +01:00
|
|
|
if (locale_provider)
|
|
|
|
appendPQExpBuffer(&sql, " LOCALE_PROVIDER %s", locale_provider);
|
|
|
|
if (icu_locale)
|
|
|
|
{
|
|
|
|
appendPQExpBufferStr(&sql, " ICU_LOCALE ");
|
|
|
|
appendStringLiteralConn(&sql, icu_locale, conn);
|
|
|
|
}
|
2008-09-23 11:20:39 +02:00
|
|
|
|
2015-07-02 11:32:48 +02:00
|
|
|
appendPQExpBufferChar(&sql, ';');
|
2003-03-18 23:19:47 +01:00
|
|
|
|
|
|
|
if (echo)
|
2014-02-11 03:47:19 +01:00
|
|
|
printf("%s\n", sql.data);
|
2003-03-18 23:19:47 +01:00
|
|
|
result = PQexec(conn, sql.data);
|
|
|
|
|
|
|
|
if (PQresultStatus(result) != PGRES_COMMAND_OK)
|
|
|
|
{
|
Unified logging system for command-line programs
This unifies the various ad hoc logging (message printing, error
printing) systems used throughout the command-line programs.
Features:
- Program name is automatically prefixed.
- Message string does not end with newline. This removes a common
source of inconsistencies and omissions.
- Additionally, a final newline is automatically stripped, simplifying
use of PQerrorMessage() etc., another common source of mistakes.
- I converted error message strings to use %m where possible.
- As a result of the above several points, more translatable message
strings can be shared between different components and between
frontends and backend, without gratuitous punctuation or whitespace
differences.
- There is support for setting a "log level". This is not meant to be
user-facing, but can be used internally to implement debug or
verbose modes.
- Lazy argument evaluation, so no significant overhead if logging at
some level is disabled.
- Some color in the messages, similar to gcc and clang. Set
PG_COLOR=auto to try it out. Some colors are predefined, but can be
customized by setting PG_COLORS.
- Common files (common/, fe_utils/, etc.) can handle logging much more
simply by just using one API without worrying too much about the
context of the calling program, requiring callbacks, or having to
pass "progname" around everywhere.
- Some programs called setvbuf() to make sure that stderr is
unbuffered, even on Windows. But not all programs did that. This
is now done centrally.
Soft goals:
- Reduces vertical space use and visual complexity of error reporting
in the source code.
- Encourages more deliberate classification of messages. For example,
in some cases it wasn't clear without analyzing the surrounding code
whether a message was meant as an error or just an info.
- Concepts and terms are vaguely aligned with popular logging
frameworks such as log4j and Python logging.
This is all just about printing stuff out. Nothing affects program
flow (e.g., fatal exits). The uses are just too varied to do that.
Some existing code had wrappers that do some kind of print-and-exit,
and I adapted those.
I tried to keep the output mostly the same, but there is a lot of
historical baggage to unwind and special cases to consider, and I
might not always have succeeded. One significant change is that
pg_rewind used to write all error messages to stdout. That is now
changed to stderr.
Reviewed-by: Donald Dong <xdong@csumb.edu>
Reviewed-by: Arthur Zakirov <a.zakirov@postgrespro.ru>
Discussion: https://www.postgresql.org/message-id/flat/6a609b43-4f57-7348-6480-bd022f924310@2ndquadrant.com
2019-04-01 14:24:37 +02:00
|
|
|
pg_log_error("database creation failed: %s", PQerrorMessage(conn));
|
2003-03-18 23:19:47 +01:00
|
|
|
PQfinish(conn);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
PQclear(result);
|
|
|
|
|
|
|
|
if (comment)
|
|
|
|
{
|
2003-05-14 05:26:03 +02:00
|
|
|
printfPQExpBuffer(&sql, "COMMENT ON DATABASE %s IS ", fmtId(dbname));
|
2006-05-28 23:13:54 +02:00
|
|
|
appendStringLiteralConn(&sql, comment, conn);
|
2015-07-02 11:32:48 +02:00
|
|
|
appendPQExpBufferChar(&sql, ';');
|
2003-03-18 23:19:47 +01:00
|
|
|
|
|
|
|
if (echo)
|
2014-02-11 03:47:19 +01:00
|
|
|
printf("%s\n", sql.data);
|
2003-03-18 23:19:47 +01:00
|
|
|
result = PQexec(conn, sql.data);
|
|
|
|
|
|
|
|
if (PQresultStatus(result) != PGRES_COMMAND_OK)
|
|
|
|
{
|
Unified logging system for command-line programs
This unifies the various ad hoc logging (message printing, error
printing) systems used throughout the command-line programs.
Features:
- Program name is automatically prefixed.
- Message string does not end with newline. This removes a common
source of inconsistencies and omissions.
- Additionally, a final newline is automatically stripped, simplifying
use of PQerrorMessage() etc., another common source of mistakes.
- I converted error message strings to use %m where possible.
- As a result of the above several points, more translatable message
strings can be shared between different components and between
frontends and backend, without gratuitous punctuation or whitespace
differences.
- There is support for setting a "log level". This is not meant to be
user-facing, but can be used internally to implement debug or
verbose modes.
- Lazy argument evaluation, so no significant overhead if logging at
some level is disabled.
- Some color in the messages, similar to gcc and clang. Set
PG_COLOR=auto to try it out. Some colors are predefined, but can be
customized by setting PG_COLORS.
- Common files (common/, fe_utils/, etc.) can handle logging much more
simply by just using one API without worrying too much about the
context of the calling program, requiring callbacks, or having to
pass "progname" around everywhere.
- Some programs called setvbuf() to make sure that stderr is
unbuffered, even on Windows. But not all programs did that. This
is now done centrally.
Soft goals:
- Reduces vertical space use and visual complexity of error reporting
in the source code.
- Encourages more deliberate classification of messages. For example,
in some cases it wasn't clear without analyzing the surrounding code
whether a message was meant as an error or just an info.
- Concepts and terms are vaguely aligned with popular logging
frameworks such as log4j and Python logging.
This is all just about printing stuff out. Nothing affects program
flow (e.g., fatal exits). The uses are just too varied to do that.
Some existing code had wrappers that do some kind of print-and-exit,
and I adapted those.
I tried to keep the output mostly the same, but there is a lot of
historical baggage to unwind and special cases to consider, and I
might not always have succeeded. One significant change is that
pg_rewind used to write all error messages to stdout. That is now
changed to stderr.
Reviewed-by: Donald Dong <xdong@csumb.edu>
Reviewed-by: Arthur Zakirov <a.zakirov@postgrespro.ru>
Discussion: https://www.postgresql.org/message-id/flat/6a609b43-4f57-7348-6480-bd022f924310@2ndquadrant.com
2019-04-01 14:24:37 +02:00
|
|
|
pg_log_error("comment creation failed (database was created): %s",
|
|
|
|
PQerrorMessage(conn));
|
2003-03-18 23:19:47 +01:00
|
|
|
PQfinish(conn);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2006-05-29 21:52:46 +02:00
|
|
|
PQclear(result);
|
2003-03-18 23:19:47 +01:00
|
|
|
}
|
|
|
|
|
2011-05-11 01:44:15 +02:00
|
|
|
PQfinish(conn);
|
|
|
|
|
2003-03-18 23:19:47 +01:00
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
help(const char *progname)
|
|
|
|
{
|
|
|
|
printf(_("%s creates a PostgreSQL database.\n\n"), progname);
|
|
|
|
printf(_("Usage:\n"));
|
|
|
|
printf(_(" %s [OPTION]... [DBNAME] [DESCRIPTION]\n"), progname);
|
|
|
|
printf(_("\nOptions:\n"));
|
2004-06-18 23:47:24 +02:00
|
|
|
printf(_(" -D, --tablespace=TABLESPACE default tablespace for the database\n"));
|
2009-02-25 14:03:07 +01:00
|
|
|
printf(_(" -e, --echo show the commands being sent to the server\n"));
|
2004-06-18 23:47:24 +02:00
|
|
|
printf(_(" -E, --encoding=ENCODING encoding for the database\n"));
|
2008-11-10 17:25:41 +01:00
|
|
|
printf(_(" -l, --locale=LOCALE locale settings for the database\n"));
|
2009-02-25 14:03:07 +01:00
|
|
|
printf(_(" --lc-collate=LOCALE LC_COLLATE setting for the database\n"));
|
|
|
|
printf(_(" --lc-ctype=LOCALE LC_CTYPE setting for the database\n"));
|
2022-03-17 11:11:21 +01:00
|
|
|
printf(_(" --icu-locale=LOCALE ICU locale setting for the database\n"));
|
|
|
|
printf(_(" --locale-provider={libc|icu}\n"
|
|
|
|
" locale provider for the database's default collation\n"));
|
2004-06-18 23:47:24 +02:00
|
|
|
printf(_(" -O, --owner=OWNER database user to own the new database\n"));
|
Add new block-by-block strategy for CREATE DATABASE.
Because this strategy logs changes on a block-by-block basis, it
avoids the need to checkpoint before and after the operation.
However, because it logs each changed block individually, it might
generate a lot of extra write-ahead logging if the template database
is large. Therefore, the older strategy remains available via a new
STRATEGY parameter to CREATE DATABASE, and a corresponding --strategy
option to createdb.
Somewhat controversially, this patch assembles the list of relations
to be copied to the new database by reading the pg_class relation of
the template database. Cross-database access like this isn't normally
possible, but it can be made to work here because there can't be any
connections to the database being copied, nor can it contain any
in-doubt transactions. Even so, we have to use lower-level interfaces
than normal, since the table scan and relcache interfaces will not
work for a database to which we're not connected. The advantage of
this approach is that we do not need to rely on the filesystem to
determine what ought to be copied, but instead on PostgreSQL's own
knowledge of the database structure. This avoids, for example,
copying stray files that happen to be located in the source database
directory.
Dilip Kumar, with a fairly large number of cosmetic changes by me.
Reviewed and tested by Ashutosh Sharma, Andres Freund, John Naylor,
Greg Nancarrow, Neha Sharma. Additional feedback from Bruce Momjian,
Heikki Linnakangas, Julien Rouhaud, Adam Brusselback, Kyotaro
Horiguchi, Tomas Vondra, Andrew Dunstan, Álvaro Herrera, and others.
Discussion: http://postgr.es/m/CA+TgmoYtcdxBjLh31DLxUXHxFVMPGzrU5_T=CYCvRyFHywSBUQ@mail.gmail.com
2022-03-29 17:31:43 +02:00
|
|
|
printf(_(" -S, --strategy=STRATEGY database creation strategy wal_log or file_copy\n"));
|
2004-06-18 23:47:24 +02:00
|
|
|
printf(_(" -T, --template=TEMPLATE template database to copy\n"));
|
2012-06-18 01:44:00 +02:00
|
|
|
printf(_(" -V, --version output version information, then exit\n"));
|
|
|
|
printf(_(" -?, --help show this help, then exit\n"));
|
2003-03-18 23:19:47 +01:00
|
|
|
printf(_("\nConnection options:\n"));
|
2004-06-18 23:47:24 +02:00
|
|
|
printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));
|
|
|
|
printf(_(" -p, --port=PORT database server port\n"));
|
|
|
|
printf(_(" -U, --username=USERNAME user name to connect as\n"));
|
2009-02-26 17:02:39 +01:00
|
|
|
printf(_(" -w, --no-password never prompt for password\n"));
|
2007-12-11 20:57:32 +01:00
|
|
|
printf(_(" -W, --password force password prompt\n"));
|
2011-12-06 14:48:15 +01:00
|
|
|
printf(_(" --maintenance-db=DBNAME alternate maintenance database\n"));
|
2003-03-18 23:19:47 +01:00
|
|
|
printf(_("\nBy default, a database with the same name as the current user is created.\n"));
|
2020-02-28 08:54:49 +01:00
|
|
|
printf(_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
2020-02-28 08:54:49 +01:00
|
|
|
printf(_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
|
2003-03-18 23:19:47 +01:00
|
|
|
}
|