Re: plpgsql raise - parameters can be expressions - Mailing list pgsql-patches

From Tom Lane
Subject Re: plpgsql raise - parameters can be expressions
Date
Msg-id 2346.1118843856@sss.pgh.pa.us
Whole thread Raw
In response to Re: plpgsql raise - parameters can be expressions  (Neil Conway <neilc@samurai.com>)
List 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 by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pg_autovacuum patch to display db name in log file is broken
Next
From: Bruce Momjian
Date:
Subject: Lexer patch question