Re: Does update = delete + insert ? - Mailing list pgsql-general

From Gauthier, Dave
Subject Re: Does update = delete + insert ?
Date
Msg-id 482E80323A35A54498B8B70FF2B879800458C31081@azsmsx504.amr.corp.intel.com
Whole thread Raw
In response to Re: Does update = delete + insert ?  (Steve Atkins <steve@blighty.com>)
List pgsql-general
Ohhhh.. Yes, I forgot about the triggers.
Good call !!!  This table has lots of triggers.

Thanks for reminding me of this!!!



-----Original Message-----
From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Steve Atkins
Sent: Wednesday, May 26, 2010 3:05 PM
To: pgsql-general General
Subject: Re: [GENERAL] Does update = delete + insert ?


On May 26, 2010, at 11:41 AM, Gauthier, Dave wrote:

> Hi:
>
> Under the hood, does PG implement an update statement as a delete followed by an insert?    I'm at a point in coding
ascript where it would be more expeditious for me to delete/insert a record as opposed to update and want to know if I
loseanything by doing that. 

As far as writes to the table are concerned, yes they're pretty much the same.

If there are triggers on the table, though, they may see the two actions differently.

Cheers,
  Steve
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Steve Atkins
Date:
Subject: Re: Does update = delete + insert ?
Next
From: Peter Eisentraut
Date:
Subject: Re: cursor_to_xml iteration of a table