"Chris Ochs" <chris(at)paymentonline(dot)com> writes:
> Ok this probably isn't a bug but a side affect of how functions are cached.
> Changing the function to use EXECUTE to perform the query works. I don't
> know if this particular scenario was ever even though of before, or if in
> the future it would make sense to have the query planner not cache the
> session user/current user?
It doesn't cache that. I'm not sure what's going on here ... could you
provide a self-contained test script?
regards, tom lane