Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U4WGk-0001kF-6P for pgsql-bugs@arkaria.postgresql.org; Sun, 10 Feb 2013 12:44:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U4WGj-0008KB-IU for pgsql-bugs@arkaria.postgresql.org; Sun, 10 Feb 2013 12:44:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U4W0E-0006y0-U3 for pgsql-bugs@postgresql.org; Sun, 10 Feb 2013 12:27:26 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U4W0D-0008FK-Sg for pgsql-bugs@postgresql.org; Sun, 10 Feb 2013 12:27:26 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U4W0B-0002RZ-Dk for pgsql-bugs@postgresql.org; Sun, 10 Feb 2013 12:27:23 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1U4W0A-0008FF-Ve for pgsql-bugs@postgresql.org; Sun, 10 Feb 2013 12:27:22 +0000 Date: Sun, 10 Feb 2013 12:27:22 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #7866: even after T's child-tables are deleted it cannot have select-rule To: pgsql-bugs@postgresql.org From: tim.romano@yahoo.com X-Pg-Spam-Score: 0.6 (/) 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 The following bug has been logged on the website: Bug reference: 7866 Logged by: Tim Romano Email address: tim.romano@yahoo.com PostgreSQL version: 9.2.2 Operating system: Windows 7 x64 Description:=20=20=20=20=20=20=20=20 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*. =20 Moreover, the select-rule documentation is vague and incomplete. Instead of clear and concise definition, with a few simple examples illuminating a variety of use cases, there is a long, unnecessarily complex, and not very illuminating example. create table RLS3 (tenant varchar(25) not null default current_user); --Query returned successfully with no result in 10 ms. create table customer (id int primary key not null, custname varchar(25) not null ) INHERITS (RLS3); --NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index=20 -- "customer_pkey" for table "customer" =20=20=20=20 CREATE RULE "_RETURN" AS ON SELECT TO RLS3=20 do instead select * from RLS3 where tenant=3Dcurrent_user; --ERROR: could not convert table "rls3" to a view because it has child tables drop table customer; Query returned successfully with no result in 11 ms. =20=20=20 CREATE RULE "_RETURN" AS ON SELECT TO RLS3=20 do instead select * from RLS3 where tenant=3Dcurrent_user; --ERROR: could not convert table "rls3" to a view because it has child tables =20 VACUUM; --Query returned successfully with no result in 91 ms. CREATE RULE "_RETURN" AS ON SELECT TO RLS3=20 do instead select * from RLS3 where tenant=3Dcurrent_user; --ERROR: could not convert table "rls3" to a view because it has child tables --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs