<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.101 2008/03/26 16:34:47 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.102 2008/04/13 03:49:21 tgl Exp $
PostgreSQL documentation
-->
<term><option>--ignore-version</></term>
<listitem>
<para>
- Ignore version mismatch between
- <application>pg_dump</application> and the database server.
- </para>
-
- <para>
- By default, <application>pg_dump</> will refuse to attempt
- to dump from a server that is of a newer <productname>PostgreSQL</>
- version than <application>pg_dump</application> is. It will also
- refuse to attempt to dump from a server that is older than the oldest
- supported version (currently, 7.0). The <option>-i</> option
- overrides this check and forces a dump to be attempted anyway.
- This option is <emphasis>deprecated</> because the dump is very
- likely to fail — or worse, seem to succeed but be wrong or
- incomplete.
+ A deprecated option that is now ignored.
</para>
</listitem>
</varlistentry>
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.71 2008/03/26 16:34:47 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.72 2008/04/13 03:49:21 tgl Exp $
PostgreSQL documentation
-->
<term><option>--ignore-version</></term>
<listitem>
<para>
- Ignore version mismatch between
- <application>pg_dumpall</application> and the database server.
- </para>
-
- <para>
- By default, <application>pg_dumpall</> will refuse to attempt
- to dump from a server that is of a newer <productname>PostgreSQL</>
- version than <application>pg_dumpall</application> is. It will also
- refuse to attempt to dump from a server that is older than the oldest
- supported version (currently, 7.0). The <option>-i</> option
- overrides this check and forces a dump to be attempted anyway.
- This option is <emphasis>deprecated</> because the dump is very
- likely to fail — or worse, seem to succeed but be wrong or
- incomplete.
+ A deprecated option that is now ignored.
</para>
</listitem>
</varlistentry>
-<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_restore.sgml,v 1.74 2008/03/26 16:34:47 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_restore.sgml,v 1.75 2008/04/13 03:49:21 tgl Exp $ -->
<refentry id="APP-PGRESTORE">
<refmeta>
<term><option>--ignore-version</option></term>
<listitem>
<para>
- Ignore version mismatch between
- <application>pg_restore</application> and the database server.
+ A deprecated option that is now ignored.
</para>
</listitem>
</varlistentry>
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup.h,v 1.46 2008/03/20 17:36:57 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup.h,v 1.47 2008/04/13 03:49:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
char *pgport;
char *pghost;
char *username;
- int ignoreVersion;
int noDataForFailedTables;
int requirePassword;
int exit_on_error;
const char *pghost,
const char *pgport,
const char *username,
- const int reqPwd,
- const int ignoreVersion);
-
+ int reqPwd);
/* Called to add a TOC entry */
extern void ArchiveEntry(Archive *AHX,
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.153 2008/03/20 17:36:57 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.154 2008/04/13 03:49:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
ConnectDatabase(AHX, ropt->dbname,
ropt->pghost, ropt->pgport, ropt->username,
- ropt->requirePassword, ropt->ignoreVersion);
+ ropt->requirePassword);
/*
* If we're talking to the DB directly, don't send comments since they
* Implements the basic DB functions used by the archiver.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.78 2008/03/26 14:32:22 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.79 2008/04/13 03:49:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
static const char *modulename = gettext_noop("archiver (db)");
-static void _check_database_version(ArchiveHandle *AH, bool ignoreVersion);
+static void _check_database_version(ArchiveHandle *AH);
static PGconn *_connectDB(ArchiveHandle *AH, const char *newdbname, const char *newUser);
static void notice_processor(void *arg, const char *message);
static char *_sendSQLLine(ArchiveHandle *AH, char *qry, char *eos);
}
static void
-_check_database_version(ArchiveHandle *AH, bool ignoreVersion)
+_check_database_version(ArchiveHandle *AH)
{
int myversion;
const char *remoteversion_str;
{
write_msg(NULL, "server version: %s; %s version: %s\n",
remoteversion_str, progname, PG_VERSION);
- if (ignoreVersion)
- write_msg(NULL, "ignoring server version mismatch\n");
- else
- 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");
+ die_horribly(AH, NULL, "aborting because of server version mismatch\n");
}
}
free(password);
/* check for version mismatch */
- _check_database_version(AH, true);
+ _check_database_version(AH);
PQsetNoticeProcessor(newConn, notice_processor, NULL);
const char *pghost,
const char *pgport,
const char *username,
- const int reqPwd,
- const int ignoreVersion)
+ int reqPwd)
{
ArchiveHandle *AH = (ArchiveHandle *) AHX;
char *password = NULL;
PQdb(AH->connection), PQerrorMessage(AH->connection));
/* check for version mismatch */
- _check_database_version(AH, ignoreVersion);
+ _check_database_version(AH);
PQsetNoticeProcessor(AH->connection, notice_processor, NULL);
* by PostgreSQL
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.486 2008/03/28 00:21:56 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.487 2008/04/13 03:49:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
int i;
bool force_password = false;
int compressLevel = -1;
- bool ignore_version = false;
int plainText = 0;
int outputClean = 0;
int outputCreate = 0;
bool outputBlobs = false;
int outputNoOwner = 0;
char *outputSuperuser = NULL;
+ int my_version;
+ int optindex;
+ RestoreOptions *ropt;
+
static int disable_triggers = 0;
static int outputNoTablespaces = 0;
static int use_setsessauth = 0;
- RestoreOptions *ropt;
-
static struct option long_options[] = {
{"data-only", no_argument, NULL, 'a'},
{"blobs", no_argument, NULL, 'b'},
{NULL, 0, NULL, 0}
};
- int optindex;
set_pglocale_pgservice(argv[0], "pg_dump");
pghost = optarg;
break;
- case 'i': /* ignore database version mismatch */
- ignore_version = true;
+ case 'i':
+ /* ignored, deprecated option */
break;
case 'n': /* include schema(s) */
/* Let the archiver know how noisy to be */
g_fout->verbose = g_verbose;
- g_fout->minRemoteVersion = 70000; /* we can handle back to 7.0 */
- g_fout->maxRemoteVersion = parse_version(PG_VERSION);
- if (g_fout->maxRemoteVersion < 0)
+ my_version = parse_version(PG_VERSION);
+ if (my_version < 0)
{
write_msg(NULL, "could not parse version string \"%s\"\n", PG_VERSION);
exit(1);
}
+ /*
+ * We allow the server to be back to 7.0, and up to any minor release
+ * of our own major version. (See also version check in pg_dumpall.c.)
+ */
+ g_fout->minRemoteVersion = 70000;
+ g_fout->maxRemoteVersion = (my_version / 100) * 100 + 99;
+
/*
* Open the database using the Archiver, so it knows about it. Errors mean
* death.
*/
g_conn = ConnectDatabase(g_fout, dbname, pghost, pgport,
- username, force_password, ignore_version);
+ username, force_password);
/* Set the client encoding if requested */
if (dumpencoding)
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 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"));
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.103 2008/03/26 14:32:22 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.104 2008/04/13 03:49:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
static bool output_clean = false;
static bool skip_acls = false;
static bool verbose = false;
-static bool ignoreVersion = false;
static int disable_dollar_quoting = 0;
static int disable_triggers = 0;
break;
case 'i':
- ignoreVersion = true;
- appendPQExpBuffer(pgdumpopts, " -i");
+ /* ignored, deprecated option */
break;
case 'l':
printf(_("\nGeneral options:\n"));
printf(_(" -f, --file=FILENAME output file name\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"));
exit(1);
}
+ /*
+ * We allow the server to be back to 7.0, and up to any minor release
+ * of our own major version. (See also version check in pg_dump.c.)
+ */
if (my_version != server_version
- && (server_version < 70000 /* we can handle back to 7.0 */
- || server_version > my_version))
+ && (server_version < 70000 ||
+ (server_version / 100) > (my_version / 100)))
{
fprintf(stderr, _("server version: %s; %s version: %s\n"),
remoteversion_str, progname, PG_VERSION);
- if (ignoreVersion)
- fprintf(stderr, _("ignoring server version mismatch\n"));
- else
- {
- 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);
- }
+ fprintf(stderr, _("aborting because of server version mismatch\n"));
+ exit(1);
}
/*
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.87 2008/03/26 14:32:22 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.88 2008/04/13 03:49:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
opts->pghost = strdup(optarg);
break;
case 'i':
- opts->ignoreVersion = 1;
+ /* ignored, deprecated option */
break;
case 'l': /* Dump the TOC summary */
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 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"));