Re: Re: how to implement add using upsert and trigger? - Mailing list pgsql-general

From yin.zhb@163.com
Subject Re: Re: how to implement add using upsert and trigger?
Date
Msg-id 202211282057577060707@163.com
Whole thread Raw
In response to how to implement add using upsert and trigger?  ("yin.zhb@163.com" <yin.zhb@163.com>)
List pgsql-general
em, which is does not matter

yin.zhb@163.com
 
Date: 2022-11-28 20:47
Subject: Re: how to implement add using upsert and trigger?
On Mon, Nov 28, 2022 at 1:37 PM yin.zhb@163.com <yin.zhb@163.com> 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
 

pgsql-general by date:

Previous
From: Dominique Devienne
Date:
Subject: Re: how to implement add using upsert and trigger?
Next
From: Anna B.
Date:
Subject: Re[2]: Index-only scan not working when IN clause has 2 or more values