Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VgpTp-0003KP-HW for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Nov 2013 05:28:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VgpTo-0004xE-Mm for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Nov 2013 05:28:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VgpTm-0004x3-DF for pgsql-hackers@postgresql.org; Thu, 14 Nov 2013 05:28:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VgpTg-0004C4-At for pgsql-hackers@postgresql.org; Thu, 14 Nov 2013 05:28:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id rAE5SQ3f012433; Thu, 14 Nov 2013 00:28:26 -0500 From: Tom Lane To: Shigeru Hanada cc: PostgreSQL-development Subject: Re: inherit support for foreign tables In-reply-to: References: Comments: In-reply-to Shigeru Hanada message dated "Thu, 14 Nov 2013 13:51:40 +0900" Date: Thu, 14 Nov 2013 00:28:26 -0500 Message-ID: <12432.1384406906@sss.pgh.pa.us> 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 Shigeru Hanada writes: > I'd like to propose adding inheritance support for foriegn tables. > David Fetter mentioned this feature last July, but it seems stalled. > http://www.postgresql.org/message-id/20130719005601.GA5760@fetter.org The discussion there pointed out that not enough consideration had been given to interactions with other commands. I'm not really satisfied with your analysis here. In particular: > 2) Allow foreign tables to have CHECK constraints > Like NOT NULL, I think we don't need to enforce the check duroing > INSERT/UPDATE against foreign table. Really? It's one thing to say that somebody who adds a CHECK constraint to a foreign table is responsible to make sure that the foreign data will satisfy the constraint. It feels like a different thing to say that ALTER TABLE ADD CONSTRAINT applied to a parent table will silently assume that some child table that happens to be foreign doesn't need any enforcement. Perhaps more to the point, inheritance trees are the main place where the planner depends on the assumption that CHECK constraints represent reality. Are we really prepared to say that it's the user's fault if the planner generates an incorrect plan on the strength of a CHECK constraint that's not actually satisfied by the foreign data? If so, that had better be documented by this patch. But for a project that refuses to let people create a local CHECK or FOREIGN KEY constraint without mechanically checking it, it seems pretty darn weird to be so laissez-faire about constraints on foreign data. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers