Re: exception handling in plperlu

Поиск
Список
Период
Сортировка
Искать
От
Jasbinder Singh Bali
Тема
Re: exception handling in plperlu
Дата
Msg-id
a47902760703151906t597d8a1cy1087e2058803bff5@mail.gmail.com
Ответ на
Список
Дерево обсуждения
exception handling in plperlu "Jasbinder Singh Bali" <jsbali@gmail.com>
Re: exception handling in plperlu Tom Lane <tgl@sss.pgh.pa.us>
Re: exception handling in plperlu "Jasbinder Singh Bali" <jsbali@gmail.com>
Re: exception handling in plperlu Martijn van Oosterhout <kleptog@svana.org>
Re: exception handling in plperlu "Jasbinder Singh Bali" <jsbali@gmail.com>
Re: exception handling in plperlu "Adam Rich" <adam.r@sbcglobal.net>
Re: exception handling in plperlu Martijn van Oosterhout <kleptog@svana.org>
Re: exception handling in plperlu Douglas McNaught <doug@mcnaught.org>
Re: exception handling in plperlu merlyn@stonehenge.com (Randal L. Schwartz)
Re: exception handling in plperlu "A.M." <agentm@themactionfaction.com>
Re: exception handling in plperlu "hubert depesz lubaczewski" <depesz@gmail.com>
How about using a try catch block?
isn't that more efficient that eval?
 
~Jas

 
On 3/15/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"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 по дате отправления
От: Tom Lane
Дата:
От: Michael Su
Дата:
FAQ