-
Notifications
You must be signed in to change notification settings - Fork 53
Update GetPrimaryKeys.java #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
主键和表初始化检查时,解决只能使用public schema的问题
主键和表初始化检查时,解决只能使用public schema的问题 |
public schema的限制
public schema的限制
} | ||
|
||
String tableList = sb.toString().substring(0, sb.toString().length() - 1) + ")"; | ||
String tableSql = "select tablename from pg_tables where schemaname='public' and tablename in " | ||
String tableSql = "select tablename from pg_tables where concat_ws('.',schemaname,tablename) in " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GP5.x does not support concat_ws.
@@ -57,14 +57,15 @@ public Table(String tableName, Map<String, List<String>> tableMap, Connection co | |||
ResultSetMetaData rsMetaData = null; | |||
|
|||
try { | |||
List<String> mapList = tableMap.get(tableName); | |||
String[] strArray = tableName.split("\\."); | |||
List<String> mapList = tableMap.get(strArray[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table name should include schema info. So you should modify the input parameters of getPrimaryKeys
String tableName = resultSet.getString("TABLE_SCHEM") + '.' + resultSet.getString("TABLE_NAME");
主键和表初始化检查时,解决只能使用public schema的问题