pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Lack of information on materialized views in information_schema.table_privileges.
3+ messages / 2 participants
[nested] [flat]

* Lack of information on materialized views in information_schema.table_privileges.
@ 2017-11-26 09:03 Jan Przemysław Wójcik <jan.przemyslaw.wojcik@gmail.com>
  2017-11-26 17:22 ` Re: Lack of information on materialized views in information_schema.table_privileges. Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Jan Przemysław Wójcik @ 2017-11-26 09:03 UTC (permalink / raw)
  To: pgsql-bugs

Hi, 
after:
	
	create schema test_schema;
	create materialized view test_schema.test_mat_view as select 1;
	grant select on test_schema.test_mat_view to public;

information_schema.table_privileges does not show privileges on the view:
	
	select grantee, string_agg(privilege_type, ', ') as privileges
	from information_schema.table_privileges
	where table_schema = 'test_schema' and table_name = 'test_mat_view'
	group by grantee;

	 grantee | privileges 
	---------+------------
	(0 rows)

Should be:

	 grantee  |                          privileges                           
	----------+---------------------------------------------------------------
	 postgres | INSERT, SELECT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER
	 PUBLIC   | SELECT
	(2 rows)
	
Of course, privileges are properly defined in pg_class:	
	
	select relname, relnamespace::regnamespace, relacl
	from pg_class
	where relnamespace = 'test_schema'::regnamespace and relname =
'test_mat_view';

		relname    | relnamespace |                 relacl                  
	---------------+--------------+-----------------------------------------
	 test_mat_view | test_schema  | {postgres=arwdDxt/postgres,=r/postgres}
	(1 rows)

Related post on stackoverflow.com:
https://stackoverflow.com/questions/38728548/list-grants-and-privileges-for-a-materialized-view-in-p...

------
Jan Przemysław Wójcik



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-bugs-f2117394.html




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Lack of information on materialized views in information_schema.table_privileges.
  2017-11-26 09:03 Lack of information on materialized views in information_schema.table_privileges. Jan Przemysław Wójcik <jan.przemyslaw.wojcik@gmail.com>
@ 2017-11-26 17:22 ` Tom Lane <tgl@sss.pgh.pa.us>
  2017-11-27 15:28   ` Re: Lack of information on materialized views in information_schema.table_privileges. Jan Przemysław Wójcik <jan.przemyslaw.wojcik@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2017-11-26 17:22 UTC (permalink / raw)
  To: Jan Przemysław Wójcik <jan.przemyslaw.wojcik@gmail.com>; +Cc: pgsql-bugs

=?UTF-8?Q?Jan_Przemys=C5=82aw_W=C3=B3jcik?= <jan.przemyslaw.wojcik@gmail.com> writes:
> information_schema.table_privileges does not show privileges on the view:

AFAIK, no information_schema view shows anything at all about matviews.
This is intentional because matviews aren't SQL-standard objects.
It's therefore unclear how they should be represented in
information_schema (eg, do they belong in the tables view or the views
view, and if the former, what is their table_type?).  Our project policy
is that rather than inventing extensions to the information_schema
standard, we just don't show nonstandard objects in information_schema.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Lack of information on materialized views in information_schema.table_privileges.
  2017-11-26 09:03 Lack of information on materialized views in information_schema.table_privileges. Jan Przemysław Wójcik <jan.przemyslaw.wojcik@gmail.com>
  2017-11-26 17:22 ` Re: Lack of information on materialized views in information_schema.table_privileges. Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-11-27 15:28   ` Jan Przemysław Wójcik <jan.przemyslaw.wojcik@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Jan Przemysław Wójcik @ 2017-11-27 15:28 UTC (permalink / raw)
  To: pgsql-bugs

Thank you for this clarification. 

------
Jan Przemysław Wójcik 




--
Sent from: http://www.postgresql-archive.org/PostgreSQL-bugs-f2117394.html




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2017-11-27 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-11-26 09:03 Lack of information on materialized views in information_schema.table_privileges. Jan Przemysław Wójcik <jan.przemyslaw.wojcik@gmail.com>
2017-11-26 17:22 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-11-27 15:28   ` Jan Przemysław Wójcik <jan.przemyslaw.wojcik@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox