Bird
0
0

Consider the command:

medium📝 Debug Q6 of 15
PostgreSQL - Roles and Security
Consider the command:
GRANT CREATE ON SCHEMA sales TO user1;
But user1 cannot create tables in sales. What is the likely cause?
AUser1 does not have SELECT privilege on sales
BUser1 needs to be a superuser
CThe sales schema does not exist
DUser1 lacks USAGE privilege on the sales schema
Step-by-Step Solution
Solution:
  1. Step 1: Check required privileges for creating tables

    Both CREATE and USAGE privileges are needed to create tables in a schema.
  2. Step 2: Identify missing privilege

    User1 has CREATE but likely lacks USAGE privilege, blocking table creation.
  3. Final Answer:

    User1 lacks USAGE privilege on the sales schema -> Option D
  4. Quick Check:

    Missing USAGE privilege blocks creation despite CREATE grant [OK]
Quick Trick: Both CREATE and USAGE needed to create objects [OK]
Common Mistakes:
  • Assuming SELECT privilege is needed for creation
  • Ignoring the need for USAGE privilege
  • Thinking superuser status is required

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes