Re: Privileges and inheritance - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Privileges and inheritance
Date
Msg-id 1254730937.25576.8.camel@fsopti579.F-Secure.com
Whole thread Raw
In response to Re: Privileges and inheritance  (KaiGai Kohei <kaigai@ak.jp.nec.com>)
Responses Re: Privileges and inheritance
List pgsql-hackers
On Mon, 2009-10-05 at 16:27 +0900, KaiGai Kohei wrote:
> 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 checks on tbl_c.
> SELECT b,x FROM tbl_c;  --> It selects data from tbl_p and tbl_c concurrently,
>                             if we consider the inherited columns are a part of
>                             the parent table.

I think you need to distinguish between the definition of columns and
the data in the columns.  tbl_c has inherited the definition of the
columns from tbl_p, but the data is part of tbl_c, not tbl_p.  So there
is not reason for this second query to ask tbl_p for permission, because
it does not touch data in tbl_p at all.



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Privileges and inheritance
Next
From: Bernd Helmle
Date:
Subject: Re: Rules: A Modest Proposal