Re: Assertions in PL/PgSQL
От | Pavel Stehule |
---|---|
Тема | Re: Assertions in PL/PgSQL |
Дата | |
Msg-id | CAFj8pRAYjt_TcWkFC2spbGJchbm0HO8Fo-caeDKsGxY36KOxxw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Assertions in PL/PgSQL (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | 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 по дате отправления: