Re: Privileges and inheritance - Mailing list pgsql-hackers

From KaiGai Kohei
Subject Re: Privileges and inheritance
Date
Msg-id 4AC99FE7.7030408@ak.jp.nec.com
Whole thread Raw
In response to Re: Privileges and inheritance  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Privileges and inheritance  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut wrote:
> On Mon, 2009-10-05 at 12:15 +0900, KaiGai Kohei wrote:
>> On the other hand, it also needs to check permission both of child
>> table and its parents when we select data from a table with its
>> parents,
> 
> You can't do that anyway.

Sorry, I'm not clear why it is impossible.

If we adopt the perspective that inherited columns are a part of
the parent tables, it is quite natural to bypass permisson checks
on the child tables, when we select data from the parent table.
However, we also can select data from the child table which contains
inherited columns from the parent table. In this case, it seems to me
unnatural to bypass permission checks on the parent tables/columns,
although it adopts the perspective.

What I wanted to say is...

For example)

CREATE TABLE tbl_p (int a, int b);
CREATE TABLE tbl_c (int x) INHERITS(tbl_p);

SELECT a,b FROM tbl_p;  --> It selects data from only tbl_p.                           It is reasonable to bypass
checkson tbl_c.
 
SELECT b,x FROM tbl_c;  --> It selects data from tbl_p and tbl_c concurrently,                           if we consider
theinherited columns are a part of                           the parent table.
 
SELECT x FROM tbl_c;    --> ???                           In this case, I don't think it is necessary to check
                permissions on the parent table.
 

Am I missing something?

Thanks,
-- 
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai@ak.jp.nec.com>


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Privileges and inheritance
Next
From: Simon Riggs
Date:
Subject: Re: Privileges and inheritance