Greg Stark <gsstark(at)mit(dot)edu> writes:
> We could add another flag in pg_proc for functions which cannot throw
> an error. Perhaps all index operator class operators be required to
> use such functions too?
It would be an extremely small set. For starters, anything that returns
a pass-by-reference data type would be out automatically --- the palloc
to return the result could hit out-of-memory.
Now maybe we could define the flag as meaning "if this does throw an
error it's okay for the calling query to fail too", which I think is
reasonable for out-of-memory type errors. But it's getting pretty
squishy at that point, and I think we'd have a lot of problems with
mislabeled functions.
regards, tom lane