0
0
PostgreSQLquery~5 mins

Schema-level access control in PostgreSQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is schema-level access control in PostgreSQL?
Schema-level access control means setting permissions on a whole schema to control who can create, modify, or use objects inside it.
Click to reveal answer
beginner
Which SQL command is used to grant usage rights on a schema in PostgreSQL?
The command is GRANT USAGE ON SCHEMA schema_name TO role_name;. It lets the role access objects inside the schema.
Click to reveal answer
intermediate
What does the CREATE privilege on a schema allow a user to do?
It allows the user to create new tables, views, or other objects inside that schema.
Click to reveal answer
intermediate
How do you revoke all privileges on a schema from a user in PostgreSQL?
Use REVOKE ALL ON SCHEMA schema_name FROM role_name; to remove all schema-level permissions from that role.
Click to reveal answer
beginner
Why is schema-level access control useful in a database?
It helps organize security by controlling access to groups of objects, making management easier and safer.
Click to reveal answer
Which privilege must be granted to allow a user to create tables in a schema?
AUSAGE
BCREATE
CSELECT
DINSERT
What does the USAGE privilege on a schema allow?
ACreate new tables
BDelete objects
CAccess objects inside the schema
DModify schema structure
How do you remove all schema privileges from a user?
AREVOKE ALL ON SCHEMA
BGRANT NONE
CDROP USER
DALTER USER
If a user has USAGE but not CREATE on a schema, what can they do?
AModify schema permissions
BCreate tables
CDrop the schema
DAccess existing objects
Which command grants a role permission to use a schema?
AGRANT USAGE ON SCHEMA
BGRANT ALL ON DATABASE
CGRANT EXECUTE ON SCHEMA
DGRANT SELECT ON SCHEMA
Explain how schema-level access control works in PostgreSQL and why it is important.
Think about controlling who can see or create tables inside a folder-like structure.
You got /4 concepts.
    Describe the difference between the USAGE and CREATE privileges on a schema.
    One lets you look inside, the other lets you add new things.
    You got /4 concepts.