Viacheslav N Tararin <taras@dekasoft.com.ua> writes:
> I have table table1 with owner user1;
> I have view view1 based only on table1 owner user1 too.
> I have user2 which not own anything.
> user1 grant rights to select on view1 to user2.
> Why user2 when try select from view1 get 'table1: permission denied'?
You'll need to give more details, because as far as I can tell that
works:
regression=# create user user1;
CREATE USER
regression=# create user user2;
CREATE USER
regression=# \c - user1
You are now connected as new user user1.
regression=> create table table1(f1 int);
CREATE TABLE
regression=> create view view1 as select * from table1;
CREATE VIEW
regression=> grant select on view1 to user2;
GRANT
regression=> \c - user2
You are now connected as new user user2.
regression=> select * from table1;
ERROR: table1: permission denied
regression=> select * from view1;
f1
----
(0 rows)
regards, tom lane