On Wed, Nov 19, 2014 at 11:13 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
FWIW, I would vote against it also. I do not find this to be a natural extension of RAISE; it adds all sorts of semantic issues. (In
particular,
what is the evaluation order of the WHEN versus the other subexpressions of the RAISE?)
What I liked about this syntax was that we could eventually have: RAISE ASSERT WHEN stuff; ...and if assertions are disabled, we can skip evaluating the condition. If you just write an IF .. THEN block you can't do that.
Well, if that's what you want, let's just invent
ASSERT condition
there was this proposal .. ASSERT statement .. related discuss was finished, because it needs a reserved keyword "ASSERT".
this discuss is too long. I shouldn't remember all details well. Proposal of plpgsql statement ASSERT was there, but there was not a agreement of syntax (as statement X as function call) and one objective disadvantage was request of new keyword. So I throw this idea as unacceptable. I have no objections against a statement ASSERT still - but there was not a strong agreement, so my next proposal (and some common agreement was on RAISE WHEN).