diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-06 16:34:07 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-06 16:34:07 +0000 |
commit | ad161bcc8a3792d18ef2f3ebe66bb1e22d42b6f2 (patch) | |
tree | 18ec8963fbd1d6dd62ad214bfe3552fc2e7d06eb /src/backend/nodes/copyfuncs.c | |
parent | 0f3748a28c42d09d794ff00af3f1f992eaa5fd7c (diff) | |
download | postgresql-ad161bcc8a3792d18ef2f3ebe66bb1e22d42b6f2.tar.gz postgresql-ad161bcc8a3792d18ef2f3ebe66bb1e22d42b6f2.zip |
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.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r-- | src/backend/nodes/copyfuncs.c | 32 |
1 files changed, 7 insertions, 25 deletions
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 $ * *------------------------------------------------------------------------- */ @@ -540,26 +540,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 */ static Alias * @@ -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; |