'Check constraints by setting them to immediate. Return them to deferred
afterward.'

def check_constraints(self, table_names=None):

    self.cursor().execute('SET    CONSTRAINTS    ALL    IMMEDIATE')
    self.cursor().execute('SET    CONSTRAINTS    ALL    DEFERRED')
