Exceptions in PL/Perl?

Started by Jeff Boesover 20 years ago3 messagesgeneral
Jump to latest
#1Jeff Boes
jeff@endpoint.com

How does one raise an exception from a PL/Perl function? Specifically,
this is a trigger function. Is it as simple as "die <msg>"?

#2Michael Fuhr
mike@fuhr.org
In reply to: Jeff Boes (#1)
Re: Exceptions in PL/Perl?

On Thu, Aug 11, 2005 at 10:15:11AM -0400, Jeff Boes wrote:

How does one raise an exception from a PL/Perl function? Specifically,
this is a trigger function. Is it as simple as "die <msg>"?

Use elog:

http://www.postgresql.org/docs/8.0/static/plperl-database.html

--
Michael Fuhr

#3David Fetter
david@fetter.org
In reply to: Jeff Boes (#1)
Re: Exceptions in PL/Perl?

On Thu, Aug 11, 2005 at 10:15:11AM -0400, Jeff Boes wrote:

How does one raise an exception from a PL/Perl function?
Specifically, this is a trigger function. Is it as simple as "die
<msg>"?

elog(ERROR, $errmsg)

works.

Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!