Bruce Momjian <maillist@candle.pha.pa.us> writes:
> Tom, is this fixed?
>> I believe I've identified the main cause of the peculiar behavior we
>> are seeing with INSERT ... SELECT ... GROUP/ORDER BY: it's a subtle
>> parser bug.
>> I believe the most reasonable fix for this is to postpone relabeling
>> of the targetlist entries with destination column names until after
>> analysis of the SELECT's subsidiary clauses is complete.
Yes, for 6.6. There are some other INSERT ... SELECT cases that can't
be fixed until we have separate targetlists for the INSERT and the
source SELECT --- but I did take care of this particular issue. The
column relabeling etc doesn't happen until after we've finished with
analyzing the SELECT subclause.
regards, tom lane