Hi,
Can pg transform
SELECT * FROM (SELECT 'foo' AS class, id FROM fooUNION ALLSELECT '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@bluetwanger.de>