Comment 4 for bug 656516

Revision history for this message
James Henstridge (jamesh) wrote :

Sorry for not getting back to you on this. If you receive an IntegrityError from the database, your only recourse is to roll back the transaction and try again. For instance, with PostgreSQL I get:

  template1=# create temporary table foo (id serial primary key, bar text unique);
  CREATE TABLE
  template1=# begin;
  BEGIN
  template1=# insert into foo (bar) values ('whatever');
  INSERT 0 1
  template1=# insert into foo (bar) values ('whatever');
  ERROR: duplicate key value violates unique constraint "foo_bar_key"
  template1=# insert into foo (bar) values ('something else');
  ERROR: current transaction is aborted, commands ignored until end of transaction block
  template1=# commit;
  ROLLBACK

The face that sqlite is letting you commit after this error sounds like a bug. it isn't a mode of use we are trying to support.