Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yk6xW-0001uD-Ir for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Apr 2015 08:21:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yk6xW-0003Sm-0t for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Apr 2015 08:21:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yk6xT-0003QA-O6 for pgsql-hackers@postgresql.org; Mon, 20 Apr 2015 08:21:35 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yk6xQ-0001wY-Nx for pgsql-hackers@postgresql.org; Mon, 20 Apr 2015 08:21:34 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id t3K8LQJu011319; Mon, 20 Apr 2015 17:21:26 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 052FD5F594; Mon, 20 Apr 2015 17:21:26 +0900 (JST) Received: from imail3.m.ecl.ntt.co.jp (imail3.m.ecl.ntt.co.jp [129.60.5.248]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id E952B5F593; Mon, 20 Apr 2015 17:21:25 +0900 (JST) Received: from [129.60.241.75] ([129.60.241.75]) by imail3.m.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id t3K8LPGa019186; Mon, 20 Apr 2015 17:21:25 +0900 Message-ID: <5534B6DF.5060601@lab.ntt.co.jp> Date: Mon, 20 Apr 2015 17:20:47 +0900 From: Etsuro Fujita User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: 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> <552F5F49.6000105@lab.ntt.co.jp> In-Reply-To: <552F5F49.6000105@lab.ntt.co.jp> Content-Type: multipart/mixed; boundary="------------060408060304060305050507" X-TM-AS-MML: disable X-Pg-Spam-Score: -2.6 (--) 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 This is a multi-part message in MIME format. --------------060408060304060305050507 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit On 2015/04/16 16:05, Etsuro Fujita wrote: > On 2015/03/23 2:57, Tom Lane wrote: >> Etsuro Fujita writes: >>> [ fdw-inh-8.patch ] >> >> I've committed this with some substantial rearrangements, notably: > >> * As I mentioned earlier, I got rid of a few unnecessary restrictions on >> foreign tables so as to avoid introducing warts into inheritance behavior. >> In particular, we now allow NOT VALID CHECK constraints (and hence ALTER >> ... VALIDATE CONSTRAINT), ALTER SET STORAGE, and ALTER SET WITH/WITHOUT >> OIDS. These are probably no-ops anyway for foreign tables, though >> conceivably an FDW might choose to implement some behavior for STORAGE >> or OIDs. > > I agree with you on this point. However, ISTM there is a bug in > handling OIDs on foreign tables; while we now allow for ALTER SET > WITH/WITHOUT OIDS, we still don't allow the default_with_oids parameter > for foreign tables. I think that since CREATE FOREIGN TABLE should be > consistent with ALTER FOREIGN TABLE, we should also allow the parameter > for foreign tables. Attached is a patch for that. I also updated docs. Attached is an updated version of the patch. Best regards, Etsuro Fujita --------------060408060304060305050507 Content-Type: text/x-diff; name="tablecmd-v2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tablecmd-v2.patch" *** a/doc/src/sgml/config.sgml --- b/doc/src/sgml/config.sgml *************** *** 6745,6752 **** dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' ! This controls whether CREATE TABLE and ! CREATE TABLE AS include an OID column in newly-created tables, if neither WITH OIDS nor WITHOUT OIDS is specified. It also determines whether OIDs will be included in tables created by --- 6745,6753 ---- ! This controls whether CREATE TABLE, ! CREATE TABLE AS and ! CREATE FOREIGN TABLE include an OID column in newly-created tables, if neither WITH OIDS nor WITHOUT OIDS is specified. It also determines whether OIDs will be included in tables created by *** a/doc/src/sgml/ref/create_foreign_table.sgml --- b/doc/src/sgml/ref/create_foreign_table.sgml *************** *** 293,298 **** CHECK ( expression ) --- 293,304 ---- responsibility to ensure that the constraint definition matches reality. + + + To add OIDs to the table created by CREATE FOREIGN TABLE, + enable the configuration + variable. + *** a/src/backend/commands/tablecmds.c --- b/src/backend/commands/tablecmds.c *************** *** 580,586 **** DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, descriptor = BuildDescForRelation(schema); localHasOids = interpretOidsOption(stmt->options, ! (relkind == RELKIND_RELATION)); descriptor->tdhasoid = (localHasOids || parentOidCount > 0); /* --- 580,587 ---- descriptor = BuildDescForRelation(schema); localHasOids = interpretOidsOption(stmt->options, ! (relkind == RELKIND_RELATION || ! relkind == RELKIND_FOREIGN_TABLE)); descriptor->tdhasoid = (localHasOids || parentOidCount > 0); /* --------------060408060304060305050507 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------060408060304060305050507--