[ADMIN] Catch exceptions outside function

2013-09-18 Thread Roberto Grandi
Dear all I ask for your help cause I can't point out the solution to my problem on PG 8.3 I would catch an exception outside any function/procedure but directly within script. BEGIN; -- raise an exception code EXCEPTION WHEN 'exception_type' THEN ROLLBACK; COMMIT; is it possible with PG

Re: [ADMIN] Catch exceptions outside function

2013-09-18 Thread Albe Laurenz
Roberto Grandi wrote: I ask for your help cause I can't point out the solution to my problem on PG 8.3 I would catch an exception outside any function/procedure but directly within script. BEGIN; -- raise an exception code EXCEPTION WHEN 'exception_type' THEN ROLLBACK;

Re: [ADMIN] Catch exceptions outside function

2013-09-18 Thread David Johnston
Roberto Grandi wrote Hi this is my script in details, remember that I launch it by .Net code (devart connector): SET LOCAL statement_timeout TO 1000; BEGIN; SELECT pg_sleep(5); -- QUERY that is long running; -- Some exception catch such as EXCEPTION END; I supposed my code

Re: [ADMIN] Catch exceptions outside function

2013-09-18 Thread Scott Ribe
On Sep 18, 2013, at 5:53 AM, Roberto Grandi roberto.gra...@trovaprezzi.it wrote: Do you have any suggestion for me? After the timeout, roll back the current transaction. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice -- Sent via pgsql-admin

Re: [ADMIN] Catch exceptions outside function

2013-09-18 Thread Igor Neyman
-Original Message- From: pgsql-admin-ow...@postgresql.org [mailto:pgsql-admin- ow...@postgresql.org] On Behalf Of Roberto Grandi Sent: Wednesday, September 18, 2013 6:17 AM To: pgsql-admin@postgresql.org Subject: [ADMIN] Catch exceptions outside function Dear all I ask

Re: [ADMIN] Catch exceptions outside function

2013-09-18 Thread Scott Ribe
On Sep 18, 2013, at 7:23 AM, David Johnston pol...@yahoo.com wrote: If an exception gets that far your transaction has failed and you have to ROLLBACK. Right, and after my prior post where I suggested rollback, I realized, it may be the case OP doesn't even realize there's an open

Re: [ADMIN] Catch exceptions outside function

2013-09-18 Thread David Johnston
Roberto Grandi wrote Thanks Igor, this is a sufficient idea to take into account for upgrading to 9.x release. Thanks again. There is no 9.x release - singular A release designation requires both the first and second position. 8.4.x 9.0.x 9.1.x 9.2.x 9.3.x An .x can be used in the third