--- On Tue, 12/11/07, Pau Marc Munoz Torres <paumarc(at)gmail(dot)com> wrote:
> Thanks, i'll test it tomorrow
OOPS, I just noticed a mistake.
INSERT INTO SP
SELECT a, b
FROM ( VALUES ( 'cesp', 'sp' )) AS tmp( a, b )
LEFT JOIN Sp
ON (Sp.col1,Sp.col2)=(tmp.a,tmp.b)
WHERE (Sp.col1,Sp.col2) IS NULL;
I forgot the parentheses that the FROM clause requires when using the VALUES predicate. Also remember that this only works in PostgreSQL versions >= 8.2.
Regards,
Richard Broersma Jr.