Re: postgres_fdw : Not able to update foreign table referring to a local table's view when use_remote_estimate = true

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
Cc: Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: postgres_fdw : Not able to update foreign table referring to a local table's view when use_remote_estimate = true
Date: 2016-04-26 12:50:30
Message-ID: 571F6416.9080908@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016/04/26 12:52, Robert Haas wrote:
> On Mon, Apr 25, 2016 at 2:54 AM, Ashutosh Bapat
> <ashutosh(dot)bapat(at)enterprisedb(dot)com> wrote:
>> Thinking loudly:
>>
>> This error is hard to interpret for a user who doesn't know about ctid. Till
>> we find a solution, we can at least fail gracefully with an error something
>> like "DMLs are not supported on foreign tables referring to views/non-tables
>> on foreign server" is not supported. While creating the foreign table a user
>> can specify whether the object being referred is updatable (writable?) or
>> not, Import foreign schema can set the status by looking at pg_class type
>> entry. The efforts required may not be worth the usage given that this case
>> is highly unlikely. May be we should just update the documents saying that a
>> user may encounter such an error if s/he attempts to update/delete such a
>> foreign table.

> I would be disinclined to add code specifically to catch this, since
> the only report we have so far is from someone whose job is to find
> corner cases that break. Which he did, and good for him, but like you
> say, that doesn't mean it's a big real-world problem. Adding a
> sentence to the documentation stating that pointing a foreign table at
> a view is fine for SELECT, but that UPDATE and DELETE may not work,
> seems like enough.

+1 for just updating the documentation.

Best regards,
Etsuro Fujita

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christian Ullrich 2016-04-26 13:09:42 Parallel build with MSVC
Previous Message Etsuro Fujita 2016-04-26 12:45:59 Re: Optimization for updating foreign tables in Postgres FDW