From 2f63232d30ca64a8f2684af855230f23a701d371 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 10 May 2004 22:44:49 +0000 Subject: Promote row expressions to full-fledged citizens of the expression syntax, rather than allowing them only in a few special cases as before. In particular you can now pass a ROW() construct to a function that accepts a rowtype parameter. Internal generation of RowExprs fixes a number of corner cases that used to not work very well, such as referencing the whole-row result of a JOIN or subquery. This represents a further step in the work I started a month or so back to make rowtype values into first-class citizens. --- src/backend/nodes/outfuncs.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/backend/nodes/outfuncs.c') diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 9139a9bec5..e919a85194 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.235 2004/05/08 21:21:18 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.236 2004/05/10 22:44:44 tgl Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* @@ -828,6 +828,16 @@ _outArrayExpr(StringInfo str, ArrayExpr *node) WRITE_BOOL_FIELD(multidims); } +static void +_outRowExpr(StringInfo str, RowExpr *node) +{ + WRITE_NODE_TYPE("ROW"); + + WRITE_NODE_FIELD(args); + WRITE_OID_FIELD(row_typeid); + WRITE_ENUM_FIELD(row_format, CoercionForm); +} + static void _outCoalesceExpr(StringInfo str, CoalesceExpr *node) { @@ -1719,6 +1729,9 @@ _outNode(StringInfo str, void *obj) case T_ArrayExpr: _outArrayExpr(str, obj); break; + case T_RowExpr: + _outRowExpr(str, obj); + break; case T_CoalesceExpr: _outCoalesceExpr(str, obj); break; -- cgit v1.2.1