@@ -3960,14 +3960,13 @@ getTables(int *numTables)
3960
3960
* owning column, if any (note this dependency is AUTO as of 8.2)
3961
3961
*/
3962
3962
appendPQExpBuffer (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, "
3971
3970
"'p' AS relpersistence, "
3972
3971
"NULL AS reloftype, "
3973
3972
"d.refobjid AS owning_tab, "
@@ -3981,7 +3980,8 @@ getTables(int *numTables)
3981
3980
"d.classid = c.tableoid AND d.objid = c.oid AND "
3982
3981
"d.objsubid = 0 AND "
3983
3982
"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') "
3985
3985
"ORDER BY c.oid" ,
3986
3986
username_subquery ,
3987
3987
RELKIND_SEQUENCE ,
0 commit comments