Re: Insert Ignore or something similar...

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Cristian Prieto <cristian(at)clickdiario(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Insert Ignore or something similar...
Date: 2005-09-06 18:42:09
Message-ID: 20050906184209.GH26068@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2005-09-06 18:47:42 Re: Shared disk storage
Previous Message Vlad 2005-09-06 18:33:16 Re: "select ..... for update of ..." doesn't support full qualified table name?