Skip site navigation (1) Skip section navigation (2)

Re: FDW for PostgreSQL

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>,Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>,Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>,PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: FDW for PostgreSQL
Date: 2013-03-28 15:24:42
Message-ID: 20130328152442.GS4361@tamriel.snowman.net (view raw or flat)
Thread:
Lists: pgsql-hackers
* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> TBH I think this is a fairly bad idea.  You can get that behavior via
> dblink if you need it, 

While I appreciate that dblink can do it, I simply don't see it as a
good solution to this.

> but there's no way to do it in an FDW without
> ending up with astonishing (and not in a good way) semantics.  A commit
> would force committal of everything that'd been done through that
> connection, regardless of transaction/subtransaction structure up to
> that point; and it would also destroy open cursors.  The only way to
> make this sane at all would be to provide user control of which
> operations go to which connections; which is inherent in dblink's API
> but is simply not a concept in the FDW universe.  And I don't want to
> try to plaster it on, either.

This concern would make a lot more sense to me if we were sharing a
given FDW connection between multiple client backends/sessions; I admit
that I've not looked through the code but the documentation seems to
imply that we create one-or-more FDW connection per backend session and
there's no sharing going on.

A single backend will be operating in a linear fashion through the
commands sent to it.  As such, I'm not sure that it's quite as bad as it
may seem.

Perhaps a reasonable compromise would be to have a SERVER option which
is along the lines of 'autocommit', where a user could request that any
query to this server is automatically committed independent of the
client transaction.  I'd be happier if we could allow the user to
control it, but this would at least allow for 'log tables', which are
defined using this server definition, where long-running pl/pgsql code
could log progress where other connections could see it.

	Thanks,

		Stephen

In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2013-03-28 15:48:59
Subject: Changing recovery.conf parameters into GUCs
Previous:From: Tom LaneDate: 2013-03-28 15:09:36
Subject: Re: Catching resource leaks during WAL replay

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group