diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-10 22:44:49 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-10 22:44:49 +0000 |
commit | 2f63232d30ca64a8f2684af855230f23a701d371 (patch) | |
tree | b7a7707d1ec9edf368780cd3f4a23755527c5884 /src/backend/nodes/copyfuncs.c | |
parent | 9a939886ac782cfee3cd5fdd1c58689163ed84be (diff) | |
download | postgresql-2f63232d30ca64a8f2684af855230f23a701d371.tar.gz postgresql-2f63232d30ca64a8f2684af855230f23a701d371.zip |
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.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r-- | src/backend/nodes/copyfuncs.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 1466be98cbb..91fb3b08343 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -15,7 +15,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.280 2004/05/05 04:48:45 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.281 2004/05/10 22:44:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -999,6 +999,21 @@ _copyArrayExpr(ArrayExpr *from) } /* + * _copyRowExpr + */ +static RowExpr * +_copyRowExpr(RowExpr *from) +{ + RowExpr *newnode = makeNode(RowExpr); + + COPY_NODE_FIELD(args); + COPY_SCALAR_FIELD(row_typeid); + COPY_SCALAR_FIELD(row_format); + + return newnode; +} + +/* * _copyCoalesceExpr */ static CoalesceExpr * @@ -2674,6 +2689,9 @@ copyObject(void *from) case T_ArrayExpr: retval = _copyArrayExpr(from); break; + case T_RowExpr: + retval = _copyRowExpr(from); + break; case T_CoalesceExpr: retval = _copyCoalesceExpr(from); break; |