Re: proposal: plpgsql - Assert statement

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: proposal: plpgsql - Assert statement
Дата
Msg-id 5419DB55.5080702@joh.to
обсуждение исходный текст
Ответ на Re: proposal: plpgsql - Assert statement  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On 9/17/14, 9:00 PM, Peter Eisentraut wrote:
> On 9/14/14 2:49 PM, Jan Wieck wrote:
>> I don't think it is even a good idea to implement assertions that can
>> query arbitrary data.
>
> In a normal programming language, an assertion is usually a static fault
> in your program.  If the assertion ever fails, you fix your program and
> then it hopefully never happens again.
>
> Assertion that query the state of the database or result row counts are
> pushing that concept quite a bit.  Those are not assertions, those are
> just plain old error handling.

*shrug*  I don't see them as error handling if they're just checking 
conditions which should never happen.

That said, in PL/PgSQL these expressions would likely have to be SQL 
expressions, and then you'd have to go out of your way to implement 
assertions which *can't* query arbitrary data.  And that just seems silly.


.marko



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

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