diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
new file mode 100644
index d7a147e..56db6e5
*** a/src/bin/pg_dump/pg_dump.c
--- b/src/bin/pg_dump/pg_dump.c
*************** getTables(int *numTables)
*** 3978,3991 ****
  		 * 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, "
  						  "'p' AS relpersistence, "
  						  "NULL AS reloftype, "
  						  "d.refobjid AS owning_tab, "
--- 3978,3990 ----
  		 * owning column, if any (note this dependency is AUTO as of 8.2)
  		 */
  		appendPQExpBuffer(query,
! 						  "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, "
  						  "'p' AS relpersistence, "
  						  "NULL AS reloftype, "
  						  "d.refobjid AS owning_tab, "
*************** getTables(int *numTables)
*** 3999,4005 ****
  						  "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') "
  						  "ORDER BY c.oid",
  						  username_subquery,
  						  RELKIND_SEQUENCE,
--- 3998,4005 ----
  						  "d.classid = c.tableoid AND d.objid = c.oid AND "
  						  "d.objsubid = 0 AND "
  						  "d.refclassid = c.tableoid AND d.deptype = 'a') "
! 					   "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,
