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

From: Dmitry Chichkov <dchichkov(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: How to get value of 'Param' of the WHERE clause in the FDW?
Date: 2015-09-25 18:33:18
Message-ID: CADeuJh4Z2a15L0W0dLSHAid+7aMfcwq33vcE9_-bmm9Cpvnx-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2015-09-25 18:35:45 Re: Doubt in pgbench TPS number
Previous Message Tom Lane 2015-09-25 18:30:58 Re: upcoming infrastructure changes/OS upgrades on *.postgresql.org