Re: update behavior - Mailing list pgsql-admin

From Rui DeSousa
Subject Re: update behavior
Date
Msg-id 5354269F-0A69-48E6-8BFA-C118B75970C3@icloud.com
Whole thread Raw
List pgsql-admin

On Jun 19, 2025, at 1:23 PM, 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, but it can be avoided. 

No update occurs in this case:. 

update foo
  set data = ‘hello world’
where id = 33
   and data is distinct from ‘hello world’
;

pgsql-admin by date:

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