From 302f1a86dc1125f681b9a3b3509d1be7e33b0e4f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 11 Aug 2003 23:04:50 +0000 Subject: Rewriter and planner should use only resno, not resname, to identify target columns in INSERT and UPDATE targetlists. Don't rely on resname to be accurate in ruleutils, either. This fixes bug reported by Donald Fraser, in which renaming a column referenced in a rule did not work very well. --- src/backend/nodes/print.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/backend/nodes/print.c') diff --git a/src/backend/nodes/print.c b/src/backend/nodes/print.c index c3d702316d..c3417d8efa 100644 --- a/src/backend/nodes/print.c +++ b/src/backend/nodes/print.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.63 2003/08/04 02:39:59 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.64 2003/08/11 23:04:49 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -448,7 +448,8 @@ print_tl(List *tlist, List *rtable) { TargetEntry *tle = lfirst(tl); - printf("\t%d %s\t", tle->resdom->resno, tle->resdom->resname); + printf("\t%d %s\t", tle->resdom->resno, + tle->resdom->resname ? tle->resdom->resname : ""); if (tle->resdom->ressortgroupref != 0) printf("(%u):\t", tle->resdom->ressortgroupref); else -- cgit v1.2.1