@@ -3960,14 +3960,13 @@ getTables(int *numTables)
39603960 * owning column, if any (note this dependency is AUTO as of 8.2)
39613961 */
39623962appendPQExpBuffer (query ,
3963- "SELECT c.tableoid, c.oid, relname, "
3964- "relacl, relkind, relnamespace, "
3965- "(%s relowner) AS rolname, "
3966- "relchecks, (reltriggers <> 0) AS relhastriggers, "
3967- "relhasindex, relhasrules, relhasoids, "
3968- "relfrozenxid, "
3969- "0 AS toid, "
3970- "0 AS tfrozenxid, "
3963+ "SELECT c.tableoid, c.oid, c.relname, "
3964+ "c.relacl, c.relkind, c.relnamespace, "
3965+ "(%s c.relowner) AS rolname, "
3966+ "c.relchecks, (c.reltriggers <> 0) AS relhastriggers, "
3967+ "c.relhasindex, c.relhasrules, c.relhasoids, "
3968+ "c.relfrozenxid, tc.oid AS toid, "
3969+ "tc.relfrozenxid AS tfrozenxid, "
39713970"'p' AS relpersistence, "
39723971"NULL AS reloftype, "
39733972"d.refobjid AS owning_tab, "
@@ -3981,7 +3980,8 @@ getTables(int *numTables)
39813980"d.classid = c.tableoid AND d.objid = c.oid AND "
39823981"d.objsubid = 0 AND "
39833982"d.refclassid = c.tableoid AND d.deptype = 'a') "
3984- "WHERE relkind in ('%c', '%c', '%c', '%c') "
3983+ "LEFT JOIN pg_class tc ON (c.reltoastrelid = tc.oid) "
3984+ "WHERE c.relkind in ('%c', '%c', '%c', '%c') "
39853985"ORDER BY c.oid" ,
39863986username_subquery ,
39873987RELKIND_SEQUENCE ,