mirror of
https://github.com/postgres/postgres.git
synced 2025-11-21 00:42:43 +03:00
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.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.64 2003/08/04 02:40:01 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.65 2003/08/11 23:04:49 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -150,8 +150,6 @@ expand_targetlist(List *tlist, int command_type,
|
||||
|
||||
if (!resdom->resjunk && resdom->resno == attrno)
|
||||
{
|
||||
Assert(strcmp(resdom->resname,
|
||||
NameStr(att_tup->attname)) == 0);
|
||||
new_tle = old_tle;
|
||||
tlist = lnext(tlist);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user