Re: User's exception plpgsql

From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>, pgsql-patches(at)postgresql(dot)org
Subject: Re: User's exception plpgsql
Date: 2005-07-07 01:00:36
Message-ID: 42CC7EB4.5090201@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2005-07-07 01:23:26 Re: [HACKERS] By Passed Domain Constraints
Previous Message Oliver Jowett 2005-07-07 00:48:57 Re: Checkpoint cost, looks like it is WAL/CRC

Browse pgsql-patches by date

  From Date Subject
Next Message Gavin Sherry 2005-07-07 01:30:05 Patch to remove deadcode from dbcommands.c
Previous Message Alvaro Herrera 2005-07-06 23:43:02 Re: Autovacuum integration