Re: update with no changes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: update with no changes
Date: 2021-11-19 17:22:29
Message-ID: 3085805.1637342549@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marcos Pegoraro <marcos(at)f10(dot)com(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message wenjing 2021-11-19 17:31:09 Re: [Proposal] Global temporary tables
Previous Message Andres Freund 2021-11-19 17:20:47 Re: update with no changes