Re: proposal: plpgsql - Assert statement

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(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 15:31:26
Message-ID: 546B664E.90504@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 11/18/2014 04:23 AM, Simon Riggs wrote:
> On 18 November 2014 01:00, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> wrote:
>> On 11/17/14, 4:58 PM, Simon Riggs wrote:
>>>>> Great, looks good to me, marking as ready for committer.
>>>
>>> What is wrong with using IF ?
>>
>> It's a hell of a lot wordier. I've previously created a more sophisticated
>> "assert" framework to allow more control over things, but ended up also
>> using it just for simple sanity checking because it was much nicer than
>> typeing IF THEN RAISE ERROR END IF.
> Why is that not a requirement for a less wordier form of IF?
>
> IF (something) THEN action
>
> Why is this problem specific to RAISE?
>
>

Please, no. The use of closed form rather than open form IF statements
is one of the things Ada (and by inheritance PLPGSQL) got right.

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.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2014-11-18 15:43:57 Re: double counting of lines in psql
Previous Message Heikki Linnakangas 2014-11-18 15:31:20 BRIN and PageIndexDeleteNoCompact