Re: How do you control IMMUTABLE PG PROC results?

From: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How do you control IMMUTABLE PG PROC results?
Date: 2010-11-05 01:48:52
Message-ID: 201011050248.52574.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday 5. November 2010 01.24.14 Carlo Stonebanks wrote:
> We have procs that would benefit from returning IMMUTABLE results. The procs
> are dependent on external tables that rarely change, but when they DO
> change, it would be great if we could expire the cache that the procs read
> from so that the procs are forced to re-evaluate the results.

A function declared as IMMUTABLE can't, by definition, do database lookups.
Then it has to be declared as STABLE.

<http://www.postgresql.org/docs/8.4/static/xfunc-volatility.html>

«An IMMUTABLE function cannot modify the database and is guaranteed to return
the same results given the same arguments forever.»

regards,
Leif B. Kristensen

In response to

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2010-11-05 05:58:52 Re: How do you control IMMUTABLE PG PROC results?
Previous Message Alexander Farber 2010-11-05 00:48:54 Re: select to_char(current_timestamp, 'YYYY-WW');