Re: plpgsql raise - parameters can (ToDo) - Mailing list pgsql-patches

From Pavel Stehule
Subject Re: plpgsql raise - parameters can (ToDo)
Date
Msg-id Pine.LNX.4.44.0506131848170.18739-100000@kix.fsv.cvut.cz
Whole thread Raw
In response to Re: plpgsql raise - parameters can be expressions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: plpgsql raise - parameters can (ToDo)  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpgsql raise - parameters can be expressions
Next
From: Tom Lane
Date:
Subject: Re: plpgsql raise - parameters can (ToDo)