提交 62f79053 编写于 作者: S serge-rider

#3477 PG: search_path update fix (keep $user schema as is)

上级 2549f9cb
......@@ -197,7 +197,7 @@ public class PostgreDataSource extends JDBCDataSource implements DBSObjectSelect
String searchPathStr = JDBCUtils.queryString(session, "SHOW search_path");
this.searchPath.clear();
if (searchPathStr != null) {
for (String str : searchPathStr.replace("$user", activeUser).split(",")) {
for (String str : searchPathStr.split(",")) {
str = str.trim();
this.searchPath.add(DBUtils.getUnQuotedIdentifier(this, str));
}
......
......@@ -473,10 +473,7 @@ public class PostgreDatabase implements DBSInstance, DBSCatalog, DBPRefreshableO
StringBuilder spString = new StringBuilder();
for (String sp : newSearchPath) {
if (spString.length() > 0) spString.append(",");
if (sp.startsWith("$"))
spString.append(sp);
else
spString.append(DBUtils.getQuotedIdentifier(getDataSource(), sp));
spString.append(DBUtils.getQuotedIdentifier(getDataSource(), sp));
}
try (JDBCSession session = context.openSession(monitor, DBCExecutionPurpose.UTIL, "Change search path")) {
JDBCUtils.executeSQL(session, "SET search_path = " + spString);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册