Markus Bertheau <twanger@bluetwanger.de> writes:
> shouldn't it be illegal for an immutable function to call a stable one?
No, because that's the standard hack for getting around it when you wish
to call a stable function in what you know to be a "safe" way. If you
look in the archives you'll find cases where creating an immutable
wrapper function was the recommended solution to performance problems.
regards, tom lane