Postgres Database Error Codes and Error Messages

Started by Abhishek Goyalover 22 years ago3 messagesgeneral
Jump to latest
#1Abhishek Goyal
abhishek.goyal@tatainfotech.com

Hi,

I am new to working on Postgres database and want to explore it fully.
Right now, I am interested in knowing all the predefined database error
codes with error messages for situations like "No Data Found" and "Too many
rows" during a query operation, "Duplicate key found" during an insert
operation, "Data Type Mismatch" during a conversion operation and many more
situations as identified and defined in an Oracle database.

I could not find a similar list of predefined error codes anywhere in
Postgres documentation.

Please revert back with the appropriate source of this information as soon
as possible.

Thanks,
Abhishek

#2Richard Huxton
dev@archonet.com
In reply to: Abhishek Goyal (#1)
Re: Postgres Database Error Codes and Error Messages

On Tuesday 22 July 2003 06:01, Abhishek Goyal wrote:

Hi,

I am new to working on Postgres database and want to explore it fully.
Right now, I am interested in knowing all the predefined database error
codes with error messages for situations like "No Data Found" and "Too many
rows" during a query operation, "Duplicate key found" during an insert
operation, "Data Type Mismatch" during a conversion operation and many more
situations as identified and defined in an Oracle database.

I could not find a similar list of predefined error codes anywhere in
Postgres documentation.

I don't believe there is one at present, but grep the source for elog() calls
to see all of them. Be aware that the error reporting is being overhauled for
7.4 so you might want to start your study with the CVS version - see the
archives of the hackers list for discussion.

--
Richard Huxton
Archonet Ltd

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Richard Huxton (#2)
Re: Postgres Database Error Codes and Error Messages

Richard Huxton <dev@archonet.com> writes:

I don't believe there is one at present, but grep the source for elog() calls
to see all of them. Be aware that the error reporting is being overhauled for
7.4 so you might want to start your study with the CVS version - see the
archives of the hackers list for discussion.

In particular see
http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/include/utils/elog.h
for the current list of SQLSTATE error codes.

This set is still changing --- if you have any comments, please make
them on pgsql-hackers.

regards, tom lane