Is it possible to make a single SQL statement that will insert a row if it does not already exist, otherwise it will just update the fields?
Actually, just a statement that will not give an error about duplicate keys would be enough for my application. Something like INSERT INTO SOME_TABLE (FIELD1, ...) VALUES (VALUE1, ...) WHERE KEY_FIELD DOES NOT EXIST; I am working in PostgreSQL 7.3.x. Thanks, Ralph ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match