]> granicus.if.org Git - postgresql/blobdiff - src/backend/nodes/outfuncs.c
Support UPDATE/DELETE WHERE CURRENT OF cursor_name, per SQL standard.
[postgresql] / src / backend / nodes / outfuncs.c
index 64f235201d0def2ba1d63eeae6d7b5b029d729b8..869905f0cc548e01b42ecf74f314bbc850b43597 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.301 2007/02/22 22:00:23 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.310 2007/06/11 01:16:22 tgl Exp $
  *
  * NOTES
  *       Every node type that can appear in stored rules' parsetrees *must*
@@ -244,8 +244,10 @@ _outPlannedStmt(StringInfo str, PlannedStmt *node)
        WRITE_NODE_FIELD(planTree);
        WRITE_NODE_FIELD(rtable);
        WRITE_NODE_FIELD(resultRelations);
-       WRITE_NODE_FIELD(into);
+       WRITE_NODE_FIELD(utilityStmt);
+       WRITE_NODE_FIELD(intoClause);
        WRITE_NODE_FIELD(subplans);
+       WRITE_BITMAPSET_FIELD(rewindPlanIDs);
        WRITE_NODE_FIELD(returningLists);
        WRITE_NODE_FIELD(rowMarks);
        WRITE_INT_FIELD(nParamExec);
@@ -684,6 +686,7 @@ _outConst(StringInfo str, Const *node)
        WRITE_NODE_TYPE("CONST");
 
        WRITE_OID_FIELD(consttype);
+       WRITE_INT_FIELD(consttypmod);
        WRITE_INT_FIELD(constlen);
        WRITE_BOOL_FIELD(constbyval);
        WRITE_BOOL_FIELD(constisnull);
@@ -724,9 +727,9 @@ _outArrayRef(StringInfo str, ArrayRef *node)
 {
        WRITE_NODE_TYPE("ARRAYREF");
 
-       WRITE_OID_FIELD(refrestype);
        WRITE_OID_FIELD(refarraytype);
        WRITE_OID_FIELD(refelemtype);
+       WRITE_INT_FIELD(reftypmod);
        WRITE_NODE_FIELD(refupperindexpr);
        WRITE_NODE_FIELD(reflowerindexpr);
        WRITE_NODE_FIELD(refexpr);
@@ -867,6 +870,29 @@ _outRelabelType(StringInfo str, RelabelType *node)
        WRITE_ENUM_FIELD(relabelformat, CoercionForm);
 }
 
+static void
+_outCoerceViaIO(StringInfo str, CoerceViaIO *node)
+{
+       WRITE_NODE_TYPE("COERCEVIAIO");
+
+       WRITE_NODE_FIELD(arg);
+       WRITE_OID_FIELD(resulttype);
+       WRITE_ENUM_FIELD(coerceformat, CoercionForm);
+}
+
+static void
+_outArrayCoerceExpr(StringInfo str, ArrayCoerceExpr *node)
+{
+       WRITE_NODE_TYPE("ARRAYCOERCEEXPR");
+
+       WRITE_NODE_FIELD(arg);
+       WRITE_OID_FIELD(elemfuncid);
+       WRITE_OID_FIELD(resulttype);
+       WRITE_INT_FIELD(resulttypmod);
+       WRITE_BOOL_FIELD(isExplicit);
+       WRITE_ENUM_FIELD(coerceformat, CoercionForm);
+}
+
 static void
 _outConvertRowtypeExpr(StringInfo str, ConvertRowtypeExpr *node)
 {
@@ -1032,6 +1058,15 @@ _outSetToDefault(StringInfo str, SetToDefault *node)
        WRITE_INT_FIELD(typeMod);
 }
 
