Re: proposal: plpgsql - Assert statement

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Marko Tiikkaja <marko(at)joh(dot)to>
Cc: Jan Wieck <jan(at)wi3ck(dot)info>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: plpgsql - Assert statement
Date: 2014-09-06 17:49:39
Message-ID: CAFj8pRA-omKUBf=vRNhXW+4q+3Vf961yWu6ntEdNmgg57eU1hw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2014-09-06 19:26 GMT+02:00 Marko Tiikkaja <marko(at)joh(dot)to>:

> On 2014-09-06 7:27 AM, Pavel Stehule wrote:
>
>> 2014-09-05 14:35 GMT+02:00 Jan Wieck <jan(at)wi3ck(dot)info>:
>>
>>> Adding a WHEN clause to RAISE would have the benefit of not needing any
>>> new keywords at all.
>>>
>>> RAISE EXCEPTION 'format' [, expr ...] WHEN row_count <> 1;
>>>
>>>
>> It was one my older proposal.
>>
>> Can we find a agreement there?
>>
>
> I find:
>
> 1) The syntax less readable than IF row_count <> 1 THEN RAISE EXCEPTION
> ..; END IF;
> 2) It needless to require the user to specify an error message for every
> assertion.
> 3) Allowing these to be disabled would be weird (though I might be the
> only one who wants that feature at this point).
> 4) It would also be weird to display the parameters passed to the WHEN
> clause like I suggested here: http://www.postgresql.org/
> message-id/54096BA4(dot)5030600(at)joh(dot)to . I think that's a crucial part of
> the feature.
>
> So at least the vote isn't unanimous: -1 from me.
>

this doesn't to supply assertions, it is just shorter form

Pavel

>
>
> .marko
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2014-09-06 17:50:47 Re: plpgsql defensive mode
Previous Message Marko Tiikkaja 2014-09-06 17:41:11 Re: PL/pgSQL 1.2