diff options
author | Bruce Momjian <bruce@momjian.us> | 2008-03-26 14:32:22 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2008-03-26 14:32:22 +0000 |
commit | c22de3989b388d2a10483c1ede047d6dc6218257 (patch) | |
tree | 0dc3f9d5e1cfe564cb7813887854b9e43e665719 | |
parent | 530659fac8fd218c82d3e2d5b3bcad22ef1f27e0 (diff) | |
download | postgresql-c22de3989b388d2a10483c1ede047d6dc6218257.tar.gz postgresql-c22de3989b388d2a10483c1ede047d6dc6218257.zip |
Strengthen warnings about using pg_dump's -i option.
-rw-r--r-- | doc/src/sgml/ref/pg_dump.sgml | 17 | ||||
-rw-r--r-- | src/bin/pg_dump/pg_backup_db.c | 7 | ||||
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 5 | ||||
-rw-r--r-- | src/bin/pg_dump/pg_dumpall.c | 10 | ||||
-rw-r--r-- | src/bin/pg_dump/pg_restore.c | 4 |
5 files changed, 21 insertions, 22 deletions
diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml index 9767cfbcd75..1fb93fbb880 100644 --- a/doc/src/sgml/ref/pg_dump.sgml +++ b/doc/src/sgml/ref/pg_dump.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.99 2008/03/20 17:36:57 tgl Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.100 2008/03/26 14:32:22 momjian Exp $ PostgreSQL documentation --> @@ -296,19 +296,18 @@ PostgreSQL documentation <term><option>--ignore-version</></term> <listitem> <para> - Ignore version mismatch between + Ignore incompatible version check between <application>pg_dump</application> and the database server. </para> <para> - <application>pg_dump</application> can dump from servers running - previous releases of <productname>PostgreSQL</>, but very old - versions are not supported anymore (currently, those prior to 7.0). Dumping from a server newer than <application>pg_dump</application> - is likely not to work at all. - Use this option if you need to override the version check (and - if <application>pg_dump</application> then fails, don't say - you weren't warned). + is likely fail and is disabled by default. + Also, while <application>pg_dump</application> can dump from servers running + previous releases of <productname>PostgreSQL</>, some very old + versions are not supported (currently, pre-7.0). + Use this option if you need to override the version check, but + be prepared for <application>pg_dump</application> to fail. </para> </listitem> </varlistentry> diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c index d3e7959d817..c426270eb83 100644 --- a/src/bin/pg_dump/pg_backup_db.c +++ b/src/bin/pg_dump/pg_backup_db.c @@ -5,7 +5,7 @@ * Implements the basic DB functions used by the archiver. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.77 2007/12/09 19:01:40 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.78 2008/03/26 14:32:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -72,9 +72,10 @@ _check_database_version(ArchiveHandle *AH, bool ignoreVersion) write_msg(NULL, "server version: %s; %s version: %s\n", remoteversion_str, progname, PG_VERSION); if (ignoreVersion) - write_msg(NULL, "proceeding despite version mismatch\n"); + write_msg(NULL, "ignoring server version mismatch\n"); else - die_horribly(AH, NULL, "aborting because of version mismatch (Use the -i option to proceed anyway.)\n"); + die_horribly(AH, NULL, "aborting because of server version mismatch\n" + "Use the -i option to bypass server version check, but be prepared for failure.\n"); } } diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index f9313c5f334..ce292e90083 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -12,7 +12,7 @@ * by PostgreSQL * * IDENTIFICATION - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.483 2008/03/20 17:36:57 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.484 2008/03/26 14:32:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -745,8 +745,7 @@ help(const char *progname) printf(_("\nGeneral options:\n")); printf(_(" -f, --file=FILENAME output file name\n")); printf(_(" -F, --format=c|t|p output file format (custom, tar, plain text)\n")); - printf(_(" -i, --ignore-version proceed even when server version mismatches\n" - " pg_dump version\n")); + printf(_(" -i, --ignore-version ignore server version mismatch\n")); printf(_(" -v, --verbose verbose mode\n")); printf(_(" -Z, --compress=0-9 compression level for compressed formats\n")); printf(_(" --help show this help, then exit\n")); diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index 5d557a2dba8..921580ea294 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 * * - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.102 2008/03/20 17:42:51 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.103 2008/03/26 14:32:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -488,8 +488,7 @@ help(void) printf(_("\nGeneral options:\n")); printf(_(" -f, --file=FILENAME output file name\n")); - printf(_(" -i, --ignore-version proceed even when server version mismatches\n" - " pg_dumpall version\n")); + printf(_(" -i, --ignore-version ignore server version mismatch\n")); printf(_(" --help show this help, then exit\n")); printf(_(" --version output version information, then exit\n")); printf(_("\nOptions controlling the output content:\n")); @@ -1399,10 +1398,11 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport, fprintf(stderr, _("server version: %s; %s version: %s\n"), remoteversion_str, progname, PG_VERSION); if (ignoreVersion) - fprintf(stderr, _("proceeding despite version mismatch\n")); + fprintf(stderr, _("ignoring server version mismatch\n")); else { - fprintf(stderr, _("aborting because of version mismatch (Use the -i option to proceed anyway.)\n")); + fprintf(stderr, _("aborting because of server version mismatch\n" + "Use the -i option to bypass server version check, but be prepared for failure.\n")); exit(1); } } diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index dec2b57aac9..05da3526cfe 100644 --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@ -34,7 +34,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.86 2008/03/20 17:36:58 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.87 2008/03/26 14:32:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -378,7 +378,7 @@ usage(const char *progname) printf(_(" -d, --dbname=NAME connect to database name\n")); printf(_(" -f, --file=FILENAME output file name\n")); printf(_(" -F, --format=c|t specify backup file format\n")); - printf(_(" -i, --ignore-version proceed even when server version mismatches\n")); + printf(_(" -i, --ignore-version ignore server version mismatch\n")); printf(_(" -l, --list print summarized TOC of the archive\n")); printf(_(" -v, --verbose verbose mode\n")); printf(_(" --help show this help, then exit\n")); |