Re: function expression in FROM may not refer to other relations of same query level

Поиск
Список
Период
Сортировка
От Philippe Lang
Тема Re: function expression in FROM may not refer to other relations of same query level
Дата
Msg-id 6C0CF58A187DA5479245E0830AF84F420803B7@poweredge.attiksystem.ch
обсуждение исходный текст
Ответ на function expression in FROM may not refer to other relations of same query level  ("Philippe Lang" <philippe.lang@attiksystem.ch>)
Ответы Re: function expression in FROM may not refer to other relations of same query level
Re: function expression in FROM may not refer to other relations
Список pgsql-sql
> > The problem now is that get_lines is being called twice per line.
>
> Is get_lines() defined as IMMUTABLE?  Should it be?

I have tried defining get_lines as "IMMUTABLE", or "WITH (iscachable)",
but it keeps on getting called twice per line in the following query...

select id, usr, code, (get_lines(code)).line1, (get_lines(code)).line2
from tbl;

I wish there was a way to run the query like this:

select id, usr, code, CAST(get_lines(code) as lines)
from tbl;




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