Re: Unable to handle error in plperl

Поиск
Список
Период
Сортировка
От Alex Hunsaker
Тема Re: Unable to handle error in plperl
Дата
Msg-id CAFaPBrQcU4V=Hh8wXuyT-e4LMc8pocsRt6iaJX8H2brQaodZzA@mail.gmail.com
обсуждение исходный текст
Ответ на Unable to handle error in plperl  (Alex Lai <mlai@sesda3.com>)
Ответы Re: Unable to handle error in plperl  (Ming Lai <mlai@sesda3.com>)
Список pgsql-bugs
On Wed, Jul 10, 2013 at 2:36 PM, Alex Lai <mlai@sesda3.com> wrote:
> Dear all,
>
> I have a situation.  I am unable to pass control back to the function once
> it hit the "undefined_column" error code.
> I am not sure there's a way to return '123' instead exit from the function.
>
> Here is my code
>
> CREATE OR REPLACE FUNCTION foo() RETURNS text as $$
>   my $sql = "";
>   my $status = "";
>   my $r = "";
>   $sql = 'SELECT non_exist_column from a_table limit 1';
>   eval { spi_exec_query($sql);};
>   if ($@) {
>      $status = 'invalid: '.$@;
>      elog(ERROR, $status);

Its this bit here that is tripping you up. Perhaps you meant
elog(INFO, ...) or something?

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

Предыдущее
От: "Albin, Lloyd P"
Дата:
Сообщение: Re: BUG #8291: postgres_fdw does not re-read USER MAPING after change.
Следующее
От: digoal@126.com
Дата:
Сообщение: BUG #8294: new timeline 6 forked off current dat abase system timeline 5 before current recovery point 0/100000