Re: About how to use "exception when ??? then " - Mailing list pgsql-sql

From Emi Lu
Subject Re: About how to use "exception when ??? then "
Date
Msg-id 4419C035.7000008@encs.concordia.ca
Whole thread Raw
In response to Re: About how to use "exception when ??? then "  (Richard Huxton <dev@archonet.com>)
Responses Re: About how to use "exception when ??? then "
List pgsql-sql
> <snip> From the page:
> "The PL/pgSQL condition name for each error code is the same as the 
> phrase shown in the table, with underscores substituted for spaces. 
> For example, code 22012, DIVISION BY ZERO, has condition name 
> DIVISION_BY_ZERO. Condition names can be written in either upper or 
> lower case.


> (Note that PL/pgSQL does not recognize warning, as opposed to error, 
> condition names; those are classes 00, 01, and 02.)"


That means pl/pgsql will not recognize error codes under classes 00, 01, 
02.

Is there a way, I can output error code?
exception when ... then when others then  raise notice '%, %', SQLSTATE, SQLERRM;

But it seems that SQLERRM and SQLSTATE did not work for me. By the way, 
I am using postgresql 8.0.1.

Thanks a lot,
Ying

> <snip>




pgsql-sql by date:

Previous
From: Emi Lu
Date:
Subject: Re: About how to use "exception when ??? then "
Next
From: Emi Lu
Date:
Subject: Re: About how to use "exception when ??? then "