Disconnection handling requires English locale

Bug #855299 reported by Stuart Bishop
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Storm
Confirmed
High
Unassigned

Bug Description

is_disconnection_error currently sniffs the error message for strings to determine if an exception is a disconnection error. This fails when running PostgreSQL with a non-English locale.

Instead, we should check for more explicit exceptions or check the pgcode attribute on the error (error codes are documented at http://www.postgresql.org/docs/8.1/static/errcodes-appendix.html)

Stuart Bishop (stub)
Changed in storm:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
James Henstridge (jamesh) wrote :

Note that there is no pgcode attribute for disconnection errors: you only get those for errors reported from the database. By their nature, disconnection errors are reported when the client can't communicate with the database.

[Or at least this was the case back when I was writing the disconnection logic]

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 855299] Re: Disconnection handling requires English locale

On Wed, Sep 21, 2011 at 9:10 PM, James Henstridge
<email address hidden> wrote:
> Note that there is no pgcode attribute for disconnection errors: you
> only get those for errors reported from the database.  By their nature,
> disconnection errors are reported when the client can't communicate with
> the database.

From the linked page:
08000 CONNECTION EXCEPTION connection_exception
08003 CONNECTION DOES NOT EXIST connection_does_not_exist
08006 CONNECTION FAILURE connection_failure
08001 SQLCLIENT UNABLE TO ESTABLISH
SQLCONNECTION sqlclient_unable_to_establish_sqlconnection

Seem relevant.

_Rob

Revision history for this message
Stuart Bishop (stub) wrote :

Confirming jamesh's assertion. I've just tested connecting to a non existent server and terminating an active connection, and in both cases pgcode is None.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.