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

Re: FDW for PostgreSQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
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 14:11:07
Message-ID: 26979.1364479867@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Stephen Frost <sfrost(at)snowman(dot)net> writes:
> Apologies for bringing this up pretty late, but wrt writable FDW
> transaction levels, I was *really* hoping that we'd be able to implement
> autonomous transactions on top of writeable FDWs.  It looks like there's
> no way to do this using the postgres_fdw due to it COMMIT'ing only when
> the client transaction commits.  Would it be possible to have a simply
> function which could be called to say "commit the transaction on the
> foreign side for this server/table/connection/whatever"?  A nice
> addition on top of that would be able to define 'auto-commit' for a
> given table or server.

TBH I think this is a fairly bad idea.  You can get that behavior via
dblink if you need it, 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.

			regards, tom lane


In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2013-03-28 14:52:14
Subject: Re: [sepgsql 1/3] add name qualified creation label
Previous:From: Heikki LinnakangasDate: 2013-03-28 13:47:05
Subject: Re: [COMMITTERS] pgsql: Allow external recovery_config_directory

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