Does CREATE FUNCTION... WITH (ISCACHABLE) work?

From: "Joel Burton" <jburton(at)scw(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Does CREATE FUNCTION... WITH (ISCACHABLE) work?
Date: 2000-07-19 16:40:29
Message-ID: 3975A1BD.30413.965FF81@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a function that always returns the same answer given the
same input (no database lookups, etc.). The pg Users' Manual
documents the attribute 'iscachable' as allowing the database to
parse the results of the function and not keep looking it up.

Does this actually work yet? A simple test case:

CREATE FUNCTION f() RETURNS INT AS '
BEGIN
raise notice ''foo'';
return 1;
end;
' LANGUAGE 'plpgsql' WITH (ISCACHABLE);

SELECT o();
NOTICE: foo
o
___
1
(1 row)

SELECT o();
NOTICE: foo
o
____
(1 row)

It might be that the parser is smart enough to copy any output
(such as the RAISE NOTICE), my fear is that it is actually running
the function a second time.

Does anyone know if this caching actually happens yet, or is this a
future feature?

Thanks.
--
Joel Burton, Director of Information Systems -*- jburton(at)scw(dot)org
Support Center of Washington (www.scw.org)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-07-19 18:30:08 Re: Does CREATE FUNCTION... WITH (ISCACHABLE) work?
Previous Message Tom Lane 2000-07-19 14:52:12 Re: tcl/tk interface on Digital Unix