[PATCH] Allow anonymous rowtypes in function return column definition

Поиск
Список
Период
Сортировка
От Elvis Pranskevichus
Тема [PATCH] Allow anonymous rowtypes in function return column definition
Дата
Msg-id 11038447.kQ5A9Uj5xi@hammer.magicstack.net
обсуждение исходный текст
Ответы Re: [PATCH] Allow anonymous rowtypes in function return column definition  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Currently, the following query

    SELECT q.b = row(2)
    FROM unnest(ARRAY[row(1, row(2))]) AS q(a int, b record);

would fail with

    ERROR:  column "b" has pseudo-type record

This is due to CheckAttributeNamesTypes() being used on a function
coldeflist as if it was a real relation definition.  But in the context
of a query there seems to be no harm in allowing this, as other ways of
manipulating anonymous rowtypes work well, e.g.:

    SELECT (ARRAY[ROW(1, ROW(2))])[1];



                                Elvis

Вложения

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: rewrite ExecPartitionCheckEmitError
Следующее
От: Andres Freund
Дата:
Сообщение: Re: don't create storage when unnecessary