summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/_json.py2
-rw-r--r--lib/_range.py4
-rw-r--r--lib/extras.py6
-rw-r--r--lib/pool.py2
4 files changed, 7 insertions, 7 deletions
diff --git a/lib/_json.py b/lib/_json.py
index 71c2b76..0438c25 100644
--- a/lib/_json.py
+++ b/lib/_json.py
@@ -185,7 +185,7 @@ def _get_json_oids(conn_or_curs, name='json'):
conn_status = conn.status
# column typarray not available before PG 8.3
- typarray = conn.server_version >= 80300 and "typarray" or "NULL"
+ typarray = conn.info.server_version >= 80300 and "typarray" or "NULL"
# get the oid for the hstore
curs.execute(
diff --git a/lib/_range.py b/lib/_range.py
index e72c878..1747b20 100644
--- a/lib/_range.py
+++ b/lib/_range.py
@@ -352,9 +352,9 @@ class RangeCaster(object):
from psycopg2.extras import _solve_conn_curs
conn, curs = _solve_conn_curs(conn_or_curs)
- if conn.server_version < 90200:
+ if conn.info.server_version < 90200:
raise ProgrammingError("range types not available in version %s"
- % conn.server_version)
+ % conn.info.server_version)
# Store the transaction status of the connection to revert it after use
conn_status = conn.status
diff --git a/lib/extras.py b/lib/extras.py
index af59d2f..4dea3f9 100644
--- a/lib/extras.py
+++ b/lib/extras.py
@@ -806,7 +806,7 @@ class HstoreAdapter(object):
self.conn = conn
# use an old-style getquoted implementation if required
- if conn.server_version < 90000:
+ if conn.info.server_version < 90000:
self.getquoted = self._getquoted_8
def _getquoted_8(self):
@@ -911,7 +911,7 @@ class HstoreAdapter(object):
conn_status = conn.status
# column typarray not available before PG 8.3
- typarray = conn.server_version >= 80300 and "typarray" or "NULL"
+ typarray = conn.info.server_version >= 80300 and "typarray" or "NULL"
rv0, rv1 = [], []
@@ -1097,7 +1097,7 @@ class CompositeCaster(object):
schema = 'public'
# column typarray not available before PG 8.3
- typarray = conn.server_version >= 80300 and "typarray" or "NULL"
+ typarray = conn.info.server_version >= 80300 and "typarray" or "NULL"
# get the type oid and attributes
curs.execute("""\
diff --git a/lib/pool.py b/lib/pool.py
index 6c26f7d..734c136 100644
--- a/lib/pool.py
+++ b/lib/pool.py
@@ -105,7 +105,7 @@ class AbstractConnectionPool(object):
# Return the connection into a consistent state before putting
# it back into the pool
if not conn.closed:
- status = conn.get_transaction_status()
+ status = conn.info.transaction_status
if status == _ext.TRANSACTION_STATUS_UNKNOWN:
# server connection lost
conn.close()