Re: proposal: plpgsql - Assert statement

From: Mike Blackwell <mike(dot)blackwell(at)rrd(dot)com>
To:
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: plpgsql - Assert statement
Date: 2014-11-19 15:42:53
Message-ID: CANPAkgur8XEfdCPtv7GZ30oktYELKOp3z34A5cQGeJJ3sZhxZg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
>
>> On 18 November 2014 21:19, Petr Jelinek <petr(at)2ndquadrant(dot)com> wrote:
>>
>> Personally, I see this as natural extension of the conditional block
>>> control
>>> which we already have for loops with CONTINUE WHEN and EXIT WHEN. This
>>> basically extends it to any block and it seems quite natural to have it
>>> for
>>> me...
>>>
>>
​This seems to me like a step in the direction of APL, where every
statement is a conditional.

Perl has the option of putting the conditional on the end of a statement as
suggested here for ASSERT. My experience has been that while it may "look
prettier" to some, the conditional is overlooked in reviews, etc., more
often than one would expect, giving a net loss in the overall
risk/productivity analysis.

As a code maintainer, I would be opposed to adding something like this for
no other reason than perceived aesthetics.

Your mileage may, of course, vary.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2014-11-19 15:47:05 Re: Add shutdown_at_recovery_target option to recovery.conf
Previous Message Alex Shulgin 2014-11-19 15:34:39 Re: [PATCH] add ssl_protocols configuration option