how to catch the error in procedure ?

Started by LitelWangabout 22 years ago3 messagesgeneral
Jump to latest
#1LitelWang
wlxyk@vip.163.com

I need catch the error when my insert clause violate the
primary key .How to write in the server function ?
Thanks for any advice .

#2Richard Huxton
dev@archonet.com
In reply to: LitelWang (#1)
Re: how to catch the error in procedure ?

On Friday 16 January 2004 04:50, LitelWang wrote:

I need catch the error when my insert clause violate the
primary key .How to write in the server function ?
Thanks for any advice .

You can't (at the moment). An error terminates a transaction immediately in
PG's current model.

--
Richard Huxton
Archonet Ltd

#3Robert Treat
xzilla@users.sourceforge.net
In reply to: Richard Huxton (#2)
Re: how to catch the error in procedure ?

On Fri, 2004-01-16 at 04:41, Richard Huxton wrote:

On Friday 16 January 2004 04:50, LitelWang wrote:

I need catch the error when my insert clause violate the
primary key .How to write in the server function ?
Thanks for any advice .

You can't (at the moment). An error terminates a transaction immediately in
PG's current model.

Didn't someone say this could be implemented in some of the other
pl's... plpython maybe? Or maybe they were using dblink to make a
separate connection/query... ?

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL