提交 1fc5e6e8 编写于 作者: S serge-rider

PG: create materialized view DDL fix

Former-commit-id: 0d5ab237
上级 8b7df38b
......@@ -103,7 +103,11 @@ public class PostgreViewManager extends PostgreTableManagerBase implements DBEOb
String sql = view.getSource().trim();
if (!sql.toLowerCase(Locale.ENGLISH).startsWith("create")) {
StringBuilder sqlBuf = new StringBuilder();
sqlBuf.append("CREATE OR REPLACE ").append(view.getViewType()).append(" ").append(DBUtils.getObjectFullName(view, DBPEvaluationContext.DDL));
sqlBuf.append("CREATE ");
if (!(view instanceof PostgreMaterializedView)) {
sqlBuf.append("OR REPLACE ");
}
sqlBuf.append(view.getViewType()).append(" ").append(DBUtils.getObjectFullName(view, DBPEvaluationContext.DDL));
appendViewDeclarationPrefix(monitor, sqlBuf, view);
sqlBuf.append("\nAS ").append(sql);
appendViewDeclarationPostfix(monitor, sqlBuf, view);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册