plpgsql.print_strict_params

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема plpgsql.print_strict_params
Дата
Msg-id 52338A29.4010506@joh.to
обсуждение исходный текст
Ответы Re: plpgsql.print_strict_params  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: plpgsql.print_strict_params  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Hi,

Attached is a patch for optionally printing more information on STRICT
failures in PL/PgSQL:


set plpgsql.print_strict_params to true;

create or replace function footest() returns void as $$
declare
x record;
p1 int := 2;
p3 text := 'foo';
begin
   -- too many rows
   select * from foo where f1 > p1 or f1::text = p3  into strict x;
   raise notice 'x.f1 = %, x.f2 = %', x.f1, x.f2;
end$$ language plpgsql;
select footest();
ERROR:  query returned more than one row
DETAIL:  p1 = '2', p3 = 'foo'
CONTEXT:  PL/pgSQL function footest() line 8 at SQL statement


This parameter is turned off by default to preserve old behaviour, but
can be extremely useful when debugging code in test environments.

I will add this to the open commitfest, but in the meanwhile, any
feedback is appreciated.


Regards,
Marko Tiikkaja

Вложения

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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE
Следующее
От: Andres Freund
Дата:
Сообщение: Re: proposal: Set effective_cache_size to greater of .conf value, shared_buffers