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/optimizer/util/plancat.c | |
parent | 0f3748a28c42d09d794ff00af3f1f992eaa5fd7c (diff) |
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/optimizer/util/plancat.c')
-rw-r--r-- | src/backend/optimizer/util/plancat.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index c64f2aad1ff..e01a1d76a59 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.103 2005/03/29 00:17:02 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.104 2005/04/06 16:34:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -378,6 +378,7 @@ build_physical_tlist(Query *root, RelOptInfo *rel) for (attrno = 1; attrno <= numattrs; attrno++) { Form_pg_attribute att_tup = relation->rd_att->attrs[attrno - 1]; + Var *var; if (att_tup->attisdropped) { @@ -386,13 +387,17 @@ build_physical_tlist(Query *root, RelOptInfo *rel) break; } + var = makeVar(varno, + attrno, + att_tup->atttypid, + att_tup->atttypmod, + 0); + tlist = lappend(tlist, - create_tl_element(makeVar(varno, - attrno, - att_tup->atttypid, - att_tup->atttypmod, - 0), - attrno)); + makeTargetEntry((Expr *) var, + attrno, + NULL, + false)); } heap_close(relation, AccessShareLock); |