Re: proposal: plpgsql - Assert statement

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Petr Jelinek <petr(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: plpgsql - Assert statement
Date: 2014-11-18 21:30:06
Message-ID: CAFj8pRD4OHSSZ76k97G57Zk9uParmr3W6f=kqjxoOBZ-ScsieA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2014-11-18 22:28 GMT+01:00 Andrew Dunstan <andrew(at)dunslane(dot)net>:

>
> On 11/18/2014 04:11 PM, Pavel Stehule wrote:
>
>>
>>
>> 2014-11-18 21:27 GMT+01:00 Andrew Dunstan <andrew(at)dunslane(dot)net <mailto:
>> andrew(at)dunslane(dot)net>>:
>>
>>
>>
>> On 11/18/2014 02:53 PM, Jim Nasby wrote:
>>
>> On 11/18/14, 9:31 AM, Andrew Dunstan wrote:
>>
>>
>> Frankly, I find this whole proposal, and all the suggested
>> alternatives, somewhat ill-conceived. PLPGSQL is a wordy
>> language. If you want something more terse, use something
>> else. Adding these sorts of syntactic sugar warts onto the
>> language doesn't seem like a terribly good way to proceed.
>>
>>
>> Such as?
>>
>> The enormous advantage of plpgsql is how easy it is to run
>> SQL. Every other PL I've looked at makes that WAY harder. And
>> that's assuming you're in an environment where you can install
>> another PL.
>>
>> And honestly, I've never really found plpgsql to be terribly
>> wordy except in a few cases ("assert" being one of them). My
>> general experience has been that when I'm doing an IF (other
>> than assert), I'm doing multiple things in the IF block, so
>> it's really not that big a deal.
>>
>>
>>
>> I frequently write one-statement bodies of IF statements. To me
>> that's not a big deal either :-)
>>
>>
>> anybody did it, but it doesn't need so it is perfect :) I understand well
>> to Jim' feeling.
>>
>> I am looking to Ada 2005 language ... a design of RAISE WITH shows so
>> RAISE statement is extensible in Ada too. Sure - we can live without it,
>> but I don't think so we do some wrong with introduction RAISE WHEN and I am
>> sure, so a live with this feature can be more fun for someone, who
>> intensive use this pattern.
>>
>>
>>
>
> (drags out recently purchased copy of Barnes "Ada 2012")
>
> Ada's
>
> RAISE exception_name WITH "string";
>
> is more or less the equivalent of our
>
> RAISE level 'format_string';
>
> So I don't think there's much analogy there.
>
>
I used it as analogy of immutability of this statement in Ada,

>
> I'm not going to die in a ditch over this, but it does seem to me very
> largely unnecessary.
>
> cheers
>
> andrew
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-11-18 21:42:49 Use of recent Russian TZ changes in regression tests
Previous Message Andrew Dunstan 2014-11-18 21:28:17 Re: proposal: plpgsql - Assert statement