# Connection status
CONNECTION_OK = 0
CONNECTION_BAD = 1
CONNECTION_STARTED = 2
CONNECTION_MADE = 3
CONNECTION_AWAITING_RESPONSE = 4
CONNECTION_AUTH_OK = 5
CONNECTION_SETENV = 6
CONNECTION_SSL_STARTUP = 7
CONNECTION_NEEDED = 8

CONNECTION_STATUSES = {
    CONNECTION_OK: 'ok',
    CONNECTION_BAD: 'bad',
    CONNECTION_STARTED: 'started',
    CONNECTION_MADE: 'made',
    CONNECTION_AWAITING_RESPONSE: 'waiting',
    CONNECTION_AUTH_OK: 'auth_ok',
    CONNECTION_SETENV: 'setenv',
    CONNECTION_SSL_STARTUP: 'ssl_startup',
    CONNECTION_NEEDED: 'needed',
}

# Query status
PGRES_EMPTY_QUERY = 0
PGRES_COMMAND_OK = 1
PGRES_TUPLES_OK = 2
PGRES_COPY_OUT = 3
PGRES_COPY_IN = 4
PGRES_BAD_RESPONSE = 5
PGRES_NONFATAL_ERROR = 6
PGRES_FATAL_ERROR = 7
PGRES_COPY_BOTH = 8

# Transaction status
PQTRANS_IDLE = 0
PQTRANS_ACTIVE = 1
PQTRANS_INTRANS = 2
PQTRANS_INERROR = 3
PQTRANS_UNKNOWN = 4