postgresql_user and granting select on pg_stat_database

Hello,

I am trying to use the postgresql_user function to create and grant privs on the user. Im getting failure messages relating to the priv.

  • postgresql_user: name=bobby password={{ pg_dd_password }} db=pg_stat_database priv=SELECT state=present

What I want basically to do is the following

create user bobby with password ‘some_password’;

grant SELECT ON pg_stat_database to bobby;

I think my issue is that pg_stat_database isnt really a database or a table, but a collection of views, if I am understanding postgresql correctly.

Any help is appreciated.

pg_stat_database is a view : http://www.postgresql.org/docs/9.4/static/monitoring-stats.html#PG-STAT-DATABASE-VIEW

Im guessing grant privs on views isnt supported with postgresql_user or postgresql_privs?

I was able to get this working. Was just thinking about it in the wrong context. Place working code here for others. Thanks everyone!

  • postgresql_user: name=bobby password={{ pg_dd_password }} db=postgres priv=pg_stat_database:SELECT state=present