Re: update behavior

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: update behavior
Date: 2025-06-19 17:31:59
Message-ID: CAKFQuwbwAbbk6KUKXyX2VxpX3aUDhS5Zd__2JKQXdhH5zHaB4g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, Jun 19, 2025 at 10:24 AM Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
wrote:

> I believe that if I UPDATE a row with the same values that it already has,
> this still dirties pages, writes the row, generates a WAL entry. There is
> no shortcut in the processing that's "hey, there's not really a change
> here, we'll just leave storage alone".
>
> Is this correct?
>
>
Correct. You need a trigger to prevent the update. There is one provided:
suppress_redundant_updates_trigger()

https://www.postgresql.org/docs/17/functions-trigger.html

David J.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Ribe 2025-06-19 17:34:19 Re: update behavior
Previous Message Scott Ribe 2025-06-19 17:23:58 update behavior