Re: Coalesce bug ?

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: Chris Angelico <rosuav(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Coalesce bug ?
Date: 2012-12-21 22:31:06
Message-ID: 50D4E32A.2040906@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/21/2012 02:22 PM, Chris Angelico wrote:
> On Sat, Dec 22, 2012 at 3:53 AM, David Johnston <polobo(at)yahoo(dot)com> wrote:
>> Chris Angelico wrote, and David dropped the citation (oops!):
>>> By the way, why do you declare your functions as "STRICT IMMUTABLE"
>>> and "STRICT VOLATILE"?
>>
>> Is this a question about the layout of the commands spatially?
>
> As I understand it, there are three keywords: VOLATILE, STRICT, and
> IMMUTABLE. Putting one of those keywords into the declaration flags
> the function accordingly; if none is given, VOLATILE is assumed.
>
> Declaring the function as "STRICT IMMUTABLE" or "STRICT VOLATILE"
> seems at best redundant (the word "STRICT" is mere noise), and at
> worst confusing (the parser might be interpreting it as "STRICT", not
> as the other keyword). Or is there something I'm missing here?

Not sure I am following.

IMMUTABLE/VOLATILE/STABLE deal with the query optimizer.

CALLED ON NULL INPUT/STRICT deal with NULL input behavior.

http://www.postgresql.org/docs/9.2/interactive/sql-createfunction.html

>
> ChrisA
>
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-12-21 22:37:00 Re: UNION and pg_restore
Previous Message Chris Angelico 2012-12-21 22:22:59 Re: Coalesce bug ?