JOINing record returning function to query

Поиск
Список
Период
Сортировка
От A Gilmore
Тема JOINing record returning function to query
Дата
Msg-id 437F5B45.3000709@shaw.ca
обсуждение исходный текст
Список pgsql-novice
Hello,

I have a plpgsql function that returns a single row based on two ints it
is passed.  I want to join this function onto a SELECT query.  If I give
it to static ints like :

myfunc(8, 5);

It works fine, however in the query, the second arg is a column like so:

myfunc(7, t1.id);

This results in the error :

NOTICE:  adding missing FROM-clause entry for table "t1"
ERROR:  function expression in FROM may not refer to other relations of
same query level

What is the proper method of doing this?  Google found this discussion

(http://www.issociate.de/board/post/130018/function_expression_in_FROM_may_not_refer_to_other_relations_of_same_query_level.html)

but after reading a few times I am still scratching my head.

Example code would probably be to lengthy to be useful.

Thank you in advance,
- A Gilmore

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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: formating a select from a timestamp column
Следующее
От: Bill Dika
Дата:
Сообщение: Re: Application using PostgreSQL as a back end (experienced programmers please)