Re: plperl exception catching

From: Marc Evans <Marc(at)SoftwareHackery(dot)Com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: plperl exception catching
Date: 2006-12-13 20:43:17
Message-ID: 20061213154216.E4899@me.softwarehackery.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Wed, 13 Dec 2006, Tom Lane wrote:

> Marc Evans <Marc(at)SoftwareHackery(dot)Com> writes:
>> Is it accurate for me to believe that there is no way to catch exception
>> within plperl?
>
> You do it the same way you trap any other error in perl ...

OK, I must be missing something obvious:

c3i=> CREATE OR REPLACE FUNCTION foo_trigger() RETURNS TRIGGER AS $$
c3i$> eval { spi_exec_query('INSERT INTO FOO_BAR VALUES(1)'); } ||
c3i$> spi_exec_query('SELECT 1 as foo');
c3i$> $$ LANGUAGE plperl;
ERROR: creation of Perl function failed: 'eval "string"' trapped by
operation mask at line 2.

- Marc

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bricklen Anderson 2006-12-13 20:51:49 Re: plperl exception catching
Previous Message Ron Mayer 2006-12-13 20:42:16 Re: MySQL drops support for most distributions