Re: proposal: plpgsql - Assert statement

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: proposal: plpgsql - Assert statement
Дата
Msg-id 540EB11C.2060603@joh.to
обсуждение исходный текст
Ответ на Re: proposal: plpgsql - Assert statement  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
On 2014-09-09 07:54, Craig Ringer wrote:
> On 09/05/2014 05:21 PM, Pavel Stehule wrote:
>>
>> *shrug*  Doing it in SQL would probably break more stuff.  I'm trying to
>> contain the damage.  And arguably, this is mostly only useful in PL/PgSQL.
>
> I've wanted assertions in SQL enough that I often write trivial wrappers
> around `raise` in PL/PgSQL for use in `CASE` statements etc.

Yeah, as have I.  I've also advocated that there should be a 
raise_exception(text, anyelement) anyelement  function shipped with 
postgres.

But this is something different; this is just a single statement which 
asserts that some expression evaluates to true.  Even if we allowed it 
to be used as a scalar expression, there's still the problem anyelement 
is commonly used to work around.


.marko



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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Stating the significance of Lehman & Yao in the nbtree README
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: pgcrypto: PGP armor headers