JOIN Record returning Function

Поиск
Список
Период
Сортировка
От Daniel Schuchardt
Тема JOIN Record returning Function
Дата
Msg-id hk962r$rcb$1@news.hub.org
обсуждение исходный текст
Список pgsql-general
Hy Group,

i have a function that returns a record.

myfunc(IN id INTEGER) RETURNS RECORD.

in that function the record is build from some subquery's in dependence of data.

Now i need to join that function to its correponding main table that holds the id.

SELECT myfunc.* FROM maintable JOIN myfunc(maintable.pk) ON true WHERE maintable.field=statisticdata;

ERROR:  invalid reference to FROM-clause entry for table "maintable"
TIP:  There is an entry for table "maintable", but it cannot be referenced from this part of the query.

so far so good, thats clear. But does anyone know a tricky solution for that problem?
--

Daniel Schuchardt
Softwareentwicklung

http://www.prodat-sql.de

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

Предыдущее
От: Clemens Schwaighofer
Дата:
Сообщение: Re: Problem with partition tables and schemas
Следующее
От: Reece Hart
Дата:
Сообщение: Re: pg_dump issues