Re: Grant select on view - Mailing list pgsql-novice

From Tom Lane
Subject Re: Grant select on view
Date
Msg-id 3900.1017674082@sss.pgh.pa.us
Whole thread Raw
In response to Re: Grant select on view  (thiemo <thiemo@gmx.ch>)
Responses Re: Grant select on view
List pgsql-novice
thiemo <thiemo@gmx.ch> writes:
> Oh, sure. A self-compiled 7.2, without any source code modifications. I=20
> first instal a sequence:

You're still not being specific enough, because as closely as I can
reproduce your example, it works fine:

regression=# CREATE SEQUENCE seq;
CREATE
regression=# CREATE TABLE base (
regression(# att1 int default nextval('seq'),
regression(# att2 text,
regression(# attn varchar);
CREATE
regression=# CREATE VIEW vie AS select * from base
regression-# WHERE attn = CURRENT_USER::varchar;
CREATE
regression=# create user usr;
CREATE USER
regression=# GRANT SELECT ON vie TO usr;
GRANT
regression=# \c - usr
You are now connected as new user usr.
regression=> select * from base;
ERROR:  base: Permission denied.
regression=> select * from vie;
 att1 | att2 | attn
------+------+------
(0 rows)

regression=>

It's not apparent to me what you did differently from the above
to cause a permissions problem.

            regards, tom lane

pgsql-novice by date:

Previous
From: thiemo
Date:
Subject: Re: Grant select on view
Next
From: kent.rigby@att.net
Date:
Subject: Errors creating my first database