Andrei,
> I'm planning to something like
> INSERT INTO first_table
> SELECT * FROM second_table s WHERE
> NOT EXISTS (SELECT 1 FROM first_table WHERE id = s.id)
This is the way to do it, athough I'd fully qualify both "id" fields in the
subquery and use an alias to avoid confusion, e.g.
NOT EXISTS (SELECT 1 FROM first_table f2 WHERE f2.id = s.id)
--
-Josh Berkus
Aglio Database Solutions
San Francisco