1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

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.
This commit is contained in:
Tom Lane
2005-04-06 16:34:07 +00:00
parent 0f3748a28c
commit ad161bcc8a
43 changed files with 537 additions and 799 deletions

View File

@ -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;