@@ -4141,7 +4141,7 @@ getTables(Archive *fout, int *numTables)
4141
4141
* we cannot correctly identify inherited columns, owned sequences, etc.
4142
4142
*/
4143
4143
4144
- if (fout -> remoteVersion >= 90100 )
4144
+ if (fout -> remoteVersion >= 90300 )
4145
4145
{
4146
4146
/*
4147
4147
* Left join to pick up dependency info linking sequences to their
@@ -4177,6 +4177,42 @@ getTables(Archive *fout, int *numTables)
4177
4177
RELKIND_VIEW , RELKIND_COMPOSITE_TYPE ,
4178
4178
RELKIND_MATVIEW , RELKIND_FOREIGN_TABLE );
4179
4179
}
4180
+ else if (fout -> remoteVersion >= 90100 )
4181
+ {
4182
+ /*
4183
+ * Left join to pick up dependency info linking sequences to their
4184
+ * owning column, if any (note this dependency is AUTO as of 8.2)
4185
+ */
4186
+ appendPQExpBuffer (query ,
4187
+ "SELECT c.tableoid, c.oid, c.relname, "
4188
+ "c.relacl, c.relkind, c.relnamespace, "
4189
+ "(%s c.relowner) AS rolname, "
4190
+ "c.relchecks, c.relhastriggers, "
4191
+ "c.relhasindex, c.relhasrules, c.relhasoids, "
4192
+ "c.relfrozenxid, tc.oid AS toid, "
4193
+ "tc.relfrozenxid AS tfrozenxid, "
4194
+ "c.relpersistence, 't'::bool as isscannable, "
4195
+ "CASE WHEN c.reloftype <> 0 THEN c.reloftype::pg_catalog.regtype ELSE NULL END AS reloftype, "
4196
+ "d.refobjid AS owning_tab, "
4197
+ "d.refobjsubid AS owning_col, "
4198
+ "(SELECT spcname FROM pg_tablespace t WHERE t.oid = c.reltablespace) AS reltablespace, "
4199
+ "array_to_string(c.reloptions, ', ') AS reloptions, "
4200
+ "array_to_string(array(SELECT 'toast.' || x FROM unnest(tc.reloptions) x), ', ') AS toast_reloptions "
4201
+ "FROM pg_class c "
4202
+ "LEFT JOIN pg_depend d ON "
4203
+ "(c.relkind = '%c' AND "
4204
+ "d.classid = c.tableoid AND d.objid = c.oid AND "
4205
+ "d.objsubid = 0 AND "
4206
+ "d.refclassid = c.tableoid AND d.deptype = 'a') "
4207
+ "LEFT JOIN pg_class tc ON (c.reltoastrelid = tc.oid) "
4208
+ "WHERE c.relkind in ('%c', '%c', '%c', '%c', '%c', '%c') "
4209
+ "ORDER BY c.oid" ,
4210
+ username_subquery ,
4211
+ RELKIND_SEQUENCE ,
4212
+ RELKIND_RELATION , RELKIND_SEQUENCE ,
4213
+ RELKIND_VIEW , RELKIND_COMPOSITE_TYPE ,
4214
+ RELKIND_MATVIEW , RELKIND_FOREIGN_TABLE );
4215
+ }
4180
4216
else if (fout -> remoteVersion >= 90000 )
4181
4217
{
4182
4218
/*
0 commit comments