On Thursday, March 16, 2023, PG Bug reporting form <
noreply@postgresql.org> wrote:
The following bug has been logged on the website:
Bug reference: 17845
Logged by: Zhou Digoal
Email address: digoal@126.com
PostgreSQL version: 15.2
Operating system: macos
Description:
insert into on conflict bug .
In the following insert statement, the row has not been updated multiple
times, why is it still showing an error?
```
create table a (id int primary key, info text, ts date);
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)
David J.