+ def index_exists(self, table, index):
+ """ Check that an indexwith the given name exists on the given table.
+ """
+ num = self.scalar("""SELECT count(*) FROM pg_indexes
+ WHERE tablename = %s and indexname = %s""",
+ (table, index))
+ return num == 1
+
+