Re: plpgsql raise - parameters can (ToDo)

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: plpgsql raise - parameters can (ToDo)
Date: 2005-06-13 17:01:13
Message-ID: Pine.LNX.4.44.0506131848170.18739-100000@kix.fsv.cvut.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

> I would sort of have expected this to get done at the same time.
>
> Actually, the reason I didn't do something about RAISE in 8.0 was that
> I thought we should reconsider the whole design of the statement: it
> desperately needs to be fixed so that you can specify the SQLSTATE to
> be thrown, and so that you can re-throw the same exception you caught.
> (Note that SQLERRM is not really a solution to that: you might think
> something like "RAISE EXCEPTION SQLSTATE, '%', SQLERRM" would do,
> but it loses information, namely all the auxiliary fields.)

There is space for future version. I think for todo for plpgsql

o rethrow exception in exception handler block
o user defined exceptions
o mapping user's exception on system's exception

My previous mail isn't correct. I need somewhere specify errmsg text, and
ofcourse params.

???

declare myexcept exception = 'xxxxx';
begin;
assoc(myexcept, 'my message % % %');
raise myexcept, param1, param2, ...

default level of user exception is exception.

regards
Pavel Stehule

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-06-13 17:07:10 Re: plpgsql raise - parameters can (ToDo)
Previous Message Tom Lane 2005-06-13 16:56:45 Re: plpgsql raise - parameters can be expressions