Skip to content

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sunguofeng
Copy link

主键和表初始化检查时,解决只能使用public schema的问题

主键和表初始化检查时,解决只能使用public schema的问题
@sunguofeng
Copy link
Author

主键和表初始化检查时,解决只能使用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 "

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]);

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");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants