summaryrefslogtreecommitdiff
path: root/lib/extensions.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/extensions.py')
-rw-r--r--lib/extensions.py11
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