Hi,
Can pg transform
SELECT * FROM (
SELECT 'foo' AS class, id FROM foo
UNION ALL
SELECT 'bar' AS class, id FROM bar
) AS a WHERE class = 'foo'
into
SELECT 'foo' AS class, * FROM foo?
The subselect is a view here, that's why I don't just use the second
query.
Markus
--
Markus Bertheau <twanger(at)bluetwanger(dot)de>