Re: missing data in information_schema grant_* tables? - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: missing data in information_schema grant_* tables?
Date
Msg-id alpine.DEB.2.00.1001151448400.4637@localhost.localdomain
Whole thread Raw
In response to Re: missing data in information_schema grant_* tables?  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: missing data in information_schema grant_* tables?  (Peter Eisentraut <peter_e@gmx.net>)
List 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
(SELECTrole_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.


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Streaming replication, loose ends
Next
From: "Kevin Grittner"
Date:
Subject: Re: Testing with concurrent sessions