From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | "digoal(at)126(dot)com" <digoal(at)126(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org> |
Subject: | Re: BUG #17845: insert into on conflict bug . |
Date: | 2023-03-16 12:22:23 |
Message-ID: | CAKFQuwZtoQ_Mmt2xuEe7pFvnbGYzPM7i1swpaTq8Ew7jHqVukA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On Thursday, March 16, 2023, PG Bug reporting form <noreply(at)postgresql(dot)org>
wrote:
> The following bug has been logged on the website:
>
> Bug reference: 17845
> Logged by: Zhou Digoal
> Email address: digoal(at)126(dot)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.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2023-03-16 13:10:26 | Re: BUG #17845: insert into on conflict bug . |
Previous Message | hubert depesz lubaczewski | 2023-03-16 11:56:24 | Re: pg_read_server_files doesn't let me use pg_ls_dir() or pg_read_file? |