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

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [HACKERS] Make subquery alias optional in FROM clause
Дата
Msg-id CAKFQuwZdSZOzVJGFd_iY7F_3Lx8Yk5r3Cy2G-F4vkiF4gs4PJg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Make subquery alias optional in FROM clause  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, Feb 22, 2017 at 8:08 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Or else not generate
a name at all, in which case there simply wouldn't be a way to refer to
the subquery by name; I'm not sure what that might break though.

​Yeah, usually when I want this I don't end up needing refer by name:

First I write:

SELECT * <with aliasing and stuff>
FROM <some complexity here​>

The decide I need to do some result filtering

SELECT * FROM (
<original query>
) --ooops, forgot the alias
WHERE ...

Its for interactive use - and in fact I don't think I'd want to leave my production queries without names.

David J.

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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: [HACKERS] Change in "policy" on dump ordering?
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: [HACKERS] mat views stats