Re: Bug - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug
Date
Msg-id 24733.970811853@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Bug  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
A good while back, Oleg Broytmann <phd@sun.med.ru> wrote:
>> ran=> create table test1 (n int default nextval('seq_test'), t text);
>> ran=> insert into test1 ("t") select distinct src from test_source;
>> [ doesn't work right ]

> My, that's an interesting case.  I think that fits right in with my
> remark yesterday that the SELECT inside an INSERT ... SELECT needs
> to have a targetlist that's separate from the INSERT's list.  As it
> stands, we form a targetlist representing the set of values that need
> to be inserted into the target table --- and then the DISTINCT pass
> runs on those tuples :-(, because there is nothing else for it to
> run on.

FYI, this now works in current sources.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Kristofer Munn
Date:
Subject: Re: Exited with status 139
Next
From: Alfred Perlstein
Date:
Subject: Re: Exited with status 139