diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2012-09-27 00:41:04 +0100 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2012-09-27 00:41:04 +0100 |
commit | dda24f082fbb5cfffc922f9cc6651c73b56b56f0 (patch) | |
tree | 38db92e9b99fd50f0ebfe3b67ea4a2cfe88b47fa /lib/extensions.py | |
parent | 33043cd03810fd65483d53918a49576c1c143bbf (diff) | |
parent | 465b5cf280f6fe434d2f2fdd5d75d9c28723bac5 (diff) | |
download | psycopg2-dda24f082fbb5cfffc922f9cc6651c73b56b56f0.tar.gz |
Merge branch 'json' into devel
Diffstat (limited to 'lib/extensions.py')
-rw-r--r-- | lib/extensions.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/extensions.py b/lib/extensions.py index bdcfdf2..ca467d5 100644 --- a/lib/extensions.py +++ b/lib/extensions.py @@ -151,6 +151,17 @@ 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 + + # 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 |