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

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -