Re: User's exception plpgsql

From: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <neilc(at)samurai(dot)com>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: User's exception plpgsql
Date: 2005-07-06 17:12:54
Message-ID: Pine.LNX.4.44.0507061855560.23774-100000@kix.fsv.cvut.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> and maybe the short-term cheesy thing to do is special-case exactly this
> syntax:
>
> RAISE LEVEL [ SQLSTATE(text_expr), ] text_expr [, ... ]
>
> which would give us the minimum functionality with a clear path to
> expansion later.
>
or only RAISE LEVEL SQLSTATE(text_expr)|text_expr [, ...]

if I use registered sqlstate, plpgsql knows text message. But I think this
syntax has more questions than exception's variables. It's really problem
declare one exceptio's variable? It's similar like using constant
variables or magic values.

Pavel

DECLARE not_money EXCEPTION=SQLSTATE('U1101');
BEGIN
IF account < 0 THEN
RAISE EXCEPTION not_money;
...

or

BEGIN
IF account < 0 THEN
RAISE SQLSTATE ('U1101') 'Not money';

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-07-06 17:17:19 Re: User's exception plpgsql
Previous Message Tom Lane 2005-07-06 17:09:39 Re: User's exception plpgsql

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-07-06 17:17:19 Re: User's exception plpgsql
Previous Message Tom Lane 2005-07-06 17:09:39 Re: User's exception plpgsql