Re: Unclear documentation (IMMUTABLE functions)

From: terry(at)greatgulfhomes(dot)com
To: "'Neil Conway'" <neilc(at)samurai(dot)com>, "'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 20:05:59
Message-ID: 011501c373e9$20319380$2766f30a@development.greatgulfhomes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Not my place to say, but...

I think this likely should be worded something like this (if true):
...
Also note that the current_timestamp family of functions qualify as stable,
since their values do not change within SQL statement, and to be more
concise the current_timestamp functions do not change within a transaction.

Terry Fielder
Manager Software Development and Deployment
Great Gulf Homes / Ashton Woods Homes
terry(at)greatgulfhomes(dot)com
Fax: (416) 441-9085

> -----Original Message-----
> From: pgsql-bugs-owner(at)postgresql(dot)org
> [mailto:pgsql-bugs-owner(at)postgresql(dot)org]On Behalf Of Neil Conway
> Sent: Friday, September 05, 2003 2:32 PM
> To: Stephan Szabo
> Cc: Daniel Schreiber; pgsql-bugs(at)postgresql(dot)org
> Subject: Re: [BUGS] Unclear documentation (IMMUTABLE functions)
>
>
> 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
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Browse pgsql-bugs by date

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