Re: update behavior

From: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: update behavior
Date: 2025-06-19 17:48:30
Message-ID: 58598CFA-7C0F-4629-9D54-C366CEC8CCB4@elevated-dev.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> On Jun 19, 2025, at 11:39 AM, Scott Ribe <scott_ribe(at)elevated-dev(dot)com> wrote:
>
>> On Jun 19, 2025, at 11:34 AM, Scott Ribe <scott_ribe(at)elevated-dev(dot)com> wrote:
>>
>>> On Jun 19, 2025, at 11:31 AM, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>>>
>>> Correct. You need a trigger to prevent the update. There is one provided: suppress_redundant_updates_trigger()
>>
>> Or, in my case that prompted this question, I need a WHERE clause for the ON CONFLICT UPDATE...
>
> Wait, should suppress_redundant_updates_trigger be used even in this case? Would it suppress the update before the constraint checks and invocation of the ON CONFLICT clause???

Or no, duh, this starts with an INSERT where that won't be run, there is no UPDATE until after the constraint violation, but then at that point it would suppress the update?

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Rui DeSousa 2025-06-19 17:51:39 Re: update behavior
Previous Message Scott Ribe 2025-06-19 17:39:54 Re: update behavior