From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Simon Riggs <simon(at)2ndquadrant(dot)com> |
Cc: | Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Petr Jelinek <petr(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: proposal: plpgsql - Assert statement |
Date: | 2014-11-18 12:29:02 |
Message-ID: | CAFj8pRD=VpK2Nm1bMhCLkFJc9V3gK+zw+S6TK7mM0-G9rohhgw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
2014-11-18 10:23 GMT+01:00 Simon Riggs <simon(at)2ndquadrant(dot)com>:
> On 18 November 2014 01:00, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> wrote:
> > On 11/17/14, 4:58 PM, Simon Riggs wrote:
> >>>>
> >>>> Great, looks good to me, marking as ready for committer.
> >>
> >>
> >> What is wrong with using IF ?
> >
> >
> > It's a hell of a lot wordier. I've previously created a more
> sophisticated
> > "assert" framework to allow more control over things, but ended up also
> > using it just for simple sanity checking because it was much nicer than
> > typeing IF THEN RAISE ERROR END IF.
>
> Why is that not a requirement for a less wordier form of IF?
>
> IF (something) THEN action
>
statement IF is a control statement - and syntax, pattern for control
statements in plpgsql is consistent. I don't want to break it (more,
probably it is hardly implemented due problems in bison). PL/pgSQL, PL/SQL,
Ada are well designed (in my opinion). Conditional statement has precedent
in PL/pgSQL now. We support EXIT and CONTINUE WHEN, so we don't propose a
new pattern, only reuse some existing.
Regards
Pavel
>
>
> Why is this problem specific to RAISE?
>
>
> --
> Simon Riggs http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Kapila | 2014-11-18 13:53:13 | Re: alternative model for handling locking in parallel groups |
Previous Message | Simon Riggs | 2014-11-18 12:09:04 | Re: [TODO] Track number of files ready to be archived in pg_stat_archiver |