Trapping PL/Perl spi_query_exec errors

From: "Worky Workerson" <worky(dot)workerson(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Trapping PL/Perl spi_query_exec errors
Date: 2006-11-22 16:35:22
Message-ID: ce4072df0611220835v64ccf4bck929fbfd08c9c25f6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This is probably a really basic question, but how do I trap when
spi_query_exec returns an error in PL/Perl? I would expect to be able
to use the return value to determine an error condition, however I get
the message:

ERROR: error from Perl function: relation "foo" does not exist at line 7.

where line 7 looks like:

my $rv = spi_query_exec('select count(*) from foo');

Alternatively, I would expect to be able to trap it with eval, however
the trusted PL/Perl does not support eval.

Thanks!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John McCawley 2006-11-22 16:38:28 Re: Data transfer between databases over the Internet
Previous Message Tony Caduto 2006-11-22 16:30:21 Re: Data transfer between databases over the Internet