Re: Assertions in PL/PgSQL

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Assertions in PL/PgSQL
Дата
Msg-id CAFj8pRDcvURmTQspW-D3YpCCpRr36xvg1qJVLLyH6UXpoKLqbg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Assertions in PL/PgSQL  (Marko Tiikkaja <marko@joh.to>)
Ответы Re: Assertions in PL/PgSQL  (Marko Tiikkaja <marko@joh.to>)
Re: Assertions in PL/PgSQL  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
<p dir="ltr"><br /> Dne 14. 9. 2013 23:35 "Marko Tiikkaja" <<a href="mailto:marko@joh.to">marko@joh.to</a>>
napsal(a):<br/> ><br /> > On 2013-09-14 23:05, Pavel Stehule wrote:<br /> >><br /> >> A some
languageshas a generic PRAGMA keyword. So I would be much more<br /> >> happy with something like<br />
>><br/> >> PRAGMA Assert(found);<br /> >><br /> >> It is much more close to ADA, and it allows
areuse of new keyword for any<br /> >> other usage in future (your proposal is too simply, without possibility<br
/>>> open new doors in future). And we can define a some standard predefined<br /> >> asserts too - like
Assert,AssertNotNull, AssertNotEmpty, ...<br /> ><br /> ><br /> > I don't see why e.g. PRAGMA
AssertNotEmpty(foo); would be better than ASSERT NotEmpty(foo);  and the NotNull version is even sillier considering
theexpression is arbitrary SQL, and we'd have to do all kinds of different versions or people would be disappointed
(AssertNull,AssertNotNull, AssertExists, AssertNotExists, etc.).<br /> ><br /> > I see what you're trying to do,
butI don't think crippling new features just because we might do something similar at some point is a good idea.  I'm
guessingthis is what happened with the row_count syntax, which made the feature an absolute nightmare to use.<br /><p
dir="ltr">amore than one asserts can be my personal preferrence (it is not important). <p dir="ltr">but introduction a
reservedkeword for one very special purpose (without extensibility) is not prudent.<p dir="ltr">plpgsql has still lot
ofrelations to pl/sql and ada, and I don't think so we have to introduce a new original syntax everytime.<br /><p
dir="ltr">><br/> >> other issue - A asserts macros has one or two parameters usually. You<br /> >>
shouldto support two params assert (with message).<br /> ><br /> ><br /> > That I think is worth looking
into.<br/> ><br /> ><br /> > Regards,<br /> > Marko Tiikkaja<br /> 

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: Assertions in PL/PgSQL