Re: BUG #17845: insert into on conflict bug .
От
Tom Lane
Тема
Re: BUG #17845: insert into on conflict bug .
Дата
Msg-id
3759407.1678972226@sss.pgh.pa.us
Ответ на
Re: BUG #17845: insert into on conflict bug . (David G. Johnston)
Список
Дерево обсуждения
BUG #17845: insert into on conflict bug . PG Bug reporting form <noreply@postgresql.org>
Re: BUG #17845: insert into on conflict bug . jian he <jian.universality@gmail.com>
Re:Re: BUG #17845: insert into on conflict bug . 德哥 <digoal@126.com>
Re: Re: BUG #17845: insert into on conflict bug . jian he <jian.universality@gmail.com>
Re: BUG #17845: insert into on conflict bug . "David G. Johnston" <david.g.johnston@gmail.com>
Re: BUG #17845: insert into on conflict bug . Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #17845: insert into on conflict bug . Peter Geoghegan <pg@bowt.ie>
Re: BUG #17845: insert into on conflict bug . "David G. Johnston" <david.g.johnston@gmail.com>
Re: BUG #17845: insert into on conflict bug . Tom Lane <tgl@sss.pgh.pa.us>
"David G. Johnston" writes: > On Thursday, March 16, 2023, PG Bug reporting form > wrote: >> In the following insert statement, the row has not been updated multiple >> times, why is it still showing an error? >> insert into a >> select * from (values (1,'a',date '2022-01-01'),(1,'b',date >> '2022-01-02'),(1,'c',date '2022-01-03')) as t (id,info,ts) order by ts >> desc >> on conflict (id) >> do update set info=excluded.info, ts=excluded.ts where a.ts < excluded.ts >> ; > You have id=1 in there three times which is precisely the definition of > “multiple times” (I.e., more than 1) Yeah. I believe the reason for the restriction is that it would otherwise be very uncertain what order the input rows get processed in. (No, the "order by" won't save you, because there's still a join to be done after that.) regards, tom lane
В списке pgsql-bugs по дате отправления