Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yi4gP-0002oS-5d for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2015 17:31:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yi4gO-0004rN-H0 for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2015 17:31:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yi4gN-0004rE-Gp for pgsql-hackers@postgresql.org; Tue, 14 Apr 2015 17:31:31 +0000 Received: from mail-by2on0686.outbound.protection.outlook.com ([2a01:111:f400:fc0c::686] helo=na01-by2-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yi4gI-0005m6-HH for pgsql-hackers@postgresql.org; Tue, 14 Apr 2015 17:31:29 +0000 Authentication-Results: postgresql.org; dkim=none (message not signed) header.d=none; Received: from decina.attlocal.net (2602:306:ce8b:3460:592f:e09d:12a2:4b02) by SN1PR11MB0687.namprd11.prod.outlook.com (25.163.207.145) with Microsoft SMTP Server (TLS) id 15.1.136.25; Tue, 14 Apr 2015 17:31:17 +0000 Message-ID: <552D4EE3.3060708@BlueTreble.com> Date: Tue, 14 Apr 2015 12:31:15 -0500 From: Jim Nasby User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Etsuro Fujita , Tom Lane CC: Ashutosh Bapat , Kyotaro HORIGUCHI , Heikki Linnakangas , Noah Misch , Shigeru Hanada , pgsql-hackers Subject: Re: inherit support for foreign tables References: <543D0261.6020803@lab.ntt.co.jp> <54461BEB.9000707@lab.ntt.co.jp> <5449EE98.1040704@lab.ntt.co.jp> <20141107.145713.169337282.horiguchi.kyotaro@lab.ntt.co.jp> <545CB4A2.1030303@lab.ntt.co.jp> <54645499.7050709@lab.ntt.co.jp> <5476FB4B.9060705@lab.ntt.co.jp> <5487BB9D.7070605@lab.ntt.co.jp> <30555.1418853840@sss.pgh.pa.us> <5497FE79.7090804@lab.ntt.co.jp> <19367.1419262577@sss.pgh.pa.us> <54B76DD2.1040106@lab.ntt.co.jp> <54E6DB4E.40801@lab.ntt.co.jp> <21104.1427047056@sss.pgh.pa.us> <552CF0B6.8010006@lab.ntt.co.jp> In-Reply-To: <552CF0B6.8010006@lab.ntt.co.jp> Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Originating-IP: [2602:306:ce8b:3460:592f:e09d:12a2:4b02] X-ClientProxiedBy: BN3PR0301CA0037.namprd03.prod.outlook.com (25.160.180.175) To SN1PR11MB0687.namprd11.prod.outlook.com (25.163.207.145) X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR11MB0687; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(377454003)(479174004)(51704005)(43234003)(15975445007)(33656002)(42186005)(53416004)(36756003)(64126003)(87976001)(2950100001)(86362001)(120846001)(62966003)(77156002)(47776003)(4001350100001)(59896002)(54356999)(65806001)(50466002)(92566002)(50986999)(65816999)(87266999)(46102003)(19580395003)(93886004)(76176999)(23736002)(4001410100001)(122386002)(65956001)(5890100001)(40100003)(83506001)(3826002)(85282002)(336755003)(18886065003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR11MB0687; H:decina.attlocal.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002010); SRVR:SN1PR11MB0687; BCL:0; PCL:0; RULEID:; SRVR:SN1PR11MB0687; X-Forefront-PRVS: 054642504A X-OriginatorOrg: bluetreble.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2015 17:31:17.2837 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR11MB0687 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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. What happens when the foreign side breaks the inheritance? Does the FDW somehow know to check that fact for each query? What do you gain from having the local table have inheritance? Basically, I think we have to be very careful about implementing features that imply the local side knows something about the persisted state of the remote side (in this case, whether there's inheritance). Anything like that sets us up for synchronization problems. -- Jim Nasby, Data Architect, Blue Treble Consulting Data in Trouble? Get it in Treble! http://BlueTreble.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers