Re: proposal: plpgsql - Assert statement
От | Pavel Stehule |
---|---|
Тема | Re: proposal: plpgsql - Assert statement |
Дата | |
Msg-id | CAFj8pRDPXR0+hz0qsYUMci0qNSADMDKayB70nHgY=CK3PfNy5Q@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: proposal: plpgsql - Assert statement (Craig Ringer <craig@2ndquadrant.com>) |
Ответы |
Re: proposal: plpgsql - Assert statement
|
Список | pgsql-hackers |
2014-09-09 7:55 GMT+02:00 Craig Ringer <craig@2ndquadrant.com>:
On 09/09/2014 05:20 AM, Robert Haas wrote:
>
> I previously proposed RAISE ASSERT ... WHERE, which seems like a nice
> variant of what we've already got, but perhaps this whole discussion
> merely illustrates that it's hard to get more than 1 vote for any
> proposal in this area.
Well, you have Petr's for RAISE EXCEPTION ... WHEN, and I'd also like
that or RAISE ASSERT ... WHEN.
Ada is language with strong character, and PLpgSQL is little bit strange fork - so it isn't easy to find some form, how to solve all requirements.
My requests:
* be consistent with current PLpgSQL syntax and logic
* allow some future extensibility
* allow a static analyses without hard expression processing
But I am thinking so there are some points where can be some agreement - although it is not ASSERT implementation.
enhancing RAISE WHEN - please, see attached patch -
I prefer RAISE WHEN again RAISE WHERE due consistency with EXIT and CONTINUE [ WHEN ];
Next we can reserve some SQLCODE for assertation and we can implement it as not handled exception. It is only "cancel" now, and it is not usable . Probably it should be implement on SQL level - not on plpgsql only.
Regards
Pavel
Much (much) saner than the other proposals on this thread IMO.
--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
Вложения
В списке pgsql-hackers по дате отправления: