Trapping PL/Perl spi_query_exec errors

Поиск
Список
Период
Сортировка
От Worky Workerson
Тема Trapping PL/Perl spi_query_exec errors
Дата
Msg-id ce4072df0611220835v64ccf4bck929fbfd08c9c25f6@mail.gmail.com
обсуждение исходный текст
Ответы Re: Trapping PL/Perl spi_query_exec errors  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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!

В списке pgsql-general по дате отправления:

Предыдущее
От: Tony Caduto
Дата:
Сообщение: Re: Data transfer between databases over the Internet
Следующее
От: Jack Orenstein
Дата:
Сообщение: Buffer overflow in psql