Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YgFGh-0004Ps-LF for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Apr 2015 16:25:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YgFGg-0005DM-S8 for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Apr 2015 16:25:26 +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 1Yg2Rx-0004uF-SQ for pgsql-bugs@postgresql.org; Thu, 09 Apr 2015 02:44:13 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yg2Rn-00059s-6c for pgsql-bugs@postgresql.org; Thu, 09 Apr 2015 02:44:11 +0000 MIME-Version: 1.0 Subject: BUG #13004: PostgreSQL 9.5 policy for table bug? To: pgsql-bugs@postgresql.org From: digoal@126.com Date: Thu, 09 Apr 2015 02:43:55 +0000 Message-ID: <20150409024355.26380.72252@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) 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: 13004 Logged by: digoal Email address: digoal@126.com PostgreSQL version: Unsupported/Unknown Operating system: CentOS 6 Description: postgres=# \d test Table "public.test" Column | Type | Modifiers --------+---------+----------- id | integer | r | name | Policies: POLICY "p4" FOR UPDATE TO r3 USING (r = "current_user"()) postgres=# \c postgres r3 You are now connected to database "postgres" as user "r3". postgres=> update test set id=4 where r='r3'; UPDATE 1 There is no policy for r3's select command , why cann't see rows? postgres=> select * from test; id | r ----+--- (0 rows) postgres=# create policy p1 on test for select to r3 using ( r = current_user); CREATE POLICY postgres=# \d+ test Table "public.test" Column | Type | Modifiers | Storage | Stats target | Description --------+---------+-----------+---------+--------------+------------- id | integer | | plain | | r | name | | plain | | Policies: POLICY "p1" FOR SELECT TO r3 USING (r = "current_user"()) POLICY "p4" FOR UPDATE TO r3 USING (r = "current_user"()) postgres=# \c postgres r3 You are now connected to database "postgres" as user "r3". postgres=> select * from test; id | r ----+---- 4 | r3 (1 row) There is no policy for r3's delete command , why cann't delete? postgres=> delete from test ; DELETE 0 another nonsuper role , and not owner: postgres=> \c postgres r1 You are now connected to database "postgres" as user "r1". postgres=# select * from test; id | r ----+---- 1 | r1 2 | r2 4 | r1 4 | r2 4 | r1 4 | r2 4 | r1 4 | r3 (8 rows) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs