Skip to content

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.

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