Re: Passing fdw_private data from PlanForeignScan to PlanForeignModify - Mailing list pgsql-hackers

From Bernd Helmle
Subject Re: Passing fdw_private data from PlanForeignScan to PlanForeignModify
Date
Msg-id 2EC3C2B1067A1C975C7BEF9F@apophis.credativ.lan
Whole thread Raw
In response to Re: Passing fdw_private data from PlanForeignScan to PlanForeignModify  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

--On 13. Juni 2013 18:12:05 -0400 Tom Lane <tgl@sss.pgh.pa.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




pgsql-hackers by date:

Previous
From: Jon Nelson
Date:
Subject: Re: fallocate / posix_fallocate for new WAL file creation (etc...)
Next
From: jasmine
Date:
Subject: Re: Randomisation for ensuring nlogn complexity in quicksort