Re: BUG #1794: inheritance removes permissions from the parent table

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Sean Burlington <sean(at)uncertainty(dot)org(dot)uk>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1794: inheritance removes permissions from the parent table
Date: 2005-07-28 13:51:13
Message-ID: 20050728135113.GA76018@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-patches

On Thu, Jul 28, 2005 at 12:48:35PM +0100, Sean Burlington wrote:
>
> Description: inheritance removes permissions from the parent table

I think a more accurate description would be "permissions not
inherited by children," and that isn't necessarily a bug.

> If you create a new table that inherits from another table - a user cannot
> select from the parent if they cannot select from the child.

[snip]

> select * from a;
> ERROR: permission denied for relation b
>
> I didn't expect to need permission for table b in order to select from a...

Records in the child are visible when you select from the parent,
so it follows that you'd need permission on both tables. If you
want only records that are in the parent then use FROM ONLY:

SELECT * FROM ONLY a;

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Fuhr 2005-07-28 14:01:40 Re: BUG #1796: UNION ALL of NULL <=> type = text so mimack pb
Previous Message David Dabney 2005-07-28 13:27:40 Re: Insert statement changes timestamp value from MS Access

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2005-07-28 13:53:23 Re: AIX - pgport/contrib resolution
Previous Message Sean Burlington 2005-07-28 11:48:35 BUG #1794: inheritance removes permissions from the parent table