+static void
+_outCurrentOfExpr(StringInfo str, CurrentOfExpr *node)
+{
+       WRITE_NODE_TYPE("CURRENTOFEXPR");
+
+       WRITE_UINT_FIELD(cvarno);
+       WRITE_STRING_FIELD(cursor_name);
+}
+
 static void
 _outTargetEntry(StringInfo str, TargetEntry *node)
 {
@@ -1262,6 +1297,7 @@ _outPlannerGlobal(StringInfo str, PlannerGlobal *node)
        WRITE_NODE_FIELD(paramlist);
        WRITE_NODE_FIELD(subplans);
        WRITE_NODE_FIELD(subrtables);
+       WRITE_BITMAPSET_FIELD(rewindPlanIDs);
        WRITE_NODE_FIELD(finalrtable);
 }
 
@@ -1423,7 +1459,8 @@ _outInnerIndexscanInfo(StringInfo str, InnerIndexscanInfo *node)
        WRITE_NODE_TYPE("INNERINDEXSCANINFO");
        WRITE_BITMAPSET_FIELD(other_relids);
        WRITE_BOOL_FIELD(isouterjoin);
-       WRITE_NODE_FIELD(best_innerpath);
+       WRITE_NODE_FIELD(cheapest_startup_innerpath);
+       WRITE_NODE_FIELD(cheapest_total_innerpath);
 }
 
 static void
@@ -1435,6 +1472,7 @@ _outOuterJoinInfo(StringInfo str, OuterJoinInfo *node)
        WRITE_BITMAPSET_FIELD(min_righthand);
        WRITE_BOOL_FIELD(is_full_join);
        WRITE_BOOL_FIELD(lhs_strict);
+       WRITE_BOOL_FIELD(delay_upper_joins);
 }
 
 static void
@@ -1503,7 +1541,6 @@ _outIndexStmt(StringInfo str, IndexStmt *node)
        WRITE_NODE_FIELD(indexParams);
        WRITE_NODE_FIELD(options);
        WRITE_NODE_FIELD(whereClause);
-       WRITE_NODE_FIELD(rangetable);
        WRITE_BOOL_FIELD(unique);
        WRITE_BOOL_FIELD(primary);
        WRITE_BOOL_FIELD(isconstraint);
@@ -1534,7 +1571,7 @@ _outSelectStmt(StringInfo str, SelectStmt *node)
        WRITE_NODE_TYPE("SELECT");
 
        WRITE_NODE_FIELD(distinctClause);
-       WRITE_NODE_FIELD(into);
+       WRITE_NODE_FIELD(intoClause);
        WRITE_NODE_FIELD(targetList);
        WRITE_NODE_FIELD(fromClause);
        WRITE_NODE_FIELD(whereClause);
@@ -1679,7 +1716,7 @@ _outQuery(StringInfo str, Query *node)
                appendStringInfo(str, " :utilityStmt <>");
 
        WRITE_INT_FIELD(resultRelation);
-       WRITE_NODE_FIELD(into);
+       WRITE_NODE_FIELD(intoClause);
        WRITE_BOOL_FIELD(hasAggs);
        WRITE_BOOL_FIELD(hasSubLinks);
        WRITE_NODE_FIELD(rtable);
@@ -2147,6 +2184,12 @@ _outNode(StringInfo str, void *obj)
                        case T_RelabelType:
                                _outRelabelType(str, obj);
                                break;
+                       case T_CoerceViaIO:
+                               _outCoerceViaIO(str, obj);
+                               break;
+                       case T_ArrayCoerceExpr:
+                               _outArrayCoerceExpr(str, obj);
+                               break;
                        case T_ConvertRowtypeExpr:
                                _outConvertRowtypeExpr(str, obj);
                                break;
@@ -2195,6 +2238,9 @@ _outNode(StringInfo str, void *obj)
                        case T_SetToDefault:
                                _outSetToDefault(str, obj);
                                break;
+                       case T_CurrentOfExpr:
+                               _outCurrentOfExpr(str, obj);
+                               break;
                        case T_TargetEntry:
                                _outTargetEntry(str, obj);
                                break;