Search Postgresql Archives

Re: Re: how to implement add using upsert and trigger?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



em, which is does not matter

yin.zhb@xxxxxxx
 
From: Dominique Devienne
Date: 2022-11-28 20:47
To: yin.zhb@xxxxxxx
CC: pgsql-general
Subject: Re: how to implement add using upsert and trigger?
On Mon, Nov 28, 2022 at 1:37 PM yin.zhb@xxxxxxx <yin.zhb@xxxxxxx> wrote:
>     on conflict(itemid) do update
>     set value = excluded.value + new.value, cnt = excluded.cnt +1 where excluded.itemid = new.itemid;
 
OT, but isn't `where excluded.itemid = new.itemid` redundant, given
`on conflict(itemid)`?
I'm asking more because I'm not sure, for my own education. Thanks, --DD
 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux