Re: Map connection().status() to name? - Mailing list psycopg

From Daniele Varrazzo
Subject Re: Map connection().status() to name?
Date
Msg-id CA+mi_8aAj9Af-UBLwuqnueX4xkx3KsSiLzDUvbw9Es_LHLDoBw@mail.gmail.com
Whole thread Raw
In response to Re: Map connection().status() to name?  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: Map connection().status() to name?  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List psycopg
On Fri, Nov 18, 2016 at 8:47 PM, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
> On 11/11/16 2:14 PM, Jim Nasby wrote:
>>
>> I realize that there are constants in psycopg2.extensions for available
>> connection statuses and what-not, but is there any included way to map a
>> returned status to a descriptive string? When I'm trying to debug
>> something a status of '2' doesn't really tell me anything useful. :(
>
>
> Would a patch implementing such a map be accepted?

I don't see why not. What constant do you want to reverse? The groups
in `extensions` are status, isolation level, transaction status. Would
you provide 3 different functions to reverse them?

-- Daniele


psycopg by date:

Previous
From: Jim Nasby
Date:
Subject: Re: Map connection().status() to name?
Next
From: Jim Nasby
Date:
Subject: Re: Map connection().status() to name?