Re: Assertions in PL/PgSQL

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Marko Tiikkaja <marko(at)joh(dot)to>, Jaime Casanova <jaime(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Amit Khandekar <amit(dot)khandekar(at)enterprisedb(dot)com>
Subject: Re: Assertions in PL/PgSQL
Date: 2013-09-23 09:10:28
Message-ID: CAFj8pRDQsYE7cpdon=+uTZ=VSOkbOLFdnbmkR80ohMHT4Xfdbw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2013/9/23 Andres Freund <andres(at)2ndquadrant(dot)com>

> On 2013-09-23 11:00:50 +0200, Marko Tiikkaja wrote:
> > On 9/23/13 10:50 AM, I wrote:
> > >On 9/23/13 6:40 AM, Pavel Stehule wrote:
> > >>After days I am thinking so it can be a good solution
> > >>
> > >>syntax - enhanced current RAISE
> > >>
> > >>RAISE ASSERT WHEN boolean expression
> > >>
> > >>RAISE ASSERT 'some message' WHEN expression
> > >
> > >It looks like I'm losing this battle, but this syntax isn't too bad.
> > >
> > >>and we can have a GUC that controls asserts per database - possibly
> > >>overwritten by plpgsql option - similar to current plpgsql options
> > >>
> > >>assert_level = [*ignore*, notice, warning, error]
> > >
> > >This sounds like a decent enhancement.
> >
> > Oh, it would be nice to have the option here to say "assertions can't be
> > caught by exception handlers", but I don't know how that mechanism works
> so
> > I'm not sure it's possible. I'll have to look into that.
>
> RAISE ASSERT ... assert_level = PANIC :P.
>

:) maybe some little bit less than PANIC

Pavel

>
> Greetings,
>
> Andres Freund
>
> --
> Andres Freund http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2013-09-23 09:12:37 Re: Assertions in PL/PgSQL
Previous Message Pavel Stehule 2013-09-23 09:07:46 Re: Assertions in PL/PgSQL