Re: [HACKERS] How to get value of 'Param' of the WHERE clause in the FDW?

2015-09-25 Thread Dmitry Chichkov
Evaluate via ExecEvalExpr, right? And sorry for a beginner question, what do I need to do to get that Expr from ForeignScanState?Is it accessible at all in old 9.1 API? I see code that is getting exec_exprs from ForeignScan *node: ForeignScan *fsplan = (ForeignScan *)node->ss.ps.plan;

Re: [HACKERS] How to get value of 'Param' of the WHERE clause in the FDW?

2015-09-25 Thread Dmitry Chichkov
AM, Tom Lane wrote: > Dmitry Chichkov writes: > > It seems like during fdwPlan(..., RelOptInfo *baserel) stage I'm getting > > baserel->baserestrictinfo, in which I see a Node *x of IsA(x, Param). > > But it looks like the value 'abc123' is not yet available in

[HACKERS] How to get value of 'Param' of the WHERE clause in the FDW?

2015-09-25 Thread Dmitry Chichkov
Please help I'm doing a following query to a foreign wrapper: FUNCTION fwcall(text) SELECT * FROM fwtable WHERE col=$1 ; ... SELECT * from fdwcall('abc123'); I'm looking for a way to get that parameter 'abc123' value in the FDW wrapper code... It seems like during fdwPl