# HG changeset patch # User Samuel Trégouët # Date 1450171719 -3600 # Node ID 1df243392d45b79474daf2770cc501e9c4d55022 # Parent 3dfed980071ca58869e5a24fbe6eadd32b9ed696 [dataimport] massive_store: reformat sql query diff -r 3dfed980071c -r 1df243392d45 dataimport/massive_store.py --- a/dataimport/massive_store.py Mon Dec 21 12:47:35 2015 +0100 +++ b/dataimport/massive_store.py Tue Dec 15 10:28:39 2015 +0100 @@ -728,12 +728,16 @@ def application_constraints(self, tablename): """ Iterate over all the constraints """ sql = '''SELECT i.conname as "Name" - FROM pg_catalog.pg_class c JOIN pg_catalog.pg_constraint i - ON i.conrelid = c.oid JOIN pg_catalog.pg_class c2 ON i.conrelid=c2.oid + FROM pg_catalog.pg_class c + JOIN pg_catalog.pg_constraint i ON i.conrelid = c.oid + JOIN pg_catalog.pg_class c2 ON i.conrelid=c2.oid LEFT JOIN pg_catalog.pg_user u ON u.usesysid = c.relowner LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace - WHERE c2.relname = '%s' AND n.nspname NOT IN ('pg_catalog', 'pg_toast') - AND pg_catalog.pg_table_is_visible(c.oid);''' % tablename + WHERE + c2.relname = '%s' + AND n.nspname NOT IN ('pg_catalog', 'pg_toast') + AND pg_catalog.pg_table_is_visible(c.oid) + ''' % tablename indexes_list = self.cnx.system_sql(sql).fetchall() constraints = {} for name, in indexes_list: