[dataimport] massive_store: ignore primary key when requesting indexes on a table
authorSamuel Trégouët <samuel.tregouet@logilab.fr>
Tue, 15 Dec 2015 10:32:53 +0100
changeset 11019 36838a012ccc
parent 11018 1df243392d45
child 11020 c8c8f6a6147f
[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.
dataimport/massive_store.py
--- 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()