Re: ATSimpleRecursion() and inheritance foreign parents

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ATSimpleRecursion() and inheritance foreign parents
Date: 2015-04-28 12:39:02
Message-ID: CA+HiwqHQYHwT2tMshks1ZSWp7Vu+7ZU9L42xF4D-YwPAoBZigA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 28, 2015 at 9:28 PM, David Fetter <david(at)fetter(dot)org> wrote:
> On Tue, Apr 28, 2015 at 03:17:08PM +0900, Amit Langote wrote:
>>
>> An example,
>> postgres=# alter foreign table fparent alter a type char;
>> ALTER FOREIGN TABLE
>>
>> postgres=# select * from fparent;
>> ERROR: attribute "a" of relation "fchild1" does not match parent's type
>>
>> Above error, AIUI, is hit much before it is determined that fparent is a
>> foreign table, whereas the following is FDW-specific (waiting to happen) error,
>>
>> postgres=# alter foreign table fparent add b char;
>> ALTER FOREIGN TABLE
>>
>> postgres=# SELECT * FROM fparent;
>> ERROR: column "b" does not exist
>> CONTEXT: Remote SQL command: SELECT a, b FROM public.parent
>
> I'm pretty sure this is a bug. The way I see it, foreign tables can
> either fully participate in table inheritance, or not at all, because
> any inconsistencies here will cause confusion at best.
>

As mentioned by Fujita-san, the first one is definitely a bug (he sent
a patch) but the second one is not quite related to inheritance; that
is, it can happen irrespective of foreign tables participating in
inheritance and is documented.

Thanks,
Amit

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2015-04-28 12:50:28 Re: ATSimpleRecursion() and inheritance foreign parents
Previous Message Robert Haas 2015-04-28 12:38:31 Re: Can pg_dump make use of CURRENT/SESSION_USER