~/ learn/ postgresql/ cards/ Security & Administration
1 of 2

Create role analyst (drop it first if it exists), grant it SELECT on books, then check has_table_privilege('analyst','books','SELECT') as can_read.

Create role analyst (drop it first if it exists), grant it SELECT on books, then check has_table_privilege('analyst','books','SELECT') as can_read.

Answer

DROP ROLE IF EXISTS analyst; CREATE ROLE analyst; GRANT SELECT ON books TO analyst; SELECT has_table_privilege('analyst', 'books', 'SELECT') AS can_read;

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/720e0077-1115-4aad-9503-461c227cb549/flashcard utf-8 LF