Skip to content

Commit bb698c2

Browse files
committed
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.
1 parent 3dfe802 commit bb698c2

File tree

2 files changed

+207
-162
lines changed

2 files changed

+207
-162
lines changed

src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.38 2001/11/08 04:05:12 tgl Exp $
18+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.39 2002/01/18 17:13:50 tgl Exp $
1919
*
2020
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
2121
*
@@ -62,6 +62,11 @@
6262
* backup file; prior version was restoring schema in data-only
6363
* restores. Added enum to make code easier to understand.
6464
*
65+
* Modifications - 18-Jan-2002 - pjw@rhyme.com.au
66+
* - Modified _tocEntryRequired to handle '<Init>/Max OID' as a special
67+
* case (ie. as a DATA item) as per bugs reported by Bruce Momjian
68+
* around 17-Jan-2002.
69+
*
6570
*-------------------------------------------------------------------------
6671
*/
6772

@@ -1917,6 +1922,13 @@ _tocEntryRequired(TocEntry *te, RestoreOptions *ropt)
19171922
res = res & ~REQ_DATA;
19181923
}
19191924

1925+
/* Special case: <Init> type with <Max OID> name; this is part of
1926+
* a DATA restore even though it has SQL.
1927+
*/
1928+
if ( ( strcmp(te->desc, "<Init>") == 0 ) && ( strcmp(te->name, "Max OID") == 0) ) {
1929+
res = REQ_DATA;
1930+
}
1931+
19201932
/* Mask it if we only want schema */
19211933
if (ropt->schemaOnly)
19221934
res = res & REQ_SCHEMA;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy