Re: plpgsql raise - parameters can be expressions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: plpgsql raise - parameters can be expressions
Дата
Msg-id 2346.1118843856@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: plpgsql raise - parameters can be expressions  (Neil Conway <neilc@samurai.com>)
Список pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> BTW, is there any value in a separate "EXCEPTION" type? ISTM that an
> exception is just a SQLSTATE, which is in turn just a string. A separate
> exception type does simplify the parsing of RAISE, but I wonder if it
> would be useful to be able to also allow specifying the SQLSTATE code as
> a string literal.

It would save some typing, but I do not think we can make the proposed
syntax work if we do it that way:

>> RAISE level [ exception_name , ] format_string [ , parameters ] ;
>>
>> where "level" is one of the already-defined level keywords?

How will you tell whether the string literal just after "level" is meant
to be a SQLSTATE or a format?  Maybe with some ad-hoc tests, but ugh ...

            regards, tom lane

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_autovacuum patch to display db name in log file is broken
Следующее
От: Bruce Momjian
Дата:
Сообщение: Lexer patch question