Re: Fix for tablename in targetlist - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Fix for tablename in targetlist
Date
Msg-id 200105200435.f4K4ZPO12981@candle.pha.pa.us
Whole thread Raw
In response to Re: Fix for tablename in targetlist  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > In fact, I was
> > right that you have to call transformTargetEntry() -> transformExpr() ->
> > transformIdent() to get isRel set, and I have to do the longer fix.
> 
> Yes, I would think that you should do transformTargetEntry() first and
> then look to see if you have an Ident w/ isRel set.  The initial patch
> was OK because it happened after that transformation.

Yes, and you can't do that later because you need to add to the target
list.  Calling transformTargetEntry returns a Resdom, which I don't
think I can tell if that is a rel or not, and it mucks up
pstate->p_last_resno++.  I will show the patch on the patches list.  It
does things similar to what happens above in that function.


--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Functions returning sets
Next
From: Oleg Bartunov
Date:
Subject: Re: Re: Functions returning sets