diff options
| author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2014-08-13 00:54:49 +0100 |
|---|---|---|
| committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2014-08-13 02:02:01 +0100 |
| commit | 9d547469b8a3f2a9a554edc5218797349d1a4472 (patch) | |
| tree | 304780bb8f836b2a08b05c085fe726511fb6b488 /lib/extensions.py | |
| parent | 6bca443e37cd0cb5e37352eaf2e8aafc832324ee (diff) | |
| download | psycopg2-9d547469b8a3f2a9a554edc5218797349d1a4472.tar.gz | |
Add register_default_jsonb() and register the type
Diffstat (limited to 'lib/extensions.py')
| -rw-r--r-- | lib/extensions.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/extensions.py b/lib/extensions.py index f210da4..71a92b9 100644 --- a/lib/extensions.py +++ b/lib/extensions.py @@ -152,20 +152,22 @@ class NoneAdapter(object): # Create default json typecasters for PostgreSQL 9.2 oids -from psycopg2._json import register_default_json +from psycopg2._json import register_default_json, register_default_jsonb try: JSON, JSONARRAY = register_default_json() + JSONB, JSONBARRAY = register_default_jsonb() except ImportError: pass -del register_default_json +del register_default_json, register_default_jsonb # 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 |
