rikard(at)ngs(dot)hr writes:
> Is this expected behavior?
You haven't provided nearly enough information to let anyone diagnose
this with certainty; but if the data is changing under you, then replacing
a volatile function with a stable one could certainly cause different
results, because the data visibility rules would be different. See
https://www.postgresql.org/docs/9.3/static/xfunc-volatility.html
particularly the bit about volatile functions using a new snapshot
on each call.
regards, tom lane