FDW state from plan time - Mailing list pgsql-hackers

From Dave Page
Subject FDW state from plan time
Date
Msg-id AANLkTi=sXHSw1QkftkRtQ6CC4ymoy=VfL-L8PbPA2OBA@mail.gmail.com
Whole thread Raw
Responses Re: FDW state from plan time  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

I can't help thinking I must be missing something obvious here, but is
there any way to persist some data from PlanForeignScan to at least
BeginForeignScan in an FDW? I'm aware of fdwplan->fdw_private, but at
that needs to be copyObject compatible, it's not much use to me.

The issue I have is that in order to properly plan my remote scan, I
need to connect to the remote database to try to calculate some stats
for the query. I'm currently then disconnecting and freeing all the
data associated with that connection, and then reconnecting again in
BeginForeignScan in order to do the actual work. I'd like to avoid the
connect/reconnect, as we all know they can be expensive!

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Dan Ports
Date:
Subject: Re: SSI bug?
Next
From: Peter Eisentraut
Date:
Subject: Re: Should psql support URI syntax?