is this behavior correct?
create or replace function error() returns text as
$$
begin
raise exception 'test!';
end;
$$ language plpgsql;
create or replace function test() returns text as
$$
my $res = spi_query("select error()"); # this error is ignored
my $res = spi_query("something stupid!"); # this is not?
$$ language plperlu;
merlin
On Tue, Jan 5, 2010 at 12:49 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
> is this behavior correct?
>
> create or replace function error() returns text as
> $$
> begin
> raise exception 'test!';
> end;
> $$ language plpgsql;
>
>
> create or replace function test() returns text as
> $$
> my $res = spi_query("select error()"); # this error is ignored
> my $res = spi_query("something stupid!"); # this is not?
> $$ language plperlu;
I got the answer on IRC. spi_query only parses the statement but does
not necessarily execute it (it's more like spi_prepare).
spi_exec_query works the way I think it should.
merlin
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера