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

Re: missing data in information_schema grant_* tables?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: missing data in information_schema grant_* tables?
Date: 2010-01-15 12:18:13
Message-ID: 1263557893.30974.1.camel@fsopti579.F-Secure.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On fre, 2010-01-15 at 12:00 +0100, Fabien COELHO wrote:
> INSERT to PUBLIC is shown on the last line of the access privileges 
> column. However, when looking at the information_schema:
> 
>   psql> SELECT grantor, grantee, privilege_type
>         FROM information_schema.role_table_grants
>         WHERE table_name = 'foo';
>   grantor | grantee | privilege_type
> ---------+---------+----------------
>   fabien  | fabien  | SELECT
>   fabien  | fabien  | INSERT
>   fabien  | fabien  | UPDATE
>   fabien  | fabien  | DELETE
>   fabien  | fabien  | TRUNCATE
>   fabien  | fabien  | REFERENCES
>   fabien  | fabien  | TRIGGER
>   fabien  | calvin  | SELECT
> (8 rows)
> 
> My point is that the grant to "PUBLIC" does not show in the
> information 
> schema. However, it appears in the table_privileges view:
> 
>   psql> SELECT grantor, grantee, privilege_type FROM 
> information_schema.table_privileges WHERE table_name='foo';
>   grantor | grantee | privilege_type
> ---------+---------+----------------
>   ... same as previous query ...
>   fabien  | PUBLIC  | INSERT
> 
> (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.


In response to

Responses

pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2010-01-15 12:27:38
Subject: Re: Streaming replication, loose ends
Previous:From: Boszormenyi ZoltanDate: 2010-01-15 12:16:18
Subject: Re: ECPG DESCRIBE [OUTPUT] support

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