Recent 11.16 release change

Поиск
Список
Период
Сортировка
От Daniel Brinzila
Тема Recent 11.16 release change
Дата
Msg-id CAHVn1Am3dZuNZDwGd_+X9hOL7L5RPejLr8r=3N+DS=2Wg4pT8g@mail.gmail.com
обсуждение исходный текст
Ответы Re: Recent 11.16 release change  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I am a bit confused as to the following change: 

  • Stop using query-provided column aliases for the columns of whole-row variables that refer to plain tables (Tom Lane)

    The column names in tuples produced by a whole-row variable (such as tbl.* in contexts other than the top level of a SELECT list) are now always those of the associated named composite type, if there is one. We'd previously attempted to make them track any column aliases that had been applied to the FROM entry the variable refers to. But that's semantically dubious, because really then the output of the variable is not at all of the composite type it claims to be. Previous attempts to deal with that inconsistency had bad results up to and including storing unreadable data on disk, so just give up on the whole idea.

    In cases where it's important to be able to relabel such columns, a workaround is to introduce an extra level of sub-SELECT, so that the whole-row variable is referring to the sub-SELECT's output and not to a plain table. Then the variable is of type record to begin with and there's no issue.


Could someone please give an example of this scenario, one that works in 11.15 and another for 11.16 after the recent change.

Thanks!

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Postgres NOT IN vs NOT EXISTS optimization
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Recent 11.16 release change