Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U4Yez-0001nQ-9I for pgsql-bugs@arkaria.postgresql.org; Sun, 10 Feb 2013 15:17:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U4Yey-0001oh-N1 for pgsql-bugs@arkaria.postgresql.org; Sun, 10 Feb 2013 15:17:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U4Yey-0001oc-7L for pgsql-bugs@postgresql.org; Sun, 10 Feb 2013 15:17:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U4Yew-0002HE-Di for pgsql-bugs@postgresql.org; Sun, 10 Feb 2013 15:17:39 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r1AFHbQK019762; Sun, 10 Feb 2013 10:17:37 -0500 (EST) From: Tom Lane To: tim.romano@yahoo.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7866: even after T's child-tables are deleted it cannot have select-rule In-reply-to: References: Comments: In-reply-to tim.romano@yahoo.com message dated "Sun, 10 Feb 2013 12:27:22 +0000" Date: Sun, 10 Feb 2013 10:17:37 -0500 Message-ID: <19761.1360509457@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-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org tim.romano@yahoo.com writes: > After a table has been inherited, a select-rule cannot be created on it > *even if its child tables are deleted and a vacuum is performed afterwards*. This isn't a bug, it's an intentional implementation restriction. I quote from the source code: * Are we converting a relation to a view? * * If so, check that the relation is empty because the storage for the * relation is going to be deleted. Also insist that the rel not have * any triggers, indexes, or child tables. (Note: these tests are too * strict, because they will reject relations that once had such but * don't anymore. But we don't really care, because this whole * business of converting relations to views is just a kluge to allow * loading ancient pg_dump files.) There is not any expectation that creating a select rule would ever happen to anything except a freshly created table. We'd probably not even support the CREATE RULE syntax for this, except that pg_dump sometimes needs to do it like that to get around circular dependencies involving a view's rowtype. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs