Re: function expression in FROM may not refer to other relations of same query level - Mailing list pgsql-sql

From Philippe Lang
Subject Re: function expression in FROM may not refer to other relations of same query level
Date
Msg-id 6C0CF58A187DA5479245E0830AF84F420803B7@poweredge.attiksystem.ch
Whole thread Raw
In response to function expression in FROM may not refer to other relations of same query level  ("Philippe Lang" <philippe.lang@attiksystem.ch>)
Responses 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
List 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 by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: UPDATE FROM problem, multiple updates of same row don't seem to work
Next
From: Stef
Date:
Subject: Maybe install debian on your home pc?