Bird
0
0

If a user has CREATE privilege on a schema but no USAGE privilege, what happens when they try to create a table in that schema?

medium📝 query result Q5 of 15
PostgreSQL - Roles and Security
If a user has CREATE privilege on a schema but no USAGE privilege, what happens when they try to create a table in that schema?
AThey get an error because USAGE privilege is required to access the schema
BThe table is created successfully
CThey can create the table but cannot query it
DThey can only create temporary tables
Step-by-Step Solution
Solution:
  1. Step 1: Understand privilege requirements for creating objects

    Both CREATE and USAGE privileges are needed to create objects in a schema.
  2. Step 2: Analyze the scenario

    Without USAGE, the user cannot access the schema to create tables, causing an error.
  3. Final Answer:

    They get an error because USAGE privilege is required to access the schema -> Option A
  4. Quick Check:

    CREATE + USAGE needed to create objects [OK]
Quick Trick: CREATE alone isn't enough; USAGE is also required [OK]
Common Mistakes:
  • Assuming CREATE alone allows table creation
  • Thinking USAGE is optional for creation
  • Confusing temporary table creation privileges

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes