Andreas Seltenreich wrote:
> Markus Schiltknecht writes:
>> Matthias.Pitzl@izb.de wrote:
> --8<---------------cut here---------------start------------->8---
> create function error(text) returns void as $$
> begin
> raise exception '%', $1;
> end
> $$ language plpgsql;
> --8<---------------cut here---------------end--------------->8---
>
> However,
>
> ,----[ (info "(postgres)Errors and Messages") ]
> | `RAISE EXCEPTION' presently always generates the same SQLSTATE code,
> | `P0001', no matter what message it is invoked with.
> `----
That could be fixed by adding an error code to your function and putting
that in a recognizable place in your exception text. Not pretty, but it
should do the job.
--
Alban Hertroys
alban@magproductions.nl
magproductions b.v.
T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
7500 AK Enschede
// Integrate Your World //