Re: proposal: plpgsql - Assert statement

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Marko Tiikkaja <marko(at)joh(dot)to>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Petr Jelinek <petr(at)2ndquadrant(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: plpgsql - Assert statement
Date: 2014-11-19 22:55:10
Message-ID: CAFj8pRBgMu3Ac1W8QOYKK98BiPXpHi+PyTgyFs_0FVwPz5=f4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2014-11-19 23:38 GMT+01:00 Marko Tiikkaja <marko(at)joh(dot)to>:

> On 2014-11-19 23:18, Pavel Stehule wrote:
>
>> 2014-11-19 18:01 GMT+01:00 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>>
>> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>>>
>>>> On Wed, Nov 19, 2014 at 11:13 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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".
>>
>
> Finished? Really?
>
> This was Heikki's take on the discussion that took place a good while ago:
> http://www.postgresql.org/message-id/5405FF73.1010206@vmware.com. And in
> the same thread you also said you like it: http://www.postgresql.org/
> message-id/CAFj8pRAC-ZWDrbU-uj=xQOWQtbAqR5oXsM1xYOyhZmyeuvZvQ
> A(at)mail(dot)gmail(dot)co(dot) But perhaps you've changed your mind since then (which
> is fine.) Or maybe that was only in the case where we'd have a special
> mode where you could opt-in if you're willing to accept the backwards
> compatibility issue?
>
> I also went back to the original thread, and I think Heikki's summary
> dismissed e.g. Robert's criticism quite lightly:
> http://www.postgresql.org/message-id/CA+TgmobWoSSRNcV_
> iJK3xhsytXb7Dv0AWGvWkMEurNTOVEZYyw(at)mail(dot)gmail(dot)com
>
>
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).

>
> .marko
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2014-11-19 23:02:38 Re: proposal: plpgsql - Assert statement
Previous Message Tom Lane 2014-11-19 22:54:55 Re: proposal: plpgsql - Assert statement