Re: User's exception plpgsql - Mailing list pgsql-patches

From Neil Conway
Subject Re: User's exception plpgsql
Date
Msg-id 42CC7EB4.5090201@samurai.com
Whole thread Raw
In response to Re: User's exception plpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: User's exception plpgsql
List pgsql-patches
Tom Lane wrote:
>     RAISE NOTICE '12' !! '345', ...
>
> Is !! an infix operator (using both strings as arguments) or a postfix
> operator (in which case '345' is the format)?

Ah, I see. I would be content to allow opt_sqlstate to be either a
string literal, a T_WORD (predefined error condition), or a TEXT
variable. If users need to throw a sqlstate that is derived from a SQL
expression, they can always assign to a TEXT variable and then specify
that variable to RAISE.

>>     RAISE [ opt_sqlstate ] LEVEL 'fmt' [ , expr ... ]

This syntax might be slightly better anyway, as allowing two string
literals without any intervening tokens is a bit ugly. We would still
need to restrict opt_sqlstate as described above, though.

-Neil

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Autovacuum integration
Next
From: Gavin Sherry
Date:
Subject: Patch to remove deadcode from dbcommands.c