Accessing parameters of a prepared query inside an FDW

Поиск
Список
Период
Сортировка
От Adam Fletcher
Тема Accessing parameters of a prepared query inside an FDW
Дата
Msg-id CAMfJBeBsF2=Q0wdnixRJ4Rm35moJPc3Cbq=SU_wLJn9ifbV6Vw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Accessing parameters of a prepared query inside an FDW
Список pgsql-general
Hi Folks,

Is it possible to get the parameterized prepared query inside an FDW such that it can be prepared/bind'd/execute'd on the receiving end of the FDW?

For example, if I `PREPARE stmt(int) AS SELECT * from fdwrapped_tbl where pk = $1;` then `execute stmt(1);` I want my FDW be aware that the query was prepared.

Right now, if given the above, and I walk through the postgres_fdw code and output the parse tree from root->parse->query (the PlannerInfo node), I see no PARAM nodes - inside the OPEXPR is just the VAR & CONST (in this case, the CONST is 1). Note that if I call ereport() I do see the correct prepared statement (eg, with the $1) in the output (as debug_query_string has that statement in it). 

I cannot find an example of an FDW that supports passing on prepared statements.  Any help appreciated!

-Adam

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

Предыдущее
От: Hannes Erven
Дата:
Сообщение: RowLock and multiple transactions
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Accessing parameters of a prepared query inside an FDW