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

Re: Grant select on view

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: thiemo <thiemo(at)gmx(dot)ch>
Cc: pgNovice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Grant select on view
Date: 2002-04-01 15:14:42
Message-ID: 3900.1017674082@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
thiemo <thiemo(at)gmx(dot)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

In response to

Responses

pgsql-novice by date

Next:From: kent.rigbyDate: 2002-04-01 15:33:27
Subject: Errors creating my first database
Previous:From: thiemoDate: 2002-04-01 08:22:39
Subject: Re: Grant select on view

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