Re: Assertions in PL/PgSQL

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Assertions in PL/PgSQL
Дата
Msg-id 1385527300.28256.15.camel@vanquo.pezone.net
обсуждение исходный текст
Ответ на Re: Assertions in PL/PgSQL  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Assertions in PL/PgSQL  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On Tue, 2013-11-19 at 10:40 -0500, Robert Haas wrote:
> I think the goal was to get to RAISE ASSERT
> WHEN ...; then, if assertions are off, you do nothing; if they're on,
> you error.  IF condition THEN RAISE..." isn't a suitable surrogate in
> that case because you incur the overhead of testing the condition
> regardless.

So if I do RAISE ASSERT WHEN condition and assertions are off, then
condition wouldn't even be evaluated?  But what about RAISE NOTICE WHEN,
when log_min_messages is error?  What about the side effects of the
format string?  This is all just getting too weird.

I don't see anything wrong with considering a separate ASSERT command
with its own semantics, like in many other programming languages.





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

Предыдущее
От: Rajeev rastogi
Дата:
Сообщение: Re: COPY table FROM STDIN doesn't show count tag
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: New option for pg_basebackup, to specify a different directory for pg_xlog