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

From Dmitry Chichkov
Subject How to get value of 'Param' of the WHERE clause in the FDW?
Date
Msg-id CADeuJh4Z2a15L0W0dLSHAid+7aMfcwq33vcE9_-bmm9Cpvnx-A@mail.gmail.com
Whole thread Raw
Responses Re: How to get value of 'Param' of the WHERE clause in the FDW?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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 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 the planning stage, right?   And I don't see how can I get baserestrictinfo in the execution stage or if the 'abc123' value would be there...

Can somebody kick me to the right direction?  Please?

Thanks,
Dmitry

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: upcoming infrastructure changes/OS upgrades on *.postgresql.org
Next
From: Fabien COELHO
Date:
Subject: Re: Doubt in pgbench TPS number