Re: its posible to use a 2 column returning function as a subquery?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gerardo Herzig <gherzig(at)fmed(dot)uba(dot)ar>
Cc: postgres list <pgsql-sql(at)postgresql(dot)org>
Subject: Re: its posible to use a 2 column returning function as a subquery?
Date: 2009-09-11 21:44:54
Message-ID: 11732.1252705494@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Gerardo Herzig <gherzig(at)fmed(dot)uba(dot)ar> writes:
> There is some syntax for calling get_desc_and_price only once?

Do something like

select (t).* from (select get_desc_and_price(shoe) as t from ...) ss;

If you don't have get_desc_and_price marked as volatile, you'll probably
also need to add "offset 0" to the sub-select to keep the planner from
flattening the sub-select and producing multiple calls of the function.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Rajesh Kumar Mallah 2009-09-13 15:07:17 schema proxying virtual database
Previous Message Gerardo Herzig 2009-09-11 20:16:30 its posible to use a 2 column returning function as a subquery?