PostgreSQL - Roles and SecurityIf 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 schemaBThe table is created successfullyCThey can create the table but cannot query itDThey can only create temporary tablesCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand privilege requirements for creating objectsBoth CREATE and USAGE privileges are needed to create objects in a schema.Step 2: Analyze the scenarioWithout USAGE, the user cannot access the schema to create tables, causing an error.Final Answer:They get an error because USAGE privilege is required to access the schema -> Option AQuick 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 creationThinking USAGE is optional for creationConfusing temporary table creation privileges
Master "Roles and Security" in PostgreSQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PostgreSQL Quizzes Advanced Features - Why PostgreSQL advanced features matter - Quiz 6medium Advanced PL/pgSQL - Functions returning TABLE - Quiz 10hard Indexing Strategies - Index-only scans mental model - Quiz 13medium PL/pgSQL Fundamentals - FOREACH for array iteration - Quiz 4medium PL/pgSQL Fundamentals - LOOP, WHILE, FOR iterations - Quiz 8hard Performance Tuning - Common query optimization patterns - Quiz 11easy Performance Tuning - ANALYZE for statistics collection - Quiz 2easy Table Partitioning - Attaching and detaching partitions - Quiz 15hard Transactions and Concurrency - MVCC mental model in PostgreSQL - Quiz 8hard Triggers in PostgreSQL - Trigger execution order - Quiz 7medium