[BUG] postgres_privileges: unable to verify existing privileges on views.
See original GitHub issueHello !
postgres.privileges_list
and similar functions are unable to verify existing privileges on views.
postgres_privileges.present
says:
View permissions should specify
object_type: table
.
But _make_privileges_list_query
is unable to verify existing privileges on views because it filters on ordinary tables only.
https://github.com/saltstack/salt/blob/f41cda17ce6cc0ee54df483f4d5f48cc2b9632e7/salt/modules/postgres.py#L2728
A little update should fix that.
- "AND relkind = 'r'",
+ "AND relkind in ('r', 'v')",
State example : pg_catalog.pg_shadow
is a view.
pgbouncer_auth_user:
postgres_privileges.present:
# GRANT SELECT ON pg_catalog.pg_shadow TO pgbouncer_auth_user;
- prepend: pg_catalog
- object_name: pg_shadow
- object_type: table
- privileges:
- SELECT
- maintenance_db: my_db
- db_port: 5432
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Postgres grant issue on select from view, but not from base table
So you'd have to grant that owner the SELECT privilege on table1 for the view to work. If the view has security_invoker =...
Read more >PostgeSQL: Verify user privileges - database - Stack Overflow
Undercovers psql uses the bellow query when you issue \du command. SELECT r.rolname, r.rolsuper, r.rolinherit, r.rolcreaterole, r.rolcreatedb ...
Read more >Documentation: 15: 41.5. Rules and Privileges - PostgreSQL
Rules and Privileges. Due to rewriting of queries by the PostgreSQL rule system, other tables/views than those used in the original query get...
Read more >How to Handle Privileges in PostgreSQL | by Shengyu Huang
Briefly speaking, GRANT changes the privileges for CURRENT objects in a particular schema in a database, while ALTER DEFAULT PRIVILEGES changes the privileges ......
Read more >How to Modify User Privileges in PostgreSQL Databases
As an example, to make a read-only user, first revoke all of the user's default privileges, then give CONNECT access. From there, add...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@sagetherage Thanks, I had not noticed that the initial PR was into my own repo…
@waynew a good candidate for the Test Clinics