Desmond Coertzen <patrolliekaptein@gmail.com> writes:
> I was under the impression that postgres will not allow me to declare a
> function immutable if it falls outside of the bounds of the definition.
IIRC, there was an explicit decision not to throw errors for "immutable
function reads a table", because we have no way to be sure that such a
thing might not be safe in practice in a particular usage. (That is,
you actually don't ever change the table's contents after first use of
the function.) But yeah, it's a gray area.
regards, tom lane