diff.patch
text/x-diff
Filename: diff.patch
Type: text/x-diff
Part: 0
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/backend/nodes/outfuncs.c | 77 | 0 |
| src/backend/nodes/readfuncs.c | 97 | 0 |
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index c8d9626..2411658 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -409,6 +409,68 @@ _outMergeAction(StringInfo str, const MergeAction *node)
}
static void
+_outInferClause(StringInfo str, const InferClause *node)
+{
+ WRITE_NODE_TYPE("INFERCLAUSE");
+
+ WRITE_NODE_FIELD(indexElems);
+ WRITE_NODE_FIELD(whereClause);
+ WRITE_STRING_FIELD(conname);
+ WRITE_LOCATION_FIELD(location);
+}
+
+static void
+_outOnConflictClause(StringInfo str, const OnConflictClause *node)
+{
+ WRITE_NODE_TYPE("ONCONFLICTCLAUSE");
+
+ WRITE_ENUM_FIELD(action, OnConflictAction);
+ WRITE_NODE_FIELD(infer);
+ WRITE_NODE_FIELD(targetList);
+ WRITE_NODE_FIELD(whereClause);
+ WRITE_LOCATION_FIELD(location);
+}
+
+static void
+_outInsertStmt(StringInfo str, const InsertStmt *node)
+{
+ WRITE_NODE_TYPE("INSERT");
+
+ WRITE_NODE_FIELD(relation);
+ WRITE_NODE_FIELD(cols);
+ WRITE_NODE_FIELD(selectStmt);
+ WRITE_NODE_FIELD(onConflictClause);
+ WRITE_NODE_FIELD(returningList);
+ WRITE_NODE_FIELD(withClause);
+ WRITE_ENUM_FIELD(override, OverridingKind);
+}
+
+static void
+_outDeleteStmt(StringInfo str, const DeleteStmt *node)
+{
+ WRITE_NODE_TYPE("DELETE");
+
+ WRITE_NODE_FIELD(relation);
+ WRITE_NODE_FIELD(usingClause);
+ WRITE_NODE_FIELD(whereClause);
+ WRITE_NODE_FIELD(returningList);
+ WRITE_NODE_FIELD(withClause);
+}
+
+static void
+_outUpdateStmt(StringInfo str, const UpdateStmt *node)
+{
+ WRITE_NODE_TYPE("UPDATE");
+
+ WRITE_NODE_FIELD(relation);
+ WRITE_NODE_FIELD(targetList);
+ WRITE_NODE_FIELD(whereClause);
+ WRITE_NODE_FIELD(fromClause);
+ WRITE_NODE_FIELD(returningList);
+ WRITE_NODE_FIELD(withClause);
+}
+
+static void
_outAppend(StringInfo str, const Append *node)
{
WRITE_NODE_TYPE("APPEND");
@@ -3682,6 +3744,21 @@ outNode(StringInfo str, const void *obj)
case T_MergeAction:
_outMergeAction(str, obj);
break;
+ case T_InferClause:
+ _outInferClause(str, obj);
+ break;
+ case T_OnConflictClause:
+ _outOnConflictClause(str, obj);
+ break;
+ case T_InsertStmt:
+ _outInsertStmt(str, obj);
+ break;
+ case T_DeleteStmt:
+ _outDeleteStmt(str, obj);
+ break;
+ case T_UpdateStmt:
+ _outUpdateStmt(str, obj);
+ break;
case T_Append:
_outAppend(str, obj);
break;
diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c
index 4518fa0..13891b1 100644
--- a/src/backend/nodes/readfuncs.c
+++ b/src/backend/nodes/readfuncs.c
@@ -1620,6 +1620,93 @@ _readMergeAction(void)
}
/*
+ * _readInferClause
+ */
+static InferClause *
+_readInferClause(void)
+{
+ READ_LOCALS(InferClause);
+
+ READ_NODE_FIELD(indexElems);
+ READ_NODE_FIELD(whereClause);
+ READ_STRING_FIELD(conname);
+ READ_LOCATION_FIELD(location);
+
+ READ_DONE();
+}
+
+/*
+ * _readOnConflictClause
+ */
+static OnConflictClause *
+_readOnConflictClause(void)
+{
+ READ_LOCALS(OnConflictClause);
+
+ READ_ENUM_FIELD(action, OnConflictAction);
+ READ_NODE_FIELD(infer);
+ READ_NODE_FIELD(targetList);
+ READ_NODE_FIELD(whereClause);
+ READ_LOCATION_FIELD(location);
+
+ READ_DONE();
+}
+
+/*
+ * _readInsertStmt
+ */
+static InsertStmt *
+_readInsertStmt(void)
+{
+ READ_LOCALS(InsertStmt);
+
+ READ_NODE_FIELD(relation);
+ READ_NODE_FIELD(cols);
+ READ_NODE_FIELD(selectStmt);
+ READ_NODE_FIELD(onConflictClause);
+ READ_NODE_FIELD(returningList);
+ READ_NODE_FIELD(withClause);
+ READ_ENUM_FIELD(override, OverridingKind);
+
+ READ_DONE();
+}
+
+/*
+ * _readDeleteStmt
+ */
+static DeleteStmt *
+_readDeleteStmt(void)
+{
+ READ_LOCALS(DeleteStmt);
+
+ READ_NODE_FIELD(relation);
+ READ_NODE_FIELD(usingClause);
+ READ_NODE_FIELD(whereClause);
+ READ_NODE_FIELD(returningList);
+ READ_NODE_FIELD(withClause);
+
+ READ_DONE();
+}
+
+/*
+ * _readUpdateStmt
+ */
+static UpdateStmt *
+_readUpdateStmt(void)
+{
+ READ_LOCALS(UpdateStmt);
+
+ READ_NODE_FIELD(relation);
+ READ_NODE_FIELD(targetList);
+ READ_NODE_FIELD(whereClause);
+ READ_NODE_FIELD(fromClause);
+ READ_NODE_FIELD(returningList);
+ READ_NODE_FIELD(withClause);
+
+ READ_DONE();
+}
+
+/*
* _readAppend
*/
static Append *
@@ -2620,6 +2707,16 @@ parseNodeString(void)
return_value = _readModifyTable();
else if (MATCH("MERGEACTION", 11))
return_value = _readMergeAction();
+ else if (MATCH("INFERCLAUSE", 11))
+ return_value = _readInferClause();
+ else if (MATCH("ONCONFLICTCLAUSE", 16))
+ return_value = _readOnConflictClause();
+ else if (MATCH("INSERT", 6))
+ return_value = _readInsertStmt();
+ else if (MATCH("DELETE", 6))
+ return_value = _readDeleteStmt();
+ else if (MATCH("UPDATE", 6))
+ return_value = _readUpdateStmt();
else if (MATCH("APPEND", 6))
return_value = _readAppend();
else if (MATCH("MERGEAPPEND", 11))