Andreas Seltenreich wrote:
Markus Schiltknecht writes:
[EMAIL PROTECTED] 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
[EMAIL PROTECTED]

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 //

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to