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.