Re: Rights for view.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Viacheslav N Tararin <taras(at)dekasoft(dot)com(dot)ua>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Rights for view.
Date: 2003-02-11 15:31:03
Message-ID: 25721.1044977463@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Viacheslav N Tararin <taras(at)dekasoft(dot)com(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-02-11 15:35:54 Re: starting out
Previous Message Tom Lane 2003-02-11 15:26:39 Re: Priority against catalog