Re: [HACKERS] Make subquery alias optional in FROM clause

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Make subquery alias optional in FROM clause
Дата
Msg-id 7458.1487953098@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Make subquery alias optional in FROM clause  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
Craig Ringer <craig@2ndquadrant.com> writes:
> Personally I think we need to generate one, if nothing else for error
> messages where we try to emit qualified names of columns.

Also for EXPLAIN, where there has to be a way to name everything.

> But I don't see that the name needs to be anything we can refer to
> elsewhere or anything faintly sane to type. Something like:
>   "<pg anon subquery #[counter]>"

-1.  "Make it ugly as sin and then pretend that nobody could conflict
with it" is neither formally correct nor nice to look at in the contexts
where people have to look at it.

I'm for something along the lines of "subquery_n" where we simply keep
incrementing n until we find a name that is not present in the query
already.  This is basically what ruleutils.c does now when it has to
cons up a unique table alias, which it must do in cases involving
inheritance.
        regards, tom lane



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] safer node casting
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] utility commands benefiting from parallel plan