Re: proposal: plpgsql - Assert statement - Mailing list pgsql-hackers

From Petr Jelinek
Subject Re: proposal: plpgsql - Assert statement
Date
Msg-id 543D8E39.40404@2ndquadrant.com
Whole thread Raw
In response to Re: proposal: plpgsql - Assert statement  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: proposal: plpgsql - Assert statement
List pgsql-hackers
On 09/09/14 17:37, Pavel Stehule wrote:
> 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 ];
>

Short review of the patch. Note that this has nothing to do with actual 
assertions, at the moment it's just enhancement of RAISE statement to 
make it optionally conditional. As I was one of the people who voted for 
it I do think we want this and I like the syntax.

Code applies cleanly, seems formatted according to project standards - 
there is unnecessary whitespace added in variable declaration part of 
exec_stmt_raise which should be removed.

Passes make check, I would prefer to have little more complex expression 
than just "true" in the new regression test added for this feature.

Did some manual testing, seems to work as advertised.

There are no docs at the moment which is the only show-stopper that I 
can see so far.

--  Petr Jelinek                  http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: pg_background (and more parallelism infrastructure patches)
Next
From: Alvaro Herrera
Date:
Subject: Re: narwhal and PGDLLIMPORT