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

From Emi Lu
Subject About how to use "exception when ??? then "
Date
Msg-id 4419AB1A.3070805@encs.concordia.ca
Whole thread Raw
Responses Re: About how to use "exception when ??? then "
List pgsql-sql
Hello,

I am using PostgreSQL 8.0.1.

In a function, I try to use exception to catch sql errors:

begin
....   begin      exception         WHEN  ???   THEN   end;
...
end;

The place where I have ???, what I should put there please?

e.g.,
1. WHEN sqlcode = '02000' THEN
2. WHEN no_data then
3.  other ways?
From the 8.0 docs, I am not be able to find Constant values of all 
error codes.
http://www.postgresql.org/docs/8.0/static/errcodes-appendix.html

Please enlighten me.


Thanks,
Ying


pgsql-sql by date:

Previous
From: Bryce Nesbitt
Date:
Subject: Re: group by function, make SQL cleaner?
Next
From: alex-lists-pgsql@yuriev.com
Date:
Subject: executing external command