Re: Assertions in PL/PgSQL - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Assertions in PL/PgSQL
Date
Msg-id CAFj8pRAYjt_TcWkFC2spbGJchbm0HO8Fo-caeDKsGxY36KOxxw@mail.gmail.com
Whole thread Raw
In response to Re: Assertions in PL/PgSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers



2013/11/17 Tom Lane <tgl@sss.pgh.pa.us>
Pavel Stehule <pavel.stehule@gmail.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

pgsql-hackers by date:

Previous
From: wangshuo@highgo.com.cn
Date:
Subject: Re: Parse more than bind and execute when connect to database by jdbc
Next
From: Haribabu kommi
Date:
Subject: Re: New option for pg_basebackup, to specify a different directory for pg_xlog