Re: Passing fdw_private data from PlanForeignScan to PlanForeignModify

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Passing fdw_private data from PlanForeignScan to PlanForeignModify
Дата
Msg-id 22682.1371135991@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Passing fdw_private data from PlanForeignScan to PlanForeignModify  (Bernd Helmle <mailings@oopsware.de>)
Ответы Re: Passing fdw_private data from PlanForeignScan to PlanForeignModify  (Bernd Helmle <mailings@oopsware.de>)
Список pgsql-hackers
Bernd Helmle <mailings@oopsware.de> writes:
> During the planning phase, the Informix FDW currently plans a server side 
> cursor, which identifier i'd like to pass into the planning phase of the 
> modify action to reuse it in conjunction with UPDATE ... WHERE CURRENT OF.

> I understand that the ModifyTable structure passed to PlanForeignModify has 
> a list of associated plan nodes, from which i can access the ForeignScan 
> plan node associated with the current modify action, thus having access to 
> the fdw_private data generated during the planning phase of the ForeigScan 
> node. However, it's a list and i currently don't understand on how to 
> reference the associated ForeignScan node reliably, given that there are 
> cases with more than one node in this list.

The subplan_index argument to PlanForeignModify is the list index to
use, unless I'm misunderstanding something about this.  However, in join
cases the ForeignScan node will be buried down inside a join nest, so
locating it in the plan tree could be rather difficult.  My
recommendation would be to see if you can't save the relevant info in
the RelOptInfo node for the relation, probably during GetForeignPlan,
and then get it from there in PlanForeignModify instead of digging in
the plan tree.  (You can use the fdw_private field of RelOptInfo for
whatever you need in this line.)
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)