diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2013-04-07 17:43:35 +0100 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2013-04-07 17:43:35 +0100 |
commit | 80e105c74d1846b036eccf14adad8dbc95dce39c (patch) | |
tree | 6c9699513fe724e0e16bee254945fa6482a36c2f /lib/extensions.py | |
parent | 7a1d1791d3f70be4ebe7eccb7ec50732589c3dcf (diff) | |
parent | b448f822f48885fcb3caa48f213bec54cf886ec0 (diff) | |
download | psycopg2-80e105c74d1846b036eccf14adad8dbc95dce39c.tar.gz |
Merge branch 'devel'2_5
Diffstat (limited to 'lib/extensions.py')
-rw-r--r-- | lib/extensions.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/extensions.py b/lib/extensions.py index bdcfdf2..f499e48 100644 --- a/lib/extensions.py +++ b/lib/extensions.py @@ -58,7 +58,7 @@ except ImportError: from psycopg2._psycopg import adapt, adapters, encodings, connection, cursor, lobject, Xid from psycopg2._psycopg import string_types, binary_types, new_type, new_array_type, register_type -from psycopg2._psycopg import ISQLQuote, Notify +from psycopg2._psycopg import ISQLQuote, Notify, Diagnostics from psycopg2._psycopg import QueryCanceledError, TransactionRollbackError @@ -151,6 +151,21 @@ class NoneAdapter(object): return _null +# Create default json typecasters for PostgreSQL 9.2 oids +from psycopg2._json import register_default_json + +try: + JSON, JSONARRAY = register_default_json() +except ImportError: + pass + +del register_default_json + + +# Create default Range typecasters +from psycopg2. _range import Range +del Range + # Add the "cleaned" version of the encodings to the key. # When the encoding is set its name is cleaned up from - and _ and turned # uppercase, so an encoding not respecting these rules wouldn't be found in the @@ -160,5 +175,3 @@ for k, v in encodings.items(): encodings[k] = v del k, v - -__all__ = filter(lambda k: not k.startswith('_'), locals().keys()) |