@@ -3978,14 +3978,13 @@ getTables(int *numTables)
39783978 * owning column, if any (note this dependency is AUTO as of 8.2)
39793979 */
39803980 appendPQExpBuffer (query ,
3981- "SELECT c.tableoid, c.oid, relname, "
3982- "relacl, relkind, relnamespace, "
3983- "(%s relowner) AS rolname, "
3984- "relchecks, (reltriggers <> 0) AS relhastriggers, "
3985- "relhasindex, relhasrules, relhasoids, "
3986- "relfrozenxid, "
3987- "0 AS toid, "
3988- "0 AS tfrozenxid, "
3981+ "SELECT c.tableoid, c.oid, c.relname, "
3982+ "c.relacl, c.relkind, c.relnamespace, "
3983+ "(%s c.relowner) AS rolname, "
3984+ "c.relchecks, (c.reltriggers <> 0) AS relhastriggers, "
3985+ "c.relhasindex, c.relhasrules, c.relhasoids, "
3986+ "c.relfrozenxid, tc.oid AS toid, "
3987+ "tc.relfrozenxid AS tfrozenxid, "
39893988 "'p' AS relpersistence, "
39903989 "NULL AS reloftype, "
39913990 "d.refobjid AS owning_tab, "
@@ -3999,7 +3998,8 @@ getTables(int *numTables)
39993998 "d.classid = c.tableoid AND d.objid = c.oid AND "
40003999 "d.objsubid = 0 AND "
40014000 "d.refclassid = c.tableoid AND d.deptype = 'a') "
4002- "WHERE relkind in ('%c', '%c', '%c', '%c') "
4001+ "LEFT JOIN pg_class tc ON (c.reltoastrelid = tc.oid) "
4002+ "WHERE c.relkind in ('%c', '%c', '%c', '%c') "
40034003 "ORDER BY c.oid" ,
40044004 username_subquery ,
40054005 RELKIND_SEQUENCE ,
0 commit comments