column definition for setof record functions (like dblink and crosstabs)

Поиск
Список
Период
Сортировка
От Willy-Bas Loos
Тема column definition for setof record functions (like dblink and crosstabs)
Дата
Msg-id CAHnozTj5p1BY4+dwsYv3MCPHV0QwcyMwWHq2Th7Q87O39WJUdQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: column definition for setof record functions (like dblink and crosstabs)  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-general
Hi,

Functions that return SETOF RECORD need to be called with a column definition. That is a bit limiting.
For example, you might not know how many columns your crosstab will have in advance, you might not know the structure of a table that you access with dblink in advance.
Also, it's always a more complicated query to write, which is not very user friendly.

I searched a bit for the reason, and i found: "This allows the system to understand what * should expand to, and what proname in the WHERE clause refers to, in advance of trying to execute the function." in the dblink page.
From this sentence i can derive that there are some internal mechanisms that need to have the the column definition before the data.

I was just wondering if there were a way to generate this information automatically, so that the user need not supply it.
It would have a cost of course, but in some cases, it might certainly be worth it.

Cheers,

WBL
--
"Quality comes from focus and clarity of purpose" -- Mark Shuttleworth

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

Предыдущее
От: "Albe Laurenz"
Дата:
Сообщение: Re: acessibility for tables
Следующее
От: "Marc Mamin"
Дата:
Сообщение: postgres function for the query tree based normalization?