Bird
0
0

What is wrong with this command?

medium📝 Debug Q7 of 15
PostgreSQL - Roles and Security
What is wrong with this command?
ALTER ROLE readonly CREATEDB NOLOGIN;
ANo error, command is valid
BNOLOGIN cannot be set with CREATEDB
CALTER ROLE requires multiple commands for multiple attributes
DAttributes must be separated by commas
Step-by-Step Solution
Solution:
  1. Step 1: Understand ALTER ROLE attribute syntax

    Multiple attributes can be set in one ALTER ROLE command separated by spaces.
  2. Step 2: Check if CREATEDB and NOLOGIN can coexist

    They can be set together; no syntax error.
  3. Final Answer:

    No error, command is valid -> Option A
  4. Quick Check:

    ALTER ROLE accepts multiple attributes space-separated [OK]
Quick Trick: ALTER ROLE attributes are space-separated, no commas needed [OK]
Common Mistakes:
  • Adding commas between attributes
  • Thinking CREATEDB and NOLOGIN conflict
  • Believing multiple ALTER ROLE commands are required

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes