Re: Bug? Function with side effects not evaluated in CTE - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Bug? Function with side effects not evaluated in CTE
Date
Msg-id CAHyXU0zGADVOVG0GFNpgDXPGsZ2g__tzdAf4X9n580DGGKHAHw@mail.gmail.com
Whole thread Raw
In response to Re: Bug? Function with side effects not evaluated in CTE  (David Johnston <polobo@yahoo.com>)
Responses Re: Bug? Function with side effects not evaluated in CTE  (David Johnston <polobo@yahoo.com>)
List pgsql-general
On Fri, Oct 18, 2013 at 8:37 PM, David Johnston <polobo@yahoo.com> wrote:
> Merlin Moncure-2 wrote
>> Regardless, the point at hand is whether specific plan semantics down
>> the chain can control whether or not volatile expressions should run.
>> Clearly, at least to me, they should not.
>
> Put differently ideally this should be put either on the todo list or the
> "we do not want" list and further inquiries can then go to building up
> enough popular demand to convince someone to implement it.  Maybe there
> should be a "convince us" list? Not a todo yet but something still be
> considered.

I would vote it as todo.

> Keeping in mind that there are likely volatile queries relying on the
> current optimization that would become non-optimized and possibly very
> poorly performing.  Since the "fix" for these would be a simple alter
> function to make them stable the cost benefit seems worthwhile - since those
> functions are probably mis-identified in the first place due to the use of
> the default.

Any reliance on that behavior would be wrong because it's expressly
contraindicated by the documentation.  TBH, If it were not
specifically documented that way, I would be considering this to be
bugged behavior.  As for function mis-identification, fair point, but
that's a general problem and not specifically related to CTE
evaluation.

merlin


pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: [HACKERS] Who is pgFoundery administrator?
Next
From: ramistuni
Date:
Subject: Upgrade from 9.1 to 9.10