Skip site navigation (1) Skip section navigation (2)

Re: missing data in information_schema grant_* tables?

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: missing data in information_schema grant_* tables?
Date: 2010-01-15 14:06:00
Message-ID: alpine.DEB.2.00.1001151448400.4637@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-hackers
Dear Peter,

>> (1) Would you agree that it is a "bug"? That is, if the grantee is 
>> PUBLIC, it is an enabled role for the current user, so it should appear 
>> in the role_table_grants view...
>
> The whole point of role_table_grants is that it shows everything that
> table_privileges shows except privileges granted to public.  So the
> behavior you observe is correct.

This is not my understanding of ISO/IEC 9075-11:2003(E), page 57 :

"5.39 ROLE_TABLE_GRANTS view

Function

Identifies the privileges on tables defined in this catalog that are 
available or granted by the currently applicable roles."

From the definition above, ISTM that a privilege granted to PUBLIC should 
also appear, both because it is granted by me and available to me.

Moreover, if I execute the SELECT of the view definition provided in the 
standard (a little bit simplified, and executed on the information schema 
instead of the "definition schema"), the PUBLIC stuff is displayed :

   psql> SELECT grantor, grantee, table_name
         FROM information_schema.table_privileges
         WHERE grantee IN (SELECT role_name FROM information_schema.enabled_roles)
            OR grantor IN (SELECT role_name FROM information_schema.enabled_roles);

    ...
    fabien   | calvin   | foo
    fabien   | PUBLIC   | foo

I think that the view definition in postgresql could simply reuse the view 
defined in the standard.

-- 
Fabien.

In response to

Responses

pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2010-01-15 15:07:18
Subject: Re: Testing with concurrent sessions
Previous:From: Heikki LinnakangasDate: 2010-01-15 13:59:54
Subject: Re: Streaming replication, loose ends

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group