Re: Unclear documentation (IMMUTABLE functions)

From: Neil Conway <neilc(at)samurai(dot)com>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: Daniel Schreiber <daniel(dot)schreiber(at)s1999(dot)tu-chemnitz(dot)de>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Unclear documentation (IMMUTABLE functions)
Date: 2003-09-05 18:32:02
Message-ID: 1062786722.447.5.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, 2003-09-05 at 10:01, Stephan Szabo wrote:
> This is the section in create function reference page about immutable. I'd
> thought it was clear, but do you have a better suggested wording?

While we're on the subject, this adjacent paragraph of the docs seems
unclear:

STABLE indicates that within a single table scan the function
will consistently return the same result for the same argument
values, but that its result could change across SQL statements.
This is the appropriate selection for functions whose results
depend on database lookups, parameter variables (such as the
current time zone), etc. Also note that the current_timestamp
family of functions qualify as stable, since their values do not
change within a transaction.

So, can a STABLE function change across SQL statements (as the beginning
of the paragraph implies), or across transactions (as the end of the
paragraph implies)?

-Neil

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Mendola Gaetano 2003-09-05 19:32:01 Re: to_timestamp not stable if date string shorter than template
Previous Message Tom Lane 2003-09-05 16:47:13 Re: Unclear documentation (IMMUTABLE functions)