Why not sub-selects in targetlists? - Mailing list pgsql-hackers

From Tom Lane
Subject Why not sub-selects in targetlists?
Date
Msg-id 12706.935948875@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
For some reason we currently support sub-SELECT expressions only
in WHERE and HAVING clauses, not in the target list of a SELECT.
Does anyone know why this is?

There are a number of places in the planner/optimizer that would need
to be fixed to make it happen, but the changes are utterly trivial
(calling certain transformation routines on the targetlist as well as
for WHERE and HAVING ... probably about a dozen lines total ...).
And a quick look at the executor doesn't show any reason why it would
have a problem, either.  Is there something fundamental that I'm
missing?  If not, why wasn't this done to begin with?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] PostgreSQL 6.5.2
Next
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] PostgreSQL 6.5.2