Thanks, but I can't do that because I'm batching up multiple writes in transactions to get performance. The errors cause the whole transaction to need to be rolled back.

On 8/04/2012 11:20 a.m., Igor Tandetnik wrote:
Josh Gibbs<jgi...@imailds.com>  wrote:
The method that must be used is as follows:

CREATE TABLE test_table (property TEXT PRIMARY KEY, value TEXT);

SQLite: INSERT OR IGNORE INTO test_table VALUES('prop','val');
Postgres: INSERT INTO test_table SELECT 'prop','val' WHERE NOT EXISTS
(SELECT 1 FROM test_table WHERE property='prop');
Another option: use a plain vanilla INSERT, and simply ignore any 
constraint-related errors in your application.


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to