diff --git a/ckanext/datastore/backend/postgres.py b/ckanext/datastore/backend/postgres.py index fd4c333751a..ee27e0ab89f 100644 --- a/ckanext/datastore/backend/postgres.py +++ b/ckanext/datastore/backend/postgres.py @@ -284,7 +284,10 @@ def _cache_types(context): # redo cache types with json now available. return _cache_types(context) - register_composite('nested', connection.connection, True) + try: + register_composite('nested', connection.connection.connection, True) + except AttributeError: + register_composite('nested', connection.connection, True) def _pg_version_is_at_least(connection, version):