Enhance postgres index filter with values from real life 3.24
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 14 Dec 2016 17:06:24 +0100
branch3.24
changeset 11894 ec29989fba13
parent 11893 b230f4a4010d
child 11895 74e0d1a5560b
Enhance postgres index filter with values from real life This has been found on fairly old instances of ours (cwo/elo). Dunno if we really want this in, it may lead to false negatives.
cubicweb/server/checkintegrity.py
--- a/cubicweb/server/checkintegrity.py	Wed Dec 14 17:04:29 2016 +0100
+++ b/cubicweb/server/checkintegrity.py	Wed Dec 14 17:06:24 2016 +0100
@@ -481,7 +481,8 @@
     if source.dbdriver == 'postgres':
 
         def index_filter(idx):
-            return not (idx.startswith('pg_') or idx.endswith('_pkey'))
+            return not (idx.startswith('pg_') or '_pkey' in idx or '_p_key' in idx
+                        or idx.endswith('_key'))
     else:
 
         def index_filter(idx):