Search Postgresql Archives

Re: exception handling in plperlu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



How about using a try catch block?
isn't that more efficient that eval?
 
~Jas

 
On 3/15/07, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
"Jasbinder Singh Bali" <jsbali@xxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux