From ad161bcc8a3792d18ef2f3ebe66bb1e22d42b6f2 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 6 Apr 2005 16:34:07 +0000 Subject: Merge Resdom nodes into TargetEntry nodes to simplify code and save a few palloc's. I also chose to eliminate the restype and restypmod fields entirely, since they are redundant with information stored in the node's contained expression; re-examining the expression at need seems simpler and more reliable than trying to keep restype/restypmod up to date. initdb forced due to change in contents of stored rules. --- src/backend/nodes/copyfuncs.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'src/backend/nodes/copyfuncs.c') diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index c2130e370d4..e314959e373 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.299 2005/03/29 17:58:50 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.300 2005/04/06 16:34:05 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -539,26 +539,6 @@ _copyLimit(Limit *from) * **************************************************************** */ -/* - * _copyResdom - */ -static Resdom * -_copyResdom(Resdom *from) -{ - Resdom *newnode = makeNode(Resdom); - - COPY_SCALAR_FIELD(resno); - COPY_SCALAR_FIELD(restype); - COPY_SCALAR_FIELD(restypmod); - COPY_STRING_FIELD(resname); - COPY_SCALAR_FIELD(ressortgroupref); - COPY_SCALAR_FIELD(resorigtbl); - COPY_SCALAR_FIELD(resorigcol); - COPY_SCALAR_FIELD(resjunk); - - return newnode; -} - /* * _copyAlias */ @@ -1077,8 +1057,13 @@ _copyTargetEntry(TargetEntry *from) { TargetEntry *newnode = makeNode(TargetEntry); - COPY_NODE_FIELD(resdom); COPY_NODE_FIELD(expr); + COPY_SCALAR_FIELD(resno); + COPY_STRING_FIELD(resname); + COPY_SCALAR_FIELD(ressortgroupref); + COPY_SCALAR_FIELD(resorigtbl); + COPY_SCALAR_FIELD(resorigcol); + COPY_SCALAR_FIELD(resjunk); return newnode; } @@ -2670,9 +2655,6 @@ copyObject(void *from) /* * PRIMITIVE NODES */ - case T_Resdom: - retval = _copyResdom(from); - break; case T_Alias: retval = _copyAlias(from); break; -- cgit v1.2.3