Search Postgresql Archives

Re: Insert Ignore or something similar...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux