main
黄海 2 years ago
parent 43597925f2
commit 5c59e13683

@ -41,12 +41,16 @@ public class SyncXtData2022 {
arp2.start();
String sql = "select tablename from pg_tables where schemaname='public'";
List<Record> tableList = Db.use("source").find(sql);
List<Record> sourceTableList = Db.use("source").find(sql);
for (Record tableRecord : tableList) {
String tableName = tableRecord.getStr("tablename");
for (Record sourceTable : sourceTableList) {
String tableName = sourceTable.getStr("tablename");
sql = "select a.attname as name from pg_class as c,pg_attribute as a where c.relname = '" + tableName + "' and a.attrelid = c.oid and a.attnum>0";
List<Record> colsListTarge = Db.use("target").find(sql);
if (colsListTarge.size() == 0) {
System.out.println("发现表:" + tableName + "不存在,跳过!");
continue;
}
List<Record> colsListSource = Db.use("source").find(sql);
Set<String> targetSet = new HashSet<>();
for (Record rCol : colsListTarge) {

Loading…
Cancel
Save