Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aYge2-0003P2-JH for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Feb 2016 21:06:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aYge1-0002Yt-LP for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Feb 2016 21:06:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aYgdO-0001qb-07 for pgsql-bugs@postgresql.org; Wed, 24 Feb 2016 21:06:10 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aYgdH-0004Rl-1V for pgsql-bugs@postgresql.org; Wed, 24 Feb 2016 21:06:09 +0000 MIME-Version: 1.0 Subject: BUG #13988: "plan should not reference subplan's variable" whilst using row level security To: pgsql-bugs@postgresql.org From: asguthrie@gmail.com Date: Wed, 24 Feb 2016 21:05:07 +0000 Message-ID: <20160224210507.2568.85774@wrigleys.postgresql.org> X-Pg-Spam-Score: -0.3 (/) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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: 13988 Logged by: Adam Guthrie Email address: asguthrie@gmail.com PostgreSQL version: 9.5.1 Operating system: OS X 10.11 Description: The following sql: **** CREATE TABLE a ( id INTEGER PRIMARY KEY ); CREATE TABLE b ( id INTEGER PRIMARY KEY, a_id INTEGER, text TEXT ); CREATE POLICY a_select ON b FOR SELECT USING ( EXISTS(SELECT FROM a WHERE a.id = b.a_id) ); ALTER TABLE b ENABLE ROW LEVEL SECURITY; INSERT INTO a (id) VALUES (1); INSERT INTO b (id, a_id, text) VALUES (1, 1, 'one'); CREATE ROLE test; GRANT ALL ON ALL TABLES IN SCHEMA public TO test; SET ROLE test; SELECT * FROM b; UPDATE b SET text = 'ONE' WHERE id = 1; **** gives: psql:/tmp/plan.sql:25: ERROR: XX000: plan should not reference subplan's variable LOCATION: finalize_plan, subselect.c:2624 whereas I believe it should give: UPDATE 0 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs