ckan/ckan — pull request #1879 by amercader (2014-08-12 10:49:02+00:00)
Title: Ensure that the DataStore is running on legacy mode when using PostgreSQL < 9.x

The DataStore has limited functionality when running on Postgres 8.x (eg no `datastore_search_sql` available). This means that it is run on [legacy mode](http://docs.ckan.org/en/latest/maintaining/datastore.html#legacy-mode-use-the-datastore-with-old-postgresql-versions).

The user has to actively set the legacy mode by not setting the `ckan.datastore.read_url`. There is no further check to see if the user is not running the DataStore with an old Postgres version, so basically if someone follows the setting up instructions on the docs can effectively end up with a DataStore with `datastore_search_sql` available running on PostgreSQL 8.x, which might lead to unsupported behaviour.

I propose that the legacy mode is determined, apart from `ckan.datastore.read_url` not being set, by checking if the actual Postgres version run is lower than 9.x.