aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_dumpall.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_dump/pg_dumpall.c')
-rw-r--r--src/bin/pg_dump/pg_dumpall.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index c3a76923740..ebea128a45c 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.11 2002/11/29 16:38:42 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.12 2003/01/06 18:53:25 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -25,6 +25,11 @@
#endif
#include <errno.h>
+#ifndef HAVE_GETOPT_LONG
+#include "getopt_long.h"
+int optreset;
+#endif
+
#include "dumputils.h"
#include "libpq-fe.h"
#include "pg_backup.h"
@@ -71,7 +76,6 @@ main(int argc, char *argv[])
PGconn *conn;
int c;
-#ifdef HAVE_GETOPT_LONG
static struct option long_options[] = {
{"clean", no_argument, NULL, 'c'},
{"inserts", no_argument, NULL, 'd'},
@@ -88,7 +92,6 @@ main(int argc, char *argv[])
};
int optindex;
-#endif
#ifdef ENABLE_NLS
setlocale(LC_ALL, "");
@@ -118,11 +121,7 @@ main(int argc, char *argv[])
pgdumploc = findPgDump(argv[0]);
pgdumpopts = createPQExpBuffer();
-#ifdef HAVE_GETOPT_LONG
while ((c = getopt_long(argc, argv, "cdDgh:iop:U:vW", long_options, &optindex)) != -1)
-#else
- while ((c = getopt(argc, argv, "cdDgh:iop:U:vW")) != -1)
-#endif
{
switch (c)
{
@@ -216,7 +215,6 @@ help(void)
printf(_(" %s [OPTION]...\n"), progname);
printf(_("\nOptions:\n"));
-#ifdef HAVE_GETOPT_LONG
printf(_(" -c, --clean clean (drop) databases prior to create\n"));
printf(_(" -d, --inserts dump data as INSERT, rather than COPY, commands\n"));
printf(_(" -D, --column-inserts dump data as INSERT commands with column names\n"));
@@ -225,31 +223,14 @@ help(void)
" pg_dumpall version\n"));
printf(_(" -o, --oids include OIDs in dump\n"));
printf(_(" -v, --verbose verbose mode\n"));
-#else /* not HAVE_GETOPT_LONG */
- printf(_(" -c clean (drop) databases prior to create\n"));
- printf(_(" -d dump data as INSERT, rather than COPY, commands\n"));
- printf(_(" -D dump data as INSERT commands with column names\n"));
- printf(_(" -g dump only global objects, no databases\n"));
- printf(_(" -i proceed even when server version mismatches\n"
- " pg_dumpall version\n"));
- printf(_(" -o include OIDs in dump\n"));
- printf(_(" -v verbose mode\n"));
-#endif /* not HAVE_GETOPT_LONG */
printf(_(" --help show this help, then exit\n"));
printf(_(" --version output version information, then exit\n"));
printf(_("\nConnection options:\n"));
-#ifdef HAVE_GETOPT_LONG
printf(_(" -h, --host=HOSTNAME database server host name\n"));
printf(_(" -p, --port=PORT database server port number\n"));
printf(_(" -U, --username=NAME connect as specified database user\n"));
printf(_(" -W, --password force password prompt (should happen automatically)\n"));
-#else /* not HAVE_GETOPT_LONG */
- printf(_(" -h HOSTNAME database server host name\n"));
- printf(_(" -p PORT database server port number\n"));
- printf(_(" -U NAME connect as specified database user\n"));
- printf(_(" -W force password prompt (should happen automatically)\n"));
-#endif /* not HAVE_GETOPT_LONG */
printf(_("\nThe SQL script will be written to the standard output.\n\n"));
printf(_("Report bugs to <pgsql-bugs@postgresql.org>.\n"));