Add dump support for SortBy nodes. Needed this while debugging a reported
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 17 Jul 2008 16:02:12 +0000 (16:02 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 17 Jul 2008 16:02:12 +0000 (16:02 +0000)
problem with DISTINCT, so might as well commit it.

src/backend/nodes/outfuncs.c

index f907c885e3d97785ae622f41c5b7272334af501d..87f141de45397ad24a7bdbea8f96fa2a8faf65e4 100644 (file)
@@ -1985,6 +1985,17 @@ _outResTarget(StringInfo str, ResTarget *node)
        WRITE_INT_FIELD(location);
 }
 
+static void
+_outSortBy(StringInfo str, SortBy *node)
+{
+       WRITE_NODE_TYPE("SORTBY");
+
+       WRITE_ENUM_FIELD(sortby_dir, SortByDir);
+       WRITE_ENUM_FIELD(sortby_nulls, SortByNulls);
+       WRITE_NODE_FIELD(useOp);
+       WRITE_NODE_FIELD(node);
+}
+
 static void
 _outConstraint(StringInfo str, Constraint *node)
 {
@@ -2426,6 +2437,9 @@ _outNode(StringInfo str, void *obj)
                        case T_ResTarget:
                                _outResTarget(str, obj);
                                break;
+                       case T_SortBy:
+                               _outSortBy(str, obj);
+                               break;
                        case T_Constraint:
                                _outConstraint(str, obj);
                                break;