diff options
| author | Bruce Momjian <bruce@momjian.us> | 2011-08-31 21:50:00 -0400 | 
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2011-08-31 21:50:00 -0400 | 
| commit | e724b969d82862a08255ba6f2921a7a66e65a852 (patch) | |
| tree | 544055b8205329efc4758002073a178758707a71 /src/bin/pg_dump/pg_dump.c | |
| parent | 53434c6f0dfa89bf287fadbde26b050b043c0c94 (diff) | |
Fix pg_upgrade to preserve toast relfrozenxids for old 8.3 servers.
This fixes a pg_upgrade bug that could lead to query errors when
clog files are improperly removed.
Backpatch to 8.4, 9.0, 9.1.
Diffstat (limited to 'src/bin/pg_dump/pg_dump.c')
| -rw-r--r-- | src/bin/pg_dump/pg_dump.c | 18 | 
1 files changed, 9 insertions, 9 deletions
| diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index d6a547fc475..b73392b6258 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -3516,14 +3516,13 @@ getTables(int *numTables)  		 * owning column, if any (note this dependency is AUTO as of 8.2)  		 */  		appendPQExpBuffer(query, -						  "SELECT c.tableoid, c.oid, relname, " -						  "relacl, relkind, relnamespace, " -						  "(%s relowner) AS rolname, " -						  "relchecks, (reltriggers <> 0) AS relhastriggers, " -						  "relhasindex, relhasrules, relhasoids, " -						  "relfrozenxid, " -						  "0 AS toid, " -						  "0 AS tfrozenxid, " +						  "SELECT c.tableoid, c.oid, c.relname, " +						  "c.relacl, c.relkind, c.relnamespace, " +						  "(%s c.relowner) AS rolname, " +						  "c.relchecks, (c.reltriggers <> 0) AS relhastriggers, " +						  "c.relhasindex, c.relhasrules, c.relhasoids, " +						  "c.relfrozenxid, tc.oid AS toid, " +						  "tc.relfrozenxid AS tfrozenxid, "  						  "NULL AS reloftype, "  						  "d.refobjid AS owning_tab, "  						  "d.refobjsubid AS owning_col, " @@ -3536,7 +3535,8 @@ getTables(int *numTables)  						  "d.classid = c.tableoid AND d.objid = c.oid AND "  						  "d.objsubid = 0 AND "  						  "d.refclassid = c.tableoid AND d.deptype = 'a') " -						  "WHERE relkind in ('%c', '%c', '%c', '%c') " +					   "LEFT JOIN pg_class tc ON (c.reltoastrelid = tc.oid) " +						  "WHERE c.relkind in ('%c', '%c', '%c', '%c') "  						  "ORDER BY c.oid",  						  username_subquery,  						  RELKIND_SEQUENCE, | 
