[dataimport] massive_store: ignore primary key when requesting indexes on a table
Primary keys show up in both lists of constraints and indexes. Pick a
side and stick to it.
--- a/dataimport/massive_store.py Tue Dec 15 10:28:39 2015 +0100
+++ b/dataimport/massive_store.py Tue Dec 15 10:32:53 2015 +0100
@@ -717,6 +717,7 @@
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind IN ('i','')
AND c2.relname = '%s'
+ AND i.indisprimary = FALSE
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()