GRANT SELECT ON ... TO username does REVOKE ALL ON ... FROM PUBLIC at the same time

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: GRANT SELECT ON ... TO username does REVOKE ALL ON ... FROM PUBLIC at the same time
Date: 2001-05-31 14:45:28
Message-ID: 200105311445.f4VEjSJ99026@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Jean-Francois Leveque (leveque(at)webmails(dot)com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
GRANT SELECT ON ... TO username does REVOKE ALL ON ... FROM PUBLIC at the same time

Long Description

System: SuSE 7.0
PostgreSQL RPM: postgres-7.0.2-29
select version(); :
PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled by gcc 2.95.2

When I grant select on a table to a user, it also revokes all from
other users, database object owner included (The owner can
no more select from the table, for example).

Sample Code
test@:~ > psql bugcheck
Welcome to psql, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

bugcheck=> CREATE TABLE bugtable (
bugcheck(> bugcolumn int);
CREATE
bugcheck=> \z
Access permissions for database "bugcheck"
Relation | Access permissions
----------+--------------------
bugtable |
(1 row)
bugcheck=> GRANT SELECT ON bugtable TO nobody;
CHANGE
bugcheck=> \d
List of relations
Name | Type | Owner
----------+-------+-------
bugtable | table | test
(1 row)

bugcheck=> \z
Access permissions for database "bugcheck"
Relation | Access permissions
----------+--------------------
bugtable | {"=","nobody=r"}
(1 row)

bugcheck=> select * from bugtable;
ERROR: bugtable: Permission denied.

No file was uploaded with this report

Browse pgsql-bugs by date

  From Date Subject
Next Message Reinoud van Leeuwen 2001-05-31 16:01:38 bug in (plpgsql) parser?
Previous Message Tom Lane 2001-05-31 14:25:00 Re: REVOKE ... FROM username equals REVOKE ... FROM PUBLIC