drop user doesn't remove rights from tables ... - Mailing list pgsql-hackers

From David Sauer
Subject drop user doesn't remove rights from tables ...
Date
Msg-id m21zgccclh.fsf@orfinet.cz
Whole thread Raw
Responses Re: [HACKERS] drop user doesn't remove rights from tables ...  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
Example:

% sql
Welcome to the POSTGRESQL interactive sql monitor: Please read the file COPYRIGHT for copyright terms of POSTGRESQL
[PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc egcs-2.91.66]
  type \? for help on slash commands  type \q to quit  type \g or terminate with semicolon to execute queryYou are
currentlyconnected to the database: david
 

david=> create user sss;
CREATE USER
david=> select * from pg_shadow;
usename |usesysid|usecreatedb|usetrace|usesuper|usecatupd|passwd|valuntil                    
--------+--------+-----------+--------+--------+---------+------+----------------------------
postgres|     502|t          |t       |t       |t        |      |Sat Jan 31 07:00:00 2037 CET
david   |     501|t          |t       |t       |t        |      |                            
sss     |     503|f          |t       |f       |t        |      |                            
(3 rows)

david=> create table test ( i int );
CREATE
david=> grant all on test to sss;
CHANGE
david=> \z test
Database    = david+----------+--------------------------+| Relation | Grant/Revoke Permissions
|+----------+--------------------------+|test     | {"=","sss=arwR"}         |+----------+--------------------------+
 
david=> drop user sss; 
DROP USER
david=> \z test
Database    = david+----------+--------------------------+| Relation | Grant/Revoke Permissions
|+----------+--------------------------+|test     | {"=","503=arwR"}         |+----------+--------------------------+
 


All rights for user 'sss' remains there (but now identified by
id=503). I'am not sure, if this is error, but it is dangerous.('createuser' with id=503 will grant all rights to new
user)
                                       David

-- 
* David Sauer, student of Czech Technical University
* electronic mail: davids@orfinet.cz (mime compatible)


pgsql-hackers by date:

Previous
From: ZEUGSWETTER Andreas IZ5
Date:
Subject: Re: [HACKERS] Open 6.5 items
Next
From: The Hermit Hacker
Date:
Subject: RE: [HACKERS] Current TODO list