From: | Chris Angelico <rosuav(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Coalesce bug ? |
Date: | 2012-12-21 16:11:56 |
Message-ID: | CAPTjJmpOS-oOq6pHyxiNb-p_vz0Yz9iLRe6m=WXqoVtEum=UNQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Sat, Dec 22, 2012 at 2:57 AM, jg <jg(at)rilk(dot)com> wrote:
> Hi,
>
> Interesting idea.
> With VOLATILE, the bug disappears.
> With IMMUTABLE, the EXPLAIN and the execution does not match !!!!
> That is a bug. Even if the behavior has to be different in VOLATILE and IMMUTABLE, the EXPLAIN and the execution MUST be coherent.
> JG
Just a word about your wording. Calling this a bug is somewhat poor
form; you're sounding hostile and accusatory, rather than looking to
learn and understand. It might indeed turn out to be a bug, but from
what else has happened in this thread, I'm more inclined to think that
the database is fine and your code is what's not working.
http://www.catb.org/esr/faqs/smart-questions.html#idp29846432
It's almost as if he read this very thread :)
Something to consider: Since you've told Postgres that your function
is immutable, it might be remembering the result from the first
execution and using it in the second. Try restarting the server
between the EXPLAIN and the test.
By the way, why do you declare your functions as "STRICT IMMUTABLE"
and "STRICT VOLATILE"?
ChrisA
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2012-12-21 16:15:53 | Re: Coalesce bug ? |
Previous Message | Tom Lane | 2012-12-21 16:08:11 | Re: Using POSIX Regular Expressions on xml type fields gives inconsistent results |