Re: update behavior - Mailing list pgsql-admin

From David G. Johnston
Subject Re: update behavior
Date
Msg-id CAKFQuwbwAbbk6KUKXyX2VxpX3aUDhS5Zd__2JKQXdhH5zHaB4g@mail.gmail.com
Whole thread Raw
In response to update behavior  (Scott Ribe <scott_ribe@elevated-dev.com>)
Responses Re: update behavior
List pgsql-admin
On Thu, Jun 19, 2025 at 10:24 AM Scott Ribe <scott_ribe@elevated-dev.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()


David J.

pgsql-admin by date:

Previous
From: Scott Ribe
Date:
Subject: update behavior
Next
From: Scott Ribe
Date:
Subject: Re: update behavior