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/outfuncs.c | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'src/backend/nodes/outfuncs.c') diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index bb2b2c35f90..91a7abf5749 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.245 2004/12/31 21:59:55 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.246 2005/04/06 16:34:05 tgl Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* @@ -520,21 +520,6 @@ _outHash(StringInfo str, Hash *node) * *****************************************************************************/ -static void -_outResdom(StringInfo str, Resdom *node) -{ - WRITE_NODE_TYPE("RESDOM"); - - WRITE_INT_FIELD(resno); - WRITE_OID_FIELD(restype); - WRITE_INT_FIELD(restypmod); - WRITE_STRING_FIELD(resname); - WRITE_UINT_FIELD(ressortgroupref); - WRITE_OID_FIELD(resorigtbl); - WRITE_INT_FIELD(resorigcol); - WRITE_BOOL_FIELD(resjunk); -} - static void _outAlias(StringInfo str, Alias *node) { @@ -900,8 +885,13 @@ _outTargetEntry(StringInfo str, TargetEntry *node) { WRITE_NODE_TYPE("TARGETENTRY"); - WRITE_NODE_FIELD(resdom); WRITE_NODE_FIELD(expr); + WRITE_INT_FIELD(resno); + WRITE_STRING_FIELD(resname); + WRITE_UINT_FIELD(ressortgroupref); + WRITE_OID_FIELD(resorigtbl); + WRITE_INT_FIELD(resorigcol); + WRITE_BOOL_FIELD(resjunk); } static void @@ -1684,9 +1674,6 @@ _outNode(StringInfo str, void *obj) case T_Hash: _outHash(str, obj); break; - case T_Resdom: - _outResdom(str, obj); - break; case T_Alias: _outAlias(str, obj); break; -- cgit v1.2.3