David Rowley <dgrowle...@gmail.com> writes: >> One thing that is currently on my mind is what to do when passing volatile >> functions to the aggregate. Since the number of times we execute a volatile >> function will much depend on the window frame options, I think we should >> include some sort of warning in the documentation that "The number of times >> that the expression is evaluated within the aggregate function when used in >> the context of a WINDOW is undefined". The other option would be to disable >> this optimisation if the aggregate expression contained a volatile >> function, but doing this, to me seems a bit weird as is anyone actually >> going to be depending on a volatile function being executed so many times?
Once again: this patch has no business changing any user-visible behavior. That would include not changing the number of evaluations of volatile functions. The planner is full of places where optimizations are disabled for volatile subexpressions, and I don't see why this should be different. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers