Skip to content

Commit

Permalink
Add PGSQL_ERRORS_SQLSTATE constant (#3510)
Browse files Browse the repository at this point in the history
  • Loading branch information
haszi authored Jun 30, 2024
1 parent 3535c39 commit 63916fd
Showing 1 changed file with 47 additions and 31 deletions.
78 changes: 47 additions & 31 deletions reference/pgsql/constants.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<appendix xml:id="pgsql.constants" xmlns="http://docbook.org/ns/docbook">
&reftitle.constants;
&extension.constants;

<variablelist>
<varlistentry xml:id="constant.pgsql-libpq-version">
<term>
Expand Down Expand Up @@ -211,7 +211,7 @@
<listitem>
<simpara>
Passed to <function>pg_lo_seek</function>. Seek operation is to begin
from the end of the object.
from the end of the object.
</simpara>
</listitem>
</varlistentry>
Expand All @@ -234,7 +234,7 @@
</term>
<listitem>
<simpara>
Returned by <function>pg_result_status</function>. Successful completion of a
Returned by <function>pg_result_status</function>. Successful completion of a
command returning no data.
</simpara>
</listitem>
Expand All @@ -246,7 +246,7 @@
</term>
<listitem>
<simpara>
Returned by <function>pg_result_status</function>. Successful completion of a command
Returned by <function>pg_result_status</function>. Successful completion of a command
returning data (such as a <literal>SELECT</literal> or <literal>SHOW</literal>).
</simpara>
</listitem>
Expand All @@ -258,7 +258,7 @@
</term>
<listitem>
<simpara>
Returned by <function>pg_result_status</function>. Copy Out (from server) data
Returned by <function>pg_result_status</function>. Copy Out (from server) data
transfer started.
</simpara>
</listitem>
Expand All @@ -270,7 +270,7 @@
</term>
<listitem>
<simpara>
Returned by <function>pg_result_status</function>. Copy In (to server) data
Returned by <function>pg_result_status</function>. Copy In (to server) data
transfer started.
</simpara>
</listitem>
Expand All @@ -282,7 +282,7 @@
</term>
<listitem>
<simpara>
Returned by <function>pg_result_status</function>. The server's response
Returned by <function>pg_result_status</function>. The server's response
was not understood.
</simpara>
</listitem>
Expand All @@ -294,7 +294,7 @@
</term>
<listitem>
<simpara>
Returned by <function>pg_result_status</function>. A nonfatal error
Returned by <function>pg_result_status</function>. A nonfatal error
(a notice or warning) occurred.
</simpara>
</listitem>
Expand All @@ -306,7 +306,7 @@
</term>
<listitem>
<simpara>
Returned by <function>pg_result_status</function>. A fatal error
Returned by <function>pg_result_status</function>. A fatal error
occurred.
</simpara>
</listitem>
Expand Down Expand Up @@ -380,10 +380,10 @@
<listitem>
<simpara>
Passed to <function>pg_result_error_field</function>.
The severity; the field contents are <literal>ERROR</literal>,
<literal>FATAL</literal>, or <literal>PANIC</literal> (in an error message), or
<literal>WARNING</literal>, <literal>NOTICE</literal>, <literal>DEBUG</literal>,
<literal>INFO</literal>, or <literal>LOG</literal> (in a notice message), or a localized
The severity; the field contents are <literal>ERROR</literal>,
<literal>FATAL</literal>, or <literal>PANIC</literal> (in an error message), or
<literal>WARNING</literal>, <literal>NOTICE</literal>, <literal>DEBUG</literal>,
<literal>INFO</literal>, or <literal>LOG</literal> (in a notice message), or a localized
translation of one of these. Always present.
</simpara>
</listitem>
Expand All @@ -396,9 +396,9 @@
<listitem>
<simpara>
Passed to <function>pg_result_error_field</function>.
The SQLSTATE code for the error. The SQLSTATE code identifies the type of error
that has occurred; it can be used by front-end applications to perform specific
operations (such as error handling) in response to a particular database error.
The SQLSTATE code for the error. The SQLSTATE code identifies the type of error
that has occurred; it can be used by front-end applications to perform specific
operations (such as error handling) in response to a particular database error.
This field is not localizable, and is always present.
</simpara>
</listitem>
Expand Down Expand Up @@ -448,7 +448,7 @@
<listitem>
<simpara>
Passed to <function>pg_result_error_field</function>.
A string containing a decimal integer indicating an error cursor position as an index into the original
A string containing a decimal integer indicating an error cursor position as an index into the original
statement string. The first character has index 1, and positions are measured in characters not bytes.
</simpara>
</listitem>
Expand All @@ -461,10 +461,10 @@
<listitem>
<simpara>
Passed to <function>pg_result_error_field</function>.
This is defined the same as the <constant>PG_DIAG_STATEMENT_POSITION</constant> field, but
it is used when the cursor position refers to an internally generated
command rather than the one submitted by the client. The
<constant>PG_DIAG_INTERNAL_QUERY</constant> field will always appear when this
This is defined the same as the <constant>PG_DIAG_STATEMENT_POSITION</constant> field, but
it is used when the cursor position refers to an internally generated
command rather than the one submitted by the client. The
<constant>PG_DIAG_INTERNAL_QUERY</constant> field will always appear when this
field appears.
</simpara>
</listitem>
Expand All @@ -477,7 +477,7 @@
<listitem>
<simpara>
Passed to <function>pg_result_error_field</function>.
The text of a failed internally-generated command. This could be, for example, a
The text of a failed internally-generated command. This could be, for example, a
SQL query issued by a PL/pgSQL function.
</simpara>
</listitem>
Expand All @@ -490,9 +490,9 @@
<listitem>
<simpara>
Passed to <function>pg_result_error_field</function>.
An indication of the context in which the error occurred. Presently
this includes a call stack traceback of active procedural language
functions and internally-generated queries. The trace is one entry
An indication of the context in which the error occurred. Presently
this includes a call stack traceback of active procedural language
functions and internally-generated queries. The trace is one entry
per line, most recent first.
</simpara>
</listitem>
Expand All @@ -505,7 +505,7 @@
<listitem>
<simpara>
Passed to <function>pg_result_error_field</function>.
The file name of the PostgreSQL source-code location where the error
The file name of the PostgreSQL source-code location where the error
was reported.
</simpara>
</listitem>
Expand All @@ -518,7 +518,7 @@
<listitem>
<simpara>
Passed to <function>pg_result_error_field</function>.
The line number of the PostgreSQL source-code location where the
The line number of the PostgreSQL source-code location where the
error was reported.
</simpara>
</listitem>
Expand Down Expand Up @@ -599,7 +599,7 @@
<listitem>
<simpara>
Passed to <function>pg_set_error_verbosity</function>.
Specified that returned messages include severity, primary text,
Specified that returned messages include severity, primary text,
and position only; this will normally fit on a single line.
</simpara>
</listitem>
Expand All @@ -612,8 +612,8 @@
<listitem>
<simpara>
Passed to <function>pg_set_error_verbosity</function>.
The default mode produces messages that include the above
plus any detail, hint, or context fields (these may span
The default mode produces messages that include the above
plus any detail, hint, or context fields (these may span
multiple lines).
</simpara>
</listitem>
Expand All @@ -630,6 +630,22 @@
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.pgsql-errors-sqlstate">
<term>
<constant>PGSQL_ERRORS_SQLSTATE</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Passed to <function>pg_set_error_verbosity</function>.
Includes only the error severity and the <literal>SQLSTATE</literal> error code.
If no error code is available, the output is like
<constant>PGSQL_ERRORS_TERSE</constant> mode.
Before PostgreSQL 11.1, the output is always the same
as in <constant>PGSQL_ERRORS_TERSE</constant> mode.
</simpara>
</listitem>
</varlistentry>

<varlistentry xml:id="constant.pgsql-notice-last">
<term>
Expand Down Expand Up @@ -869,7 +885,7 @@
The severity; the field contents are ERROR, FATAL, or PANIC (in an error message), or WARNING, NOTICE, DEBUG, INFO, or LOG (in a notice message). This is identical to the PG_DIAG_SEVERITY field except that the contents are never localized. This is present only in versions 9.6 and later / PHP 7.3.0 and later.
</simpara>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry xml:id="constant.pgsql-show-context-never">
<term>
<constant>PGSQL_SHOW_CONTEXT_NEVER</constant>
Expand Down

0 comments on commit 63916fd

Please sign in to comment.