Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W7zy4-0003ot-Uj for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Jan 2014 04:08:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W7zy4-0005nx-5p for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Jan 2014 04:08:08 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W7zy2-0005nn-5r for pgsql-hackers@postgresql.org; Tue, 28 Jan 2014 04:08:06 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W7zxy-0001ls-5p for pgsql-hackers@postgresql.org; Tue, 28 Jan 2014 04:08:05 +0000 Received: from mfs6.rdh.ecl.ntt.co.jp (mfs6.rdh.ecl.ntt.co.jp [129.60.39.149]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id s0S47uLV010530; Tue, 28 Jan 2014 13:07:56 +0900 Received: from mfs6.rdh.ecl.ntt.co.jp (localhost.localdomain [127.0.0.1]) by mfs6.rdh.ecl.ntt.co.jp (Postfix) with ESMTP id 267FCE0141; Tue, 28 Jan 2014 13:07:56 +0900 (JST) Received: from imail3.m.ecl.ntt.co.jp (imail3.m.ecl.ntt.co.jp [129.60.5.248]) by mfs6.rdh.ecl.ntt.co.jp (Postfix) with ESMTP id 1A939E013F; Tue, 28 Jan 2014 13:07:56 +0900 (JST) Received: from [129.60.241.236] ([129.60.241.236]) by imail3.m.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id s0S47taY006222; Tue, 28 Jan 2014 13:07:56 +0900 Message-ID: <52E72D1A.7020709@lab.ntt.co.jp> Date: Tue, 28 Jan 2014 13:07:54 +0900 From: Etsuro Fujita User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Atri Sharma , David Fetter CC: "pgsql-hackers@postgresql.org" Subject: Re: inherit support for foreign tables References: <12432.1384406906@sss.pgh.pa.us> <10163.1384786524@sss.pgh.pa.us> <52DDD071.9090405@ak.jp.nec.com> <52E5F3FD.6050000@lab.ntt.co.jp> <52E6137B.1080704@lab.ntt.co.jp> <20140127153322.GB11668@fetter.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: No X-Pg-Spam-Score: -2.4 (--) 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 (2014/01/28 0:55), Atri Sharma wrote: >> On 27-Jan-2014, at 21:03, David Fetter wrote: >>> On Mon, Jan 27, 2014 at 05:06:19PM +0900, Etsuro Fujita wrote: >>> Hi Hanada-san, >>> >>> While still reviwing this patch, I feel this patch has given enough >>> consideration to interactions with other commands, but found the >>> following incorrect? behabior: >>> >>> postgres=# CREATE TABLE product (id INTEGER, description TEXT); >>> CREATE TABLE >>> postgres=# CREATE FOREIGN TABLE product1 () INHERITS (product) >>> SERVER fs OPTIONS (filename '/home/foo/product1.csv', format 'csv'); >>> CREATE FOREIGN TABLE >>> postgres=# ALTER TABLE product ALTER COLUMN description SET STORAGE >>> EXTERNAL; >>> ERROR: "product1" is not a table or materialized view >>> >>> ISTN the ALTER TABLE simple recursion mechanism (ie >>> ATSimpleRecursion()) should be modified for the ALTER COLUMN SET >>> STORAGE case. >> >> This points to a larger discussion about what precisely foreign tables >> can and cannot inherit from local ones. I don't think that a generic >> solution will be satisfactory, as the PostgreSQL FDW could, at least >> in principle, support many more than the CSV FDW, as shown above. >> >> In my estimation, the outcome of discussion above is not a blocker for >> this I just thought that among the structures that local tables can alter, the ones that foreign tables also can by ALTER FOREIGN TABLE are inherited, and the others are not inherited. So for the case as shown above, I thought that we silently ignore executing the ALTER COLUMN SET STORAGE command for the foreign table. I wonder that would be the first step. > I wonder what shall be the cases when foreign table is on a server which does not support *all* SQL features. > > Does a FDW need to have the possible inherit options mentioned in its documentation for this patch? The answer is no, in my understanding. The altering operation simply declares some chages for foreign tables in the inheritance tree and does nothing to the underlying storages. Thanks, Best regards, Etsuro Fujita -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers