Re: exception handling in plperlu - Mailing list pgsql-general

From Tom Lane
Subject Re: exception handling in plperlu
Date
Msg-id 29490.1174010219@sss.pgh.pa.us
Whole thread Raw
In response to exception handling in plperlu  ("Jasbinder Singh Bali" <jsbali@gmail.com>)
Responses Re: exception handling in plperlu  ("Jasbinder Singh Bali" <jsbali@gmail.com>)
List pgsql-general
"Jasbinder Singh Bali" <jsbali@gmail.com> writes:
> Actually, if I rephrase my requirement, I need to catch an exception at any
> point ,where ever it is raised, in the perl code.
> E.g during an insert, there is a foreign key contraint violation, then i
> need to catch this specific error and do something with it.

Since PG 8.0, you should be able to trap exceptions with eval{}, same as
you would do in any Perl code.

            regards, tom lane

pgsql-general by date:

Previous
From: "Jasbinder Singh Bali"
Date:
Subject: exception handling in plperlu
Next
From: "Jasbinder Singh Bali"
Date:
Subject: Re: exception handling in plperlu