Craig Ringer <craig@2ndquadrant.com> writes:
> - Add an attribute to portals that stores the user ID at the time the
> portal was planned. Possibly extensibly; I'd be surprised if we won't
> need to associate other local info with a portal later.
This bit seems rather confused. A portal is a runnable query; we
do not support replanning midstream, and I don't think we support
changes of UID either.
I agree that the plan cache needs to support treating change of UID
as a reason to discard a cached plan, but that's nothing to do with
portals.
regards, tom lane