Exception handling

From: sam <sam(dot)mahindrakar(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Exception handling
Date: 2008-06-04 18:32:13
Message-ID: 8e80cf20-c8eb-4e8f-b796-cf142429167b@34g2000hsf.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Can someone explain me about the exception handling in postgresql. Iam
not understanding the scope of a exception block. The exact confusion
that iam facing is as follows:
I have a procedure as follows
BEGIN
EXECUTE an update statement

EXECUTE an insert statement
EXCEPTION WHEN integrity_conatraint_violation THEN
RAISE NOTICE
END;

This procedure is called within another procedure. Now when an
exception is caught the updates are also getting rolled back. I need
the exception block to work only for the insert statement. But if i
dont write the exception block the whole program stops.
Any suggestions?

Thanks
Sam

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2008-06-04 18:44:10 Re: Exception handling
Previous Message debh 2008-06-04 17:50:11 tablespaces not working