Re: how to evaluate a function only once for a query?

From: Nicolae Mihalache <mache(at)abcpages(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to evaluate a function only once for a query?
Date: 2002-06-20 13:46:47
Message-ID: 3D11DCC7.60402@abcpages.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Nicolae Mihalache <mache(at)abcpages(dot)com> writes:
>
>>I've created a function timevalue(text) that returns a timestamp as
>>result. The function works just fine.
>>However, when I do a query like:
>>"select * from mytable where time<timevalue('something')" I see that my
>>function is evaluated once for each row in mytable.
>
>
> See the "isCachable" attribute in CREATE FUNCTION.
>
> regards, tom lane

thanks for your quick answer.
I'm tring to use this attribute but I get an error:
robust=# create function testfunc () returns text as '' language 'pltcl'
with iscachable;
ERROR: parser: parse error at or near "iscachable"

any ideea? Is it possible that my postgres 7.2.1 does not support this
attrributes? I also get error if I'm tring to use the other attribute
"isstrict"

Thanks,
Nicolae Mihalache

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bjoern Metzdorf 2002-06-20 13:50:20 Re: db grows and grows
Previous Message Jeff Eckermann 2002-06-20 13:45:09 Re: how to evaluate a function only once for a query?