Re: Questions and experiences writing a Foreign Data Wrapper

From: David Fetter <david(at)fetter(dot)org>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Questions and experiences writing a Foreign Data Wrapper
Date: 2011-07-21 01:47:53
Message-ID: 20110721014753.GA31073@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 20, 2011 at 08:26:19PM +0300, Heikki Linnakangas wrote:
> On 20.07.2011 18:00, Albe Laurenz wrote:
> >2) If I decide to close remote database connections after
> > use, I would like to do so where reasonable.
> > I would like to keep the connection open between query
> > planning and query execution and close it when the
> > scan is done.
> > The exception could be named prepared statements.
> > Is there a way to tell if that is the case during
> > planing or execution?
>
> Hmm, maybe you could add a hook to close the connection when the
> transaction ends. But actually, you'd want to keep the connection
> open across transactions too. Some sort of a general connection
> caching facility would be useful for many FDW.

For what it's worth, DBI-Link caches FDW handles in perl session
variables. I didn't really consider cross-session handle caching
because the complexity would have been large and the benefit small.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Kupershmidt 2011-07-21 02:39:38 Re: patch: Allow \dd to show constraint comments
Previous Message Robert Haas 2011-07-21 01:46:33 sinval synchronization considered harmful