From 097ecf61a9c2740b02a21be19a92aed92388346a Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 31 Oct 2017 11:44:14 -0400 Subject: [PATCH] postgres_fdw: Add support for INSERT OVERRIDING clause --- contrib/postgres_fdw/deparse.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c index 2af8364010..8eb227605f 100644 --- a/contrib/postgres_fdw/deparse.c +++ b/contrib/postgres_fdw/deparse.c @@ -1573,7 +1573,21 @@ deparseInsertSql(StringInfo buf, PlannerInfo *root, deparseColumnRef(buf, rtindex, attnum, root, false); } - appendStringInfoString(buf, ") VALUES ("); + appendStringInfoString(buf, ") "); + + switch (root->parse->override) + { + case OVERRIDING_USER_VALUE: + appendStringInfoString(buf, "OVERRIDING USER VALUE "); + break; + case OVERRIDING_SYSTEM_VALUE: + appendStringInfoString(buf, "OVERRIDING SYSTEM VALUE "); + break; + default: + break; + } + + appendStringInfoString(buf, "VALUES ("); pindex = 1; first = true; -- 2.14.3