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.
-- 
Igor Tandetnik

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

Reply via email to