Back to articles
USERS,ROLES,GROUPS QUERIES

USERS,ROLES,GROUPS QUERIES

via Dev.to BeginnersAbinaya Dhanraj

Task 1 CREATE ROLE report_user LOGIN; GRANT SELECT ON film TO report_user; Explanation: Created a role and gave SELECT access only on film table. Task 2 GRANT SELECT ON customer TO report_user; Explanation: report_user got permission denied, so I gave SELECT access on customer. Task 3 REVOKE SELECT ON customer FROM report_user; GRANT SELECT (customer_id, first_name, last_name) ON customer TO report_user; Explanation: Removed full access and gave only specific columns. Task 4 CREATE ROLE support_user LOGIN; GRANT SELECT ON customer TO support_user; GRANT UPDATE (email) ON customer TO support_user; Explanation: support_user can view customer and update only email. No DELETE permission is given. Task 5 REVOKE SELECT ON film FROM report_user; Explanation: Removed access on film table. Task 6 CREATE ROLE readonly_group; GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly_group; Explanation: Created group and gave SELECT on all tables. Task 7 CREATE ROLE analyst1 LOGIN; CREATE ROLE analy

Continue reading on Dev.to Beginners

Opens in a new tab

Read Full Article
9 views

Related Articles