Re: update with no changes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: update with no changes
Date
Msg-id 3085805.1637342549@sss.pgh.pa.us
Whole thread Raw
In response to Re: update with no changes  (Marcos Pegoraro <marcos@f10.com.br>)
List pgsql-hackers
Marcos Pegoraro <marcos@f10.com.br> writes:
> But it takes resources for other operations, right ?
> I think this is not unusual. If an user double click on a grid, just sees a
> record and clicks ok to save, probably that application calls an update
> instead of seeing if some field were changed before that.

[ shrug... ]  As David said, if you think that it's important to have
such a check in a particular application, use a trigger to check it.
There's one built-in, you don't even need an extension:

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

We're not going to make that happen by default though, because it'd
be a net drag on better-written applications.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: update with no changes
Next
From: wenjing
Date:
Subject: Re: [Proposal] Global temporary tables