On Thursday 23 August 2007 09:55, Alvaro Herrera wrote:
> > I think the compromise is to instead of generating aliases at all just
> > use an alias like "*Anonymous Subquery*" and add a boolean flag
> > indicating that that range table is anonymous and not a valid target for
> > references. I started doing that a while back but got distracted (and
> > discouraged since it seemed not to have widespread support).
>
> Hey, you are describing an implementation of my suggestion.
I just don't really see the gain in doing this. Any violations of the SQL
standard are bad things in and of themselves; they encourage people to write
non-spec applications which are then hard to port/support alongside other
databases. It's also bad PR for us.
So if we're going to support a non-spec feature (gods know we have) then it's
going to be because it offers *significant* extra functionality. SELECT
DISTINCT ON (), LIMIT/OFFSET, custom data types, CREATE OPERATOR, RULES, etc.
all give us stuff that would be *very* hard to do -- or even impossible --
without these features.
I just don't see the ability to omit the alias in a query with only one
subquery (the only circumstances under which it would be safe to do so) as
any significant gain in fuctionality.
--
Josh Berkus
PostgreSQL @ Sun
San Francisco