Re: proposal: plpgsql - Assert statement

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: plpgsql - Assert statement
Date: 2014-09-09 15:37:43
Message-ID: CAFj8pRDPXR0+hz0qsYUMci0qNSADMDKayB70nHgY=CK3PfNy5Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2014-09-09 7:55 GMT+02:00 Craig Ringer <craig(at)2ndquadrant(dot)com>:

> On 09/09/2014 05:20 AM, Robert Haas wrote:
> >
> > I previously proposed RAISE ASSERT ... WHERE, which seems like a nice
> > variant of what we've already got, but perhaps this whole discussion
> > merely illustrates that it's hard to get more than 1 vote for any
> > proposal in this area.
>
> Well, you have Petr's for RAISE EXCEPTION ... WHEN, and I'd also like
> that or RAISE ASSERT ... WHEN.
>

Ada is language with strong character, and PLpgSQL is little bit strange
fork - so it isn't easy to find some form, how to solve all requirements.

My requests:

* be consistent with current PLpgSQL syntax and logic
* allow some future extensibility
* allow a static analyses without hard expression processing

But I am thinking so there are some points where can be some agreement -
although it is not ASSERT implementation.

enhancing RAISE WHEN - please, see attached patch -

I prefer RAISE WHEN again RAISE WHERE due consistency with EXIT and
CONTINUE [ WHEN ];

Next we can reserve some SQLCODE for assertation and we can implement it as
not handled exception. It is only "cancel" now, and it is not usable .
Probably it should be implement on SQL level - not on plpgsql only.

Regards

Pavel

>
> Much (much) saner than the other proposals on this thread IMO.
>
> --
> Craig Ringer http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>

Attachment Content-Type Size
raise-when-01.patch text/x-patch 9.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2014-09-09 15:39:53 Re: [PATCH] empty xml values
Previous Message Robert Haas 2014-09-09 15:25:07 Re: WIP Patch for GROUPING SETS phase 1