Question on table inheritance and privileges - Mailing list pgsql-general

From 윤기태
Subject Question on table inheritance and privileges
Date
Msg-id CA+CzYHaOxbC-PmAqxLKzk_9zM7Rznqy-+4BQxq_NsdeE_YubBw@mail.gmail.com
Whole thread Raw
Responses Re: Question on table inheritance and privileges  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Dear pgsql-general,

I found something strange with DROP TABLE CASCADE.

create role a login;
grant all on database mydb to a;

create role b inherit role a login;
grant all on database mydb to b;


(session of role a)
psql -U a -d mydb;
create schema a;
create table a(i1 int);


(session of role b)
psql -U b -d mydb;
create schema b;
create table b(c1 char);


(session of role a)
create table c() inherits(a.a, b.b);

(session of role b)
drop table a.c;
-->> ERROR: permission denied for schema a
drop table b cascade
NOTICE: drop cascades to table a.c
DROP TABLE


Is it normal?
role b is not owner of table c but role b can drop it with cascade.
If I 'grant all on schema a to b', role b still cannot drop table c. Because role b is not owner of table c.

Sorry for poor English.

Thanks.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Problem with partitioning
Next
From: Chris Withers
Date:
Subject: connection file descriptors created with identical number after process fork on mac