By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,693 Members | 1,972 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,693 IT Pros & Developers. It's quick & easy.

how to catch the error in procedure ?

P: n/a
I need catch the error when my insert clause violate the
primary key .How to write in the server function ?
Thanks for any advice .
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 22 '05 #2

P: n/a
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
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.