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

Reply via email to