Re: FDW for PostgreSQL

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, 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-02-21 15:25:57
Message-ID: 20130221152553.GB23876@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-02-21 10:21:34 -0500, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > On 2013-02-21 09:58:57 -0500, Tom Lane wrote:
> >> How exactly would it do that via an FDW? Surely if the user tries to
> >> execute INSERT/UPDATE/DELETE against a foreign table, the command would
> >> get rejected in a read-only transaction, long before we even figure out
> >> that the target is a foreign table?
>
> > I was thinking of querying a remote table thats actually a view. Which
> > might be using a function that does caching into a table or something.
> > Not a completely unreasonable design.
>
> Yeah, referencing a remote view is something that should work fine, but
> it's not clear to me why it should work differently than it does on the
> remote server. If you select from that same view in a READ ONLY
> transaction on the remote, won't it fail? If so, why should that work
> if it's selected from via a foreign table?

Sure, it might fail if you use READ ONLY explicitly. Or the code might
check it. The point is that one might not have choice about the READ
ONLY state of the local transaction if its a HS standby as all
transactions are READ ONLY there.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2013-02-21 15:26:06 Re: Materialized views WIP patch
Previous Message Tom Lane 2013-02-21 15:21:34 Re: FDW for PostgreSQL