Vikram Kalsi <vikramkalsi(at)gmail(dot)com> writes:
> So, I suppose that during the query planning and optimization stage,
> the value of the original variables in the plan are somehow copied to
> the plan which is finally returned inside pg_plan_query().
Look in createplan.c --- there are a couple places in there you need to
fix.
regards, tom lane