Re: SQL feature requests

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: SQL feature requests
Дата
Msg-id 20070823165507.GA31461@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: SQL feature requests  (Gregory Stark <stark@enterprisedb.com>)
Ответы Re: SQL feature requests
Список pgsql-hackers
Gregory Stark escribió:
> "Alvaro Herrera" <alvherre@commandprompt.com> writes:
> 
> > Gregory Stark escribió:
> >
> >> The upside is the convenience which after all is the same upside as most of
> >> our spec grammar extensions. Many many programmers are accustomed to entering
> >> ad-hoc queries of this form and forcing them to enter an alias for no purpose
> >> is just silly pedanticism from their point of view. The portability of ad-hoc
> >> queries is meaningless and if you don't refer to the alias in the query then
> >> it's truly pointless.
> >
> > So there's the compromise: allow not specifying an alias only if it's
> > not used in the rest of the query at all, so the subquery would be
> > effectively anonymous.
> 
> If what's not used in the rest of the query?

The alias, of course.  If you reread Tom's argument, his problem is that
the alias we choose may collide with what an hypotetical future standard
may define, so the users who start to depend on the names with choose
automatically would be screwed.

> 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.

-- 
Alvaro Herrera                        http://www.advogato.org/person/alvherre
A male gynecologist is like an auto mechanic who never owned a car.
(Carrie Snow)


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: SQL feature requests
Следующее
От: "Ben Tilly"
Дата:
Сообщение: Re: SQL feature requests