Re: Conditional INSERT: if not exists

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: Don Morrison <donmorrison(at)gmail(dot)com>, Bruno Wolff III <bruno(at)wolff(dot)to>, Franck Routier <franck(dot)routier(at)axege(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Conditional INSERT: if not exists
Date: 2006-08-23 21:10:56
Message-ID: C1123CA0.FF28%sdavis2@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 8/23/06 5:05 PM, "Don Morrison" <donmorrison(at)gmail(dot)com> wrote:

>> If you know there won't be concurrent inserts or deletes affecting the
>> row of interest there is a way to do this in the INSERT statement.
>
> I cannot rule out concurrent inserts.
>
>>> transaction...I'm not sure the nested transaction is necessary...maybe
>>> just the savepoint. Example:
>> Using save points creates nested transactions, so you have that overhead by
>> whatever name it is called.
>
> Overhead yes, that was not the question. The question was is the
> extra nesting necessary?

The answer is yes, I think, if you need your inserts to be done within a
transaction (as opposed to serially).

Sean

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Don Morrison 2006-08-23 21:18:23 Re: Conditional INSERT: if not exists
Previous Message Don Morrison 2006-08-23 21:05:55 Re: Conditional INSERT: if not exists