plperl error format vs plpgsql error format vs pgTAP

Поиск
Список
Период
Сортировка
От Kevin Field
Тема plperl error format vs plpgsql error format vs pgTAP
Дата
Msg-id 1c26d3f4-a49a-4916-91d3-b3ca7e9d3cc2@m17g2000vbi.googlegroups.com
обсуждение исходный текст
Ответы Re: plperl error format vs plpgsql error format vs pgTAP  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: plperl error format vs plpgsql error format vs pgTAP  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
I use pgTAP to make sure my functions produce the correct errors using
throws_ok().  So when I get an error from a plpgsql function, it looks
like this:

ERROR:  upper bound of FOR loop cannot be null
CONTEXT:  PL/pgSQL function "foo" line 35 at FOR with integer loop
variable

...which I can then test using throws_ok by giving it the string
'upper bound of FOR loop cannot be null'.  However, in a plperl
function, errors come out in this format:

error from Perl function "check_no_loop": Loops not allowed!  Node 1
cannot be part of node 3 at line 13.

Unfortunately, I can't test for this without including the line
number, which means that changing any plperl function that I have such
a test for pretty much guarantees that I'll need to change the test to
reflect the new line numbers the errors would be thrown from in the
function.

Is it possible to unify the error reporting format, so pgTAP can test
them without needing line numbers from plperl functions?


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: proposal: early casting in plpgsql
Следующее
От: Robert Haas
Дата:
Сообщение: Re: search_path vs extensions