Re: How to get value of 'Param' of the WHERE clause in the FDW? - Mailing list pgsql-hackers

From Dmitry Chichkov
Subject Re: How to get value of 'Param' of the WHERE clause in the FDW?
Date
Msg-id CADeuJh7FNybFVQCZpBTjSQ2pwnR28D_1=47C9aeqtDVxSowUXg@mail.gmail.com
Whole thread
In response to Re: How to get value of 'Param' of the WHERE clause in the FDW?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: How to get value of 'Param' of the WHERE clause in the FDW?
List pgsql-hackers
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;   
  List *exec_exprs = (List *)ExecInitExpr((Expr *)fsplan->fdw_exprs, (PlanState *)node);
 
  then it goes through the list, initializes paramDesc/ExprState and executes it via ExecEvalExpr.   Is that what I should do to get that 'abc123' value?   

And I'm getting  "‘ForeignScan’ has no member named ‘fdw_exprs’" in the 9.1 API.  Is it possible to do in 9.1?


....

Is there some alternative way to flatten these subexpressions into consts, before they are passed to FDW?

Kind Regards,
Dmitry





On Fri, Sep 25, 2015 at 11:54 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
ith that, and certainly
a Param should not be a special case in any w


pgsql-hackers by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: No Issue Tracker - Say it Ain't So!
Next
From: Tom Lane
Date:
Subject: Re: How to get value of 'Param' of the WHERE clause in the FDW?