Skip site navigation (1) Skip section navigation (2)

BUG #5146: After granting all select privelges on view to user, who still can not select the view

From: "xqzhang" <zxq230104(at)163(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5146: After granting all select privelges on view to user, who still can not select the view
Date: 2009-10-29 08:42:47
Message-ID: 200910290842.n9T8gl5N050974@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      5146
Logged by:          xqzhang
Email address:      zxq230104(at)163(dot)com
PostgreSQL version: 8.3.3
Operating system:   linux 32
Description:        After granting all select privelges on view to user, who
still can not select the view
Details: 

Welcome to psql 8.3.3, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

TEST=# CREATE USER u1;
CREATE ROLE
TEST=# CREATE USER u2;
CREATE ROLE
TEST=# CREATE USER u3;
CREATE ROLE
TEST=# CREATE USER u4;
CREATE ROLE
TEST=# SET SESSION AUTHORIZATION u1;
SET
TEST=> CREATE TABLE t1(a INT);
CREATE TABLE
TEST=> 
TEST=> SET SESSION AUTHORIZATION u2;
SET
TEST=> CREATE VIEW v2 AS 
TEST-> SELECT * FROM t1;
CREATE VIEW
TEST=> 
TEST=> SET SESSION AUTHORIZATION u3;
SET
TEST=> CREATE VIEW v3 AS 
TEST-> SELECT * FROM v2;
CREATE VIEW
TEST=> 
TEST=> SET SESSION AUTHORIZATION u4;
SET
TEST=> SELECT * FROM v3;
ERROR:  permission denied for relation v3
TEST=> 
TEST=> RESET SESSION AUTHORIZATION;
RESET
TEST=# GRANT ALL ON t1 to u4;
GRANT
TEST=# GRANT ALL ON v2 to u4;
GRANT
TEST=# GRANT ALL ON v3 to u4;
GRANT
TEST=# SET SESSION AUTHORIZATION u4;
SET
TEST=> SELECT * FROM v3;
ERROR:  permission denied for relation v2
TEST=>

Responses

pgsql-bugs by date

Next:From: DongniDate: 2009-10-29 09:38:18
Subject: BUG #5147: DBA can not access view
Previous:From: Francis, GeorgeDate: 2009-10-28 20:01:30
Subject: Re: BUG #5144: Issue changing password

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group