Re: UPDATE sql question - Mailing list pgsql-general

From Tom Lane
Subject Re: UPDATE sql question
Date
Msg-id 8293.1059751002@sss.pgh.pa.us
Whole thread Raw
In response to Re: UPDATE sql question  (Ron Johnson <ron.l.johnson@cox.net>)
Responses Re: UPDATE sql question  (Ron Johnson <ron.l.johnson@cox.net>)
List pgsql-general
Ron Johnson <ron.l.johnson@cox.net> writes:
> On Mon, 2003-07-28 at 03:24, Andrei Verovski wrote:
>> What exactly will happen if UPDATE sql statement instructs to update
>> some columns with the same values as already in the database? Will
>> Postgres update only different values or it will simply modify all
>> columns listed in UPDATE sql?

> Looks like it does what you tell it to do...

I think he was asking an implementation question, viz: does it skip the
physical update if no values in a row actually change?  The answer is
no.  I'd think that in most cases, the extra time spent checking to see
whether the updated columns didn't change would be a net loss.

            regards, tom lane

pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: Re: Table Stats
Next
From: "Johnson, Shaunn"
Date:
Subject: Re: PC color icon data?