diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-08-26 16:20:17 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-08-26 16:20:24 -0400 |
commit | e796d0abab0f9508326c0aa721fe1475548fbe4e (patch) | |
tree | 924aa2e2655629e8f9f32b602629c8dd8f8b2372 /doc/src | |
parent | bef2d627f30c0d854d02dc860b0d54fa3309d4ee (diff) |
Add a nonlocalized version of the severity field to client error messages.
This has been requested a few times, but the use-case for it was never
entirely clear. The reason for adding it now is that transmission of
error reports from parallel workers fails when NLS is active, because
pq_parse_errornotice() wrongly assumes that the existing severity field
is nonlocalized. There are other ways we could have fixed that, but the
other options were basically kluges, whereas this way provides something
that's at least arguably a useful feature along with the bug fix.
Per report from Jakob Egger. Back-patch into 9.6, because otherwise
parallel query is essentially unusable in non-English locales. The
problem exists in 9.5 as well, but we don't want to risk changing
on-the-wire behavior in 9.5 (even though the possibility of new error
fields is specifically called out in the protocol document). It may
be sufficient to leave the issue unfixed in 9.5, given the very limited
usefulness of pq_parse_errornotice in that version.
Discussion: <A88E0006-13CB-49C6-95CC-1A77D717213C@eggerapps.at>
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/libpq.sgml | 16 | ||||
-rw-r--r-- | doc/src/sgml/protocol.sgml | 19 |
2 files changed, 35 insertions, 0 deletions
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index f22e3da0475..2f9350b10e1 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -2767,6 +2767,22 @@ char *PQresultErrorField(const PGresult *res, int fieldcode); </listitem> </varlistentry> + <varlistentry id="libpq-pg-diag-severity-nonlocalized"> + <term><symbol>PG_DIAG_SEVERITY_NONLOCALIZED</></term> + <listitem> + <para> + The severity; the field contents are <literal>ERROR</>, + <literal>FATAL</>, or <literal>PANIC</> (in an error message), + or <literal>WARNING</>, <literal>NOTICE</>, <literal>DEBUG</>, + <literal>INFO</>, or <literal>LOG</> (in a notice message). + This is identical to the <symbol>PG_DIAG_SEVERITY</> field except + that the contents are never localized. This is present only in + reports generated by <productname>PostgreSQL</> versions 9.6 + and later. + </para> + </listitem> + </varlistentry> + <varlistentry id="libpq-pg-diag-sqlstate"> <term> <symbol>PG_DIAG_SQLSTATE</> diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index 9c96d8fc44d..68b09410299 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -4884,6 +4884,25 @@ message. <varlistentry> <term> +<literal>V</> +</term> +<listitem> +<para> + Severity: the field contents are + <literal>ERROR</>, <literal>FATAL</>, or + <literal>PANIC</> (in an error message), or + <literal>WARNING</>, <literal>NOTICE</>, <literal>DEBUG</>, + <literal>INFO</>, or <literal>LOG</> (in a notice message). + This is identical to the <literal>S</> field except + that the contents are never localized. This is present only in + messages generated by <productname>PostgreSQL</> versions 9.6 + and later. +</para> +</listitem> +</varlistentry> + +<varlistentry> +<term> <literal>C</> </term> <listitem> |