Fork me on GitHub
Permalink: 11/24/15, 16:11 by k0ste in misc tags: psql postgres sql

Show grants on table

SELECT grantee, string_agg(privilege_type, ', ') AS privileges FROM information_schema.role_table_grants WHERE table_name='table_name' GROUP BY grantee;

Set grants on all table on current database

GRANT SELECT ON ALL TABLES IN SCHEMA public to readonly_user;