Re: Does update = delete + insert ?

From: Steve Atkins <steve(at)blighty(dot)com>
To: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Does update = delete + insert ?
Date: 2010-05-26 19:04:54
Message-ID: 6AC6AD90-9779-47AB-9950-40016E9F7E0A@blighty.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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 a script where it would be more expeditious for me to delete/insert a record as opposed to update and want to know if I lose anything 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2010-05-26 19:14:37 Re: Does update = delete + insert ?
Previous Message Andreas Kretschmer 2010-05-26 18:50:16 Re: Does update = delete + insert ?