Re: [v9.3] writable foreign tables

From: Thom Brown <thom(at)linux(dot)com>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>, Daniel Farina <daniel(at)heroku(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [v9.3] writable foreign tables
Date: 2013-03-11 19:07:14
Message-ID: CAA-aLv5vn9YVLFRdcTC6_=PhFwBGWahewKHaOSf-iA7FPGeXbw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11 March 2013 19:00, Greg Stark <stark(at)mit(dot)edu> wrote:
> On Sun, Mar 10, 2013 at 10:01 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Another thing that would be easy to implement is to say that the new row
>> value is fully determined locally (including defaults if any) and remote
>> defaults have nothing to do with it. But I think that's almost
>> certainly a usability fail --- imagine that the remote has a
>> sequence-generated primary key, for instance. I think it's probably
>> necessary to permit remote insertion of defaults for that sort of table
>> definition to work conveniently.
>
> It feels a bit like unpredictable magic to have "DEFAULT" mean one
> thing and omitted columns mean something else. Perhaps we should have
> an explicit LOCAL DEFAULT and REMOTE DEFAULT and then have DEFAULT and
> omitted columns both mean the same thing.
>
> This starts getting a bit weird if you start to ask what happens when
> the remote table is itself an FDW though....

We could have something like:

CREATE FOREIGN TABLE ...
... OPTION (default <locality>);

where <locality> is 'local' or 'remote'. But then this means it still
can't be specified in individual queries, or have a different locality
between columns on the same foreign table.

--
Thom

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2013-03-11 19:13:10 Re: Using indexes for partial index builds
Previous Message Tom Lane 2013-03-11 19:06:54 Re: [v9.3] writable foreign tables