Re: Easy form of "insert if it isn't already there"? - Mailing list pgsql-general

From Berend Tober
Subject Re: Easy form of "insert if it isn't already there"?
Date
Msg-id 4F3B609C.4050103@computer.org
Whole thread Raw
In response to Re: Easy form of "insert if it isn't already there"?  (Chris Angelico <rosuav@gmail.com>)
Responses Re: Easy form of "insert if it isn't already there"?
List pgsql-general
Chris Angelico wrote:
> On Wed, Feb 15, 2012 at 5:26 PM, Bartosz Dmytrak<bdmytrak@eranet.pl>  wrote:
>>
>> e.g. You can use BEGIN... EXCEPTION.... END, good example of
>> such approach is
>> there: http://www.postgresql.org/docs/9.1/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE;
>

I wonder why, in that example, you would not try the INSERT
first, and if that fails, then do the update?



pgsql-general by date:

Previous
From: khizer
Date:
Subject: postgresql-9.0
Next
From: Robert James
Date:
Subject: Re: Memory tuning Postgres