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

From: Dmitry Chichkov <dchichkov(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to get value of 'Param' of the WHERE clause in the FDW?
Date: 2015-09-25 19:58:37
Message-ID: CADeuJh7FNybFVQCZpBTjSQ2pwnR28D_1=47C9aeqtDVxSowUXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> ith that, and certainly
> a Param should not be a special case in any w
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-09-25 20:51:01 Re: How to get value of 'Param' of the WHERE clause in the FDW?
Previous Message Merlin Moncure 2015-09-25 19:31:08 Re: No Issue Tracker - Say it Ain't So!