On Wed, Feb 22, 2017 at 8:08 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Or else not generate a name at all, in which case there simply wouldn't be a way to refer to the subquery by name; I'm not sure what that might break though.
Yeah, usually when I want this I don't end up needing refer by name:
First I write:
SELECT * <with aliasing and stuff>
FROM <some complexity here>
The decide I need to do some result filtering
SELECT * FROM (
<original query>
) --ooops, forgot the alias
WHERE ...
Its for interactive use - and in fact I don't think I'd want to leave my production queries without names.