Skip to content

Commit

Permalink
Merge branch '345-fix-pg-detection'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Feb 6, 2013
2 parents 4fe7b50 + 6c5453a commit 27b7753
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion ckan/model/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,6 @@ def engine_is_sqlite():

def engine_is_pg():
# Returns true iff the engine is connected to a postgresql database.
return engine.url.drivername in ['psycopg2', 'postgres']
# According to http://docs.sqlalchemy.org/en/latest/core/engines.html#postgresql
# all Postgres driver names start with `postgresql`
return engine.url.drivername.startswith('postgresql')
3 changes: 1 addition & 2 deletions ckanext/datastore/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ def configure(self, config):
self._create_alias_table()
else:
log.warn("We detected that CKAN is running on a read only database. "
"Permission checks and _table_metadata creation are skipped."
"Make sure that replication is properly set-up.")
"Permission checks and the creation of _table_metadata are skipped.")
else:
log.warn("We detected that you do not use a PostgreSQL database. "
"The DataStore will NOT work and datastore tests will be skipped.")
Expand Down

0 comments on commit 27b7753

Please sign in to comment.