python - what do psycopg2's server connection status values mean? -


i trying output status of connection after open connection , after close it. getting output of 1 when open , 2 when close it, there no talk these values mean in psycopg2's documentation. know different status values mean?

i using status function connection status values.

those documented status constants , can find them here: http://initd.org/psycopg/docs/extensions.html#connection-status-constants

this not tell numeric representation/value of it, though. if print each constant, did, should this:

from psycopg2 import extensions ext  print(ext.status_ready) #1 print(ext.status_begin) #2 print(ext.status_in_transaction) #2  (this alias status_begin) print(ext.status_prepared) #5 

note documentation states: "the status undefined closed connectons (sic)." http://initd.org/psycopg/docs/connection.html#connection.status


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -