Even checking whether the output of the function is in the right order or not, has its cost. I am suggesting that we can eliminate this cost as well. For example, PostgreSQL does not check whether a function is really immutable or not.
I imagine if it could be done reliably and cheaply the volatility specifier would be checked. There are a number of situations where not doing so confuses users and we get complaints. If we allow a constraint to be specified we should try to error if that constraint is violated - otherwise we probably should not allow it to be defined in the first place.
David J.
View this message in context:
Re: [HACKERS] Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs Sent from the
PostgreSQL - hackers mailing list archive at Nabble.com.