From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
---|---|
To: | Michael Glaesemann <grzm(at)seespotcode(dot)net> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: SQL feature requests |
Date: | 2007-08-23 19:50:37 |
Message-ID: | 20070823195037.GE31461@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Michael Glaesemann wrote:
>
> On Aug 23, 2007, at 14:25 , Tom Lane wrote:
>
>> Josh Berkus <josh(at)agliodbs(dot)com> writes:
>>> 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.
>>
>> Why do you think it'd be restricted to only one subquery?
>>
>> As long as you take care that the subquery's column names don't match
>> any other ones in the query, you don't *need* an alias for it ---
>> there'll be no need to qualify the column names. This extends just
>> fine to multiple subqueries.
>
> How about something like gensym? One alias you could always use and be
> guaranteed it would give a unique value. Still provide the alias, but don't
> have to think about name collisions.
It is dangerous to provide a synthetic name; if the standard ever gets
modified to support alias-less subqueries, they would likely choose a
different name-generating algorithm, and we would have a
backward-compatibility problem.
Or is that a backwards-compatibility problem? I remain unsure.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2007-08-23 20:01:08 | Re: SQL feature requests |
Previous Message | Zdenek Kotala | 2007-08-23 19:50:01 | Re: pg_ctl configurable timeout |