Re: proposal: plpgsql - Assert statement

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: Marko Tiikkaja <marko(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: plpgsql - Assert statement
Date: 2014-09-14 18:25:23
Message-ID: CAFj8pRB3bN94FPnuzBS_jOhmCpBVBXof9EK6AT=KXNz42F6WcQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

> On 09/05/2014 05:21 PM, Pavel Stehule wrote:
> >
> > *shrug* Doing it in SQL would probably break more stuff. I'm trying to
> > contain the damage. And arguably, this is mostly only useful in
> PL/PgSQL.
>
> I've wanted assertions in SQL enough that I often write trivial wrappers
> around `raise` in PL/PgSQL for use in `CASE` statements etc.
>

In this moment we have no agreement on syntax, but there was not defined a
requirements for aggregations. I looked on assertions in some languages and
implementation and design of assertions is really varied.

I though about it, and "Assertions" is not plpgsql only issue. It must be
supported by core, and by other PL.

There are two usual requests for Assertions:

a) Isn't possible handle a assertion exception anywhere .. it enforce
ROLLBACK in 100%

b) Assertions should be disabled globally .. I am not sure, it it is a good
idea, but I can understand so some tests based on queries to data can be
performance issue.

Important question is a relation assertations and exceptions. Is it only
shortcut for exception or some different?

Comments?

Regards

Pavel

>
> --
> Craig Ringer http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2014-09-14 18:49:32 Re: proposal: plpgsql - Assert statement
Previous Message Emre Hasegeli 2014-09-14 18:09:36 Re: KNN-GiST with recheck