2010-09-20 22:08:53 +02:00
|
|
|
<!-- doc/src/sgml/errcodes.sgml -->
|
2003-10-17 20:57:01 +02:00
|
|
|
|
|
|
|
<appendix id="errcodes-appendix">
|
|
|
|
<title><productname>PostgreSQL</productname> Error Codes</title>
|
|
|
|
|
|
|
|
<indexterm zone="errcodes-appendix">
|
|
|
|
<primary>error codes</primary>
|
|
|
|
<secondary>list of</secondary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
2004-05-14 20:04:02 +02:00
|
|
|
All messages emitted by the <productname>PostgreSQL</productname>
|
|
|
|
server are assigned five-character error codes that follow the SQL
|
|
|
|
standard's conventions for <quote>SQLSTATE</> codes. Applications
|
|
|
|
that need to know which error condition has occurred should usually
|
|
|
|
test the error code, rather than looking at the textual error
|
|
|
|
message. The error codes are less likely to change across
|
|
|
|
<productname>PostgreSQL</> releases, and also are not subject to
|
|
|
|
change due to localization of error messages. Note that some, but
|
|
|
|
not all, of the error codes produced by <productname>PostgreSQL</>
|
|
|
|
are defined by the SQL standard; some additional error codes for
|
|
|
|
conditions not defined by the standard have been invented or
|
|
|
|
borrowed from other databases.
|
2003-10-17 20:57:01 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
According to the standard, the first two characters of an error code
|
|
|
|
denote a class of errors, while the last three characters indicate
|
|
|
|
a specific condition within that class. Thus, an application that
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
does not recognize the specific error code can still be able to infer
|
2003-10-17 20:57:01 +02:00
|
|
|
what to do from the error class.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<xref linkend="errcodes-table"> lists all the error codes defined in
|
|
|
|
<productname>PostgreSQL</productname> &version;. (Some are not actually
|
|
|
|
used at present, but are defined by the SQL standard.)
|
|
|
|
The error classes are also shown. For each error class there is a
|
|
|
|
<quote>standard</> error code having the last three characters
|
|
|
|
<literal>000</>. This code is used only for error conditions that fall
|
|
|
|
within the class but do not have any more-specific code assigned.
|
|
|
|
</para>
|
|
|
|
|
2004-08-01 01:04:58 +02:00
|
|
|
<para>
|
2011-05-27 23:25:33 +02:00
|
|
|
The symbol shown in the column <quote>Condition Name</quote> is also
|
|
|
|
the condition name to use in <application>PL/pgSQL</>. Condition
|
|
|
|
names can be written in either upper or lower case. (Note that
|
2005-01-06 02:49:24 +01:00
|
|
|
<application>PL/pgSQL</> does not recognize warning, as opposed to error,
|
|
|
|
condition names; those are classes 00, 01, and 02.)
|
2004-08-01 01:04:58 +02:00
|
|
|
</para>
|
|
|
|
|
2003-10-17 20:57:01 +02:00
|
|
|
|
|
|
|
<table id="errcodes-table">
|
|
|
|
<title><productname>PostgreSQL</productname> Error Codes</title>
|
|
|
|
|
2011-05-27 23:25:33 +02:00
|
|
|
<tgroup cols="2">
|
2005-12-08 22:01:52 +01:00
|
|
|
<colspec colnum="1" colname="errorcode">
|
2011-05-27 23:25:33 +02:00
|
|
|
<colspec colnum="2" colname="condname">
|
|
|
|
<spanspec namest="errorcode" nameend="condname" spanname="span12">
|
2005-12-08 22:01:52 +01:00
|
|
|
|
2003-10-17 20:57:01 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Error Code</entry>
|
2008-05-16 00:39:49 +02:00
|
|
|
<entry>Condition Name</entry>
|
2003-10-17 20:57:01 +02:00
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
|
2011-02-04 04:32:49 +01:00
|
|
|
&errcodes-table;
|
2003-10-17 20:57:01 +02:00
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
</appendix>
|