Re: proposal: plpgsql - Assert statement

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: proposal: plpgsql - Assert statement
Дата
Msg-id CAFj8pRBq7gxVET-pUs=Yixgmcq5ymJG2R20uK9312xXveyBRjw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: plpgsql - Assert statement  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: proposal: plpgsql - Assert statement  (Marko Tiikkaja <marko@joh.to>)
Список pgsql-hackers


2014-11-19 18:01 GMT+01:00 Tom Lane <tgl@sss.pgh.pa.us>:
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Nov 19, 2014 at 11:13 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> FWIW, I would vote against it also.  I do not find this to be a natural
>> extension of RAISE; it adds all sorts of semantic issues.  (In particular,
>> what is the evaluation order of the WHEN versus the other subexpressions
>> of the RAISE?)

> What I liked about this syntax was that we could eventually have:
> RAISE ASSERT WHEN stuff;
> ...and if assertions are disabled, we can skip evaluating the
> condition.  If you just write an IF .. THEN block you can't do that.

Well, if that's what you want, let's just invent

ASSERT condition


there was this proposal .. ASSERT statement .. related discuss was finished, because it needs a reserved keyword "ASSERT".
 
and not tangle RAISE into it.  The analogy to EXIT WHEN is a lot
cleaner in this form: no order-of-evaluation issues, no questions
of whether a sub-clause results in totally changing the meaning
of the command.  And if your argument is partially based on
how much you have to type, doesn't this way dominate all others?

                        regards, tom lane

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: proposal: plpgsql - Assert statement
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: amcheck prototype