Project

General

Profile

« Previous | Next » 

Revision 854

sql.py: Switched try_insert() to use index_cols() instead of constraint_cols() for "duplicate key value violates unique constraint" errors because they can also be generated by UNIQUE indexes (and there is a UNIQUE index for every UNIQUE constraint)

View differences:

lib/sql.py
211 211
            r'"(([^\W_]+)_[^"]+)"', msg)
212 212
        if match:
213 213
            constraint, table = match.groups()
214
            try: cols = constraint_cols(db, table, constraint)
214
            try: cols = index_cols(db, table, constraint)
215 215
            except NotImplementedError: raise e
216 216
            else: raise DuplicateKeyException(cols, e)
217 217
        match = re.search(r'null value in column "(\w+)" violates not-null '

Also available in: Unified diff