Commit bb698c25 authored by Tom Lane's avatar Tom Lane

Fix pg_restore to handle the 'set max oid' entry correctly in archives

dumped by pg_dump -o.  Per bug report posted by Bruce; fix is from
Philip Warner, reviewed by Tom Lane.
parent 3dfe8024
......@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.38 2001/11/08 04:05:12 tgl Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.39 2002/01/18 17:13:50 tgl Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
......@@ -62,6 +62,11 @@
* backup file; prior version was restoring schema in data-only
* restores. Added enum to make code easier to understand.
*
* Modifications - 18-Jan-2002 - pjw@rhyme.com.au
* - Modified _tocEntryRequired to handle '<Init>/Max OID' as a special
* case (ie. as a DATA item) as per bugs reported by Bruce Momjian
* around 17-Jan-2002.
*
*-------------------------------------------------------------------------
*/
......@@ -1917,6 +1922,13 @@ _tocEntryRequired(TocEntry *te, RestoreOptions *ropt)
res = res & ~REQ_DATA;
}
/* Special case: <Init> type with <Max OID> name; this is part of
* a DATA restore even though it has SQL.
*/
if ( ( strcmp(te->desc, "<Init>") == 0 ) && ( strcmp(te->name, "Max OID") == 0) ) {
res = REQ_DATA;
}
/* Mask it if we only want schema */
if (ropt->schemaOnly)
res = res & REQ_SCHEMA;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment