BUG #6350: Delete a role which is still in use

Started by Marc Balmerover 14 years ago2 messagesbugs
Jump to latest
#1Marc Balmer
marc@msys.ch

The following bug has been logged on the website:

Bug reference: 6350
Logged by: Marc Balmer
Email address: marc@msys.ch
PostgreSQL version: 9.1.1
Operating system: NetBSD
Description:

A role can be deleted although it is still referenced in a column privilege.
Here is how:

create three new roles:

user, admin, new_admin

create a table, e.g. "bar" with one column, e.g. "foo", owner of the table
is "admin".

now grant "user" select rights on the "foo" column in table "bar".

now change the owner of the table "bar" to "new_admin".

drop the role "admin". PostgreSQL won't complain.

look at the privileges of table "bar" using \dp. The ownership change from
"admin" to "new_admin" did not make it to the column privileges.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Marc Balmer (#1)
Re: BUG #6350: Delete a role which is still in use

marc@msys.ch writes:

A role can be deleted although it is still referenced in a column privilege.

Hmm, it looks like ALTER TABLE OWNER forgets to update the grantors in
column privileges. Table privileges are processed properly, but not
columns.

regards, tom lane