Re: Insert Ignore or something similar... - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Insert Ignore or something similar...
Date
Msg-id 20050906184209.GH26068@surnet.cl
Whole thread Raw
In response to Re: Insert Ignore or something similar...  ("Cristian Prieto" <cristian@clickdiario.com>)
List pgsql-general
On Tue, Sep 06, 2005 at 08:55:26AM -0600, Cristian Prieto wrote:
> Thanks a lot!
>
> Well, I just want to avoid a begin...exception when... end block in
> plpgsql, just do it in a few lines of code without a sp...

SAVEPOINT foo;
INSERT ... ;
if it fails
  ROLLBACK TO foo;
else
  RELEASE foo

This is pretty much the same that plpgsql begin/exception/end does.

--
Alvaro Herrera -- Valdivia, Chile         Architect, www.EnterpriseDB.com
"La conclusión que podemos sacar de esos estudios es que
no podemos sacar ninguna conclusión de ellos" (Tanenbaum)

pgsql-general by date:

Previous
From: Vlad
Date:
Subject: Re: "select ..... for update of ..." doesn't support full qualified table name?
Next
From: Matt Miller
Date:
Subject: Re: "select ..... for update of ..." doesn't support