Function Returning Table/Record

Поиск
Список
Период
Сортировка
От Carel Combrink
Тема Function Returning Table/Record
Дата
Msg-id 20100831153625.57056tm0nsi47909@student.up.ac.za
обсуждение исходный текст
Ответы Re: Function Returning Table/Record  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Hi,

I have a function that returns a subset of data from a specific table.
The function must return all the rows that are present in the parent
table.

Is there an easy way to create this function so that when the table
definition changes I don't need to change the function definition.

I know I can create the table to return RECORD but then when I call
the function I must specify the structure of the returned type.
Eg. SELECT * FROM my_func(args) AS foo(col type, ...);

There are a lot of columns so this is not a very practical solution.

Isn't there a shorter/better/easier way to do this?

--
Carel Combrink
s25291930@tuks.co.za

This message and attachments are subject to a disclaimer. Please refer
to www.it.up.ac.za/documentation/governance/disclaimer/ for full
details. / Hierdie boodskap en aanhangsels is aan 'n vrywaringsklousule
onderhewig. Volledige besonderhede is by
www.it.up.ac.za/documentation/governance/disclaimer/ beskikbaar.


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

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Running totals
Следующее
От: Robert Dean
Дата:
Сообщение: Django + Postgressql