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 th

Re: [ADMIN] Catch exceptions outside function

2013-09-18 Thread Roberto Grandi
RE: Catch exceptions outside function > -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 ex

Re: [ADMIN] Catch exceptions outside function

2013-09-18 Thread Scott Ribe
On Sep 18, 2013, at 7:23 AM, David Johnston 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 transaction, which must e

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 >

Re: [ADMIN] Catch exceptions outside function

2013-09-18 Thread Scott Ribe
On Sep 18, 2013, at 5:53 AM, Roberto Grandi 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 mailing list (pgsql-admin@po

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

Re: [ADMIN] Catch exceptions outside function

2013-09-18 Thread Albe Laurenz
Roberto Grandi wrote: > 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 suppos

Re: [ADMIN] Catch exceptions outside function

2013-09-18 Thread Roberto Grandi
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 can throw an eception for timeout and

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 ROLLBAC

[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 8