| От | Tom Lane |
|---|---|
| Тема | Re: unintuitive subquery record wrapping |
| Дата | |
| Msg-id | 12802.1284825023@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: unintuitive subquery record wrapping (Rikard Pavelic <rikard.pavelic@zg.htnet.hr>) |
| Список | pgsql-general |
Rikard Pavelic <rikard.pavelic@zg.htnet.hr> writes:
> I'm arguing that is seems wrong that I need to match alias name like this
> select t from (select t from t) t
> or like this
> select sq from (select sq from t sq) sq
> to get unwrapped type.
This reminds me of the old joke ...
Patient: Doctor, it hurts when I do this.
Doctor: So don't do that!
When you write a query like that, there are two ways to resolve the
reference: it could be naming the (single) output column of the
subquery, or it could be naming the entire record result of the
subquery. PG tries those alternatives in that order. If you don't
like that, maybe you shouldn't use conflicting alias names.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера