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

From Dominique Devienne
Subject Re: how to implement add using upsert and trigger?
Date
Msg-id CAFCRh-_GbmW_qS86eYshq7VrEYQ=Bvqr_W5_odPdwG+4FwkmOQ@mail.gmail.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
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: "yin.zhb@163.com"
Date:
Subject: how to implement add using upsert and trigger?
Next
From: "yin.zhb@163.com"
Date:
Subject: Re: Re: how to implement add using upsert and trigger?