improved postgresql parser. for issue #2129

This commit is contained in:
wenshao
2017-11-25 21:21:02 +08:00
parent 128ddafacf
commit b90e175aa3
7 changed files with 60 additions and 7 deletions
@@ -2530,6 +2530,26 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
public boolean visit(SQLCreateTableStatement x) {
printCreateTable(x, true);
Map<String, SQLObject> options = x.getTableOptions();
if (options.size() > 0) {
println();
print0(ucase ? "WITH (" : "with (");
int i = 0;
for (Map.Entry<String, SQLObject> option : x.getTableOptions().entrySet()) {
if (i > 0) {
print0(", ");
}
String key = option.getKey();
print0(key);
print0(" = ");
option.getValue().accept(this);
++i;
}
print(')');
}
return false;
}