summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier2012-05-30 01:41:18 +0000
committerMichael Paquier2012-05-30 01:45:21 +0000
commitbb8e7ec36dbc2ed6e054249d3d2ac54935addd51 (patch)
tree2fa50d10a4742df9969e09d8c402508a85070e1e /src
parent41e78f38c0caf6ce41f148bc853e1869e06301b0 (diff)
Change INSERT tag for remote INSERT queries
When an INSERT query was planned using create_remoteinsert_plan, the tag returned to client was "INSERT 1 1", which is incorrect as the first digit should be the newly-insert Oid in case table being inserted uses WITH OIDS. Oids are not consistent among nodes in XC cluster, so set the first digit value to InvalidOid, which is the same way of doing with FQS-ed INSERT queries or INSERT having multiple values.
Diffstat (limited to 'src')
-rw-r--r--src/backend/executor/nodeModifyTable.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c
index 0259cbf1b7..14b0d58043 100644
--- a/src/backend/executor/nodeModifyTable.c
+++ b/src/backend/executor/nodeModifyTable.c
@@ -244,6 +244,14 @@ ExecInsert(TupleTableSlot *slot,
if (IS_PGXC_COORDINATOR && resultRemoteRel)
{
ExecRemoteQueryStandard(resultRelationDesc, (RemoteQueryState *)resultRemoteRel, slot);
+
+ /*
+ * PGXCTODO: If target table uses WITH OIDS, this should be set to the Oid inserted
+ * but Oids are not consistent among nodes in Postgres-XC, so this is set to the
+ * default value InvalidOid for the time being. It corrects at least tags for all
+ * the other INSERT commands.
+ */
+ newId = InvalidOid;
}
else
#endif