GRANT permissions on views have no effect; \dv reports nothing

Started by PostgreSQL Bugs Listalmost 25 years ago2 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

Kristis Makris (kristis dot makris at datasoft dot com) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
GRANT permissions on views have no effect; \dv reports nothing

Long Description
I run a bunch if GRANT statements on tables/views/sequences. The permissions set on teh tables/sequences go in effect correctly. All the grant permissions performed on the views have no effect.

Doing a "\dp" within the pgsql tool does not even list the views, while the permissions on the tables/sequences are listed, even if there aren't any.

Also, doing a "\dv" within the pgsql tool does not list any views at all; it reports: "No relations found."

The views are not listed as relations anywhere, yet they are executed properly

Sample Code
perms=# create view test AS SELECT 'hi'::text AS RESULT;
CREATE
perms=# \dv
No relations found.
perms=# select * from test;
result
--------
hi
(1 row)

perms=# \dp
Access permissions for database "perms"
Relation | Access permissions
----------+--------------------
(0 rows)

perms=# grant all ON test TO public;
CHANGE
perms=# \dp
Access permissions for database "perms"
Relation | Access permissions
----------+--------------------
(0 rows)

perms=# \dv
No relations found.
perms=# create table testtable(id int4);
CREATE
perms=# \dp
Access permissions for database "perms"
Relation | Access permissions
-----------+--------------------
testtable |
(1 row)

perms=# grant all on testtable to public;
CHANGE
perms=# \dp
Access permissions for database "perms"
Relation | Access permissions
-----------+---------------------------
testtable | {"=arwR","postgres=arwR"}
(1 row)

perms=# grant all ON test TO public;
CHANGE
perms=# \dp
Access permissions for database "perms"
Relation | Access permissions
-----------+---------------------------
testtable | {"=arwR","postgres=arwR"}
(1 row)

No file was uploaded with this report

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: GRANT permissions on views have no effect; \dv reports nothing

pgsql-bugs@postgresql.org writes:

perms=# create view test AS SELECT 'hi'::text AS RESULT;
CREATE
perms=# \dv
No relations found.

I'm betting that you're using a 7.0 psql with a 7.1 server,
or vice versa.

regards, tom lane

PS: use a non-obfuscated reply address next time.