The following conditional insert works only if the item already exists! (does not go on with attempting to insert).
If the item does not exist, I get duplicate key violation (duplicate key violates unique constraint)! Using postgresql 9.2
INSERT INTO mytable (mytable_handle, title, description)
select '1234/9876', 'Title here', 'description here'
from mytable where not exists
(select 1 from mytable where mytable_handle = '1234/9876')
(mytable_handle is the pkey)
mytable_handleis a character columns? As a primary key? - joop