Re: Assertions in PL/PgSQL

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Khandekar <amit(dot)khandekar(at)enterprisedb(dot)com>, Jaime Casanova <jaime(at)2ndquadrant(dot)com>, Marko Tiikkaja <marko(at)joh(dot)to>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assertions in PL/PgSQL
Date: 2013-11-18 05:24:27
Message-ID: CAFj8pRAYjt_TcWkFC2spbGJchbm0HO8Fo-caeDKsGxY36KOxxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2013/11/17 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>

> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> > [ rebased patch for RAISE WHEN ]
>
> I have to say I do not see the point of this. It does nothing you
> can't do already with "IF condition THEN RAISE ...". And frankly
> the RAISE statement has got too darn many options already. We don't
> need yet more cruft on it that we'll have to maintain forevermore.
>
> If this were improving standards compliance somehow, I'd be okay
> with it; but what other implementation has got this?
>

RAISE statement is not ANSI compliant ever, and it has only thin similarity
with Oracle' PL/SQL RAISE statement now - and it is significantly enhanced
in relation to original ADA

Usually I am not a happy, when PL/pgSQL going far from original ADA, but I
think so this use case is very practical current usual pattern is less
readable than conditional RAISE It is similar to CONTINUE and EXIST
statement. Actually we need a some functionality, that allows simply write
assertions (without custom source code uglyfication). RAISE WHEN is good
for this purpose.

Regards

Pavel

>
> regards, tom lane
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Haribabu kommi 2013-11-18 05:49:15 Re: New option for pg_basebackup, to specify a different directory for pg_xlog
Previous Message wangshuo 2013-11-18 05:22:33 Re: Parse more than bind and execute when connect to database by jdbc