summaryrefslogtreecommitdiff
path: root/src/parser/outfuncs.c
diff options
context:
space:
mode:
authorBo Peng2019-09-05 12:00:46 +0000
committerBo Peng2019-09-05 12:06:00 +0000
commit9971d2ce7daa758ec433cce1a3c74b06b849bc68 (patch)
tree8fff4b180fea03ade7805dc8a2089e3b09f8c04c /src/parser/outfuncs.c
parent572aad4a78e73b474660ddfdfe84f09875f9665f (diff)
Fix outfuncs.c to support PostgreSQL 12 CTE [NOT] MATERIALIZED.
Diffstat (limited to 'src/parser/outfuncs.c')
-rw-r--r--src/parser/outfuncs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/parser/outfuncs.c b/src/parser/outfuncs.c
index c2ddf5e89..b02ffbaca 100644
--- a/src/parser/outfuncs.c
+++ b/src/parser/outfuncs.c
@@ -1535,7 +1535,14 @@ _outCommonTableExpr(String * str, CommonTableExpr *node)
string_append_char(str, ") ");
}
- string_append_char(str, "AS (");
+ string_append_char(str, "AS ");
+
+ if (node->ctematerialized & CTEMaterializeAlways)
+ string_append_char(str, "MATERIALIZED ");
+ else if (node->ctematerialized & CTEMaterializeNever)
+ string_append_char(str, "NOT MATERIALIZED ");
+
+ string_append_char(str, "(");
_outNode(str, node->ctequery);
string_append_char(str, ")");
}