Re: Passing fdw_private data from PlanForeignScan to PlanForeignModify

From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Passing fdw_private data from PlanForeignScan to PlanForeignModify
Date: 2013-07-01 15:34:24
Message-ID: 2EC3C2B1067A1C975C7BEF9F@apophis.credativ.lan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

--On 13. Juni 2013 18:12:05 -0400 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

>> What i tried before was to access (in PlanForeignModify) the RelOptInfo
>> structure through PlannerInfo->simple_rel_array, assuming the the
>> resultRelation index points to the right array member. However, that
>> didn't work, the fdw_private List is not the one filled by
>> GetForeignPlan...is there another way to get back the RelOptInfo worked
>> on earlier?
>
> It should work ... *if* there was in fact a RelOptInfo worked on
> earlier. There sometimes isn't. You might need to do something like
> what make_modifytable() has to do to call you in the first place:

Sorry for the late feedback, didn't manage to get back to this earlier.

This works indeed, the RelOptInfo structure stored in simple_rel_array (if
present) allows
a FDW to access its earlier scan state, assigned in GetForeignPlan() for
example.

Thanks for the hints!

--

Bernd

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2013-07-01 16:30:38 Re: FILTER for aggregates [was Re: Department of Redundancy Department: makeNode(FuncCall) division]
Previous Message Jon Nelson 2013-07-01 15:24:44 Re: fallocate / posix_fallocate for new WAL file creation (etc...)