[email protected] ("David E. Wheeler") wrote: >> SELECT t1.ID AS SurplusID, >> | t1.Name AS SurplusName, >> | t2.ID AS MissingID, >> | t2.Name AS MissingName >> | FROM tmpData AS t1 >> | FULL OUTER JOIN (VALUES (1, 'Z'), (4, 'E'), (7, 'L')) >> | AS t2 (ID, Name) >> | USING (ID, Name) >> | WHERE t1.ID IS NULL OR t2.ID IS NULL;
> You could use VALUES in a table expression, like this: > SELECT t1.ID AS SurplusID, > t1.Name AS SurplusName, > t2.ID AS MissingID, > t2.Name AS MissingName > FROM (VALUES > (1, 'FOO'), > (2, 'bar') > ) AS t1(id, name) > FULL OUTER JOIN (VALUES (1, 'Z'), (4, 'E'), (7, 'L')) AS t2 (ID, Name) > USING (ID, Name) > WHERE t1.ID IS NULL OR t2.ID IS NULL; I should have pointed out more clearer the problem :-). The query itself is fine; tmpData in this case is probably mis- named as it is really meant to represent the (permanent) data in PostgreSQL. The question is how to pass the data structure: | my @Data = ([1, 'Z'], [4, 'E'], [7, 'L']); from the Perl side via DBD::Pg to use it for comparison (or whatever) in PostgreSQL. Tim P. S.: Anybody opposed to de-encrypting this group on Gmane?
