Skip to content

Commit

Permalink
[#514] Do not use postgres concat function. Use || instead.
Browse files Browse the repository at this point in the history
Concat is not supported in pg 9.0. The || syntax howver does not allow  null as one argument. So we use coalesce to either get the value or an empty string.
  • Loading branch information
domoritz committed Feb 28, 2013
1 parent d6fbfa9 commit a3a3839
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckanext/datastore/plugin.py
Expand Up @@ -183,7 +183,7 @@ def _check_read_permissions(self):
def _create_alias_table(self):
mapping_sql = '''
SELECT DISTINCT
substr(md5(concat(dependee.relname, dependent.relname)), 0, 17) AS "_id",
substr(md5(dependee.relname || COALESCE(dependent.relname, '')), 0, 17) AS "_id",
dependee.relname AS name,
dependee.oid AS oid,
dependent.relname AS alias_of
Expand Down

0 comments on commit a3a3839

Please sign in to comment.