mirror of
https://github.com/postgres/postgres.git
synced 2025-10-16 17:07:43 +03:00
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.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user