Skip to content

Commit

Permalink
[#4841] Change statement to support psycopg2 2.8.x
Browse files Browse the repository at this point in the history
Some users might find libssl issues (see #4837) for which an upgrade in
psycopg2 is required. While we are not porting the requirement upgrade
to 2.8, we make this change which is backwards compatible with psycopg2
2.7.3.2 (CKAN 2.8 pinned version) in case someone needs to upgrade the
requirement in their environment.

Just in case we fall back to the old syntax if there is an
AttributeError.
  • Loading branch information
amercader committed Jul 1, 2019
1 parent 09d2f3b commit f9aaf91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ckanext/datastore/backend/postgres.py
Expand Up @@ -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):
Expand Down

0 comments on commit f9aaf91

Please sign in to comment.