Re: inherit support for foreign tables - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: inherit support for foreign tables
Date
Msg-id 552F2A8F.2090406@lab.ntt.co.jp
Whole thread Raw
In response to Re: inherit support for foreign tables  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: inherit support for foreign tables
List pgsql-hackers
On 2015/04/15 3:52, Alvaro Herrera wrote:
>> On 4/14/15 5:49 AM, Etsuro Fujita wrote:
>>> postgres=# create foreign table ft1 (c1 int) server myserver options
>>> (table_name 't1');
>>> CREATE FOREIGN TABLE
>>> postgres=# create foreign table ft2 (c1 int) server myserver options
>>> (table_name 't2');
>>> CREATE FOREIGN TABLE
>>> postgres=# alter foreign table ft2 inherit ft1;
>>> ALTER FOREIGN TABLE
>>> postgres=# select * from ft1 for update;
>>> ERROR:  could not find junk tableoid1 column
>>>
>>> I think this is a bug.  Attached is a patch fixing this issue.

> I think the real question is whether we're now (I mean after this patch)
> emitting useless tableoid columns that we didn't previously have.  I
> think the answer is yes, and if so I think we need a smaller comb to fix
> the problem.  This one seems rather large.

My answer for that would be *no* because I think tableoid would be 
needed for EvalPlanQual checking in more complex SELECT FOR UPDATE on 
the inheritance or UPDATE/DELETE involving the inheritance as a source 
table.  Also, if we allow the FDW to change the behavior of SELECT FOR 
UPDATE so as to match the local semantics exactly, which I'm working on 
in another thread, I think tableoid would also be needed for the actual 
row locking.

Best regards,
Etsuro Fujita



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: PATCH: default_index_tablespace
Next
From: Amit Kapila
Date:
Subject: Re: PATCH: default_index_tablespace