Bird
0
0

Why does PostgreSQL require explicit enabling of row-level security on a table before policies take effect?

hard📝 Conceptual Q10 of 15
PostgreSQL - Roles and Security
Why does PostgreSQL require explicit enabling of row-level security on a table before policies take effect?
ATo avoid accidental access restrictions on existing applications.
BBecause RLS slows down all queries by default.
CTo automatically encrypt data when enabled.
DBecause policies are only for logging purposes unless enabled.
Step-by-Step Solution
Solution:
  1. Step 1: Understand RLS enabling rationale

    Enabling RLS is explicit to prevent breaking existing apps by restricting access unexpectedly.
  2. Step 2: Evaluate other options

    RLS does not encrypt data or only log access; it controls row visibility.
  3. Final Answer:

    To avoid accidental access restrictions on existing applications. -> Option A
  4. Quick Check:

    Explicit enable prevents accidental restrictions = To avoid accidental access restrictions on existing applications. [OK]
Quick Trick: RLS must be enabled explicitly to protect existing app behavior. [OK]
Common Mistakes:
  • Thinking RLS encrypts data
  • Assuming RLS slows queries by default
  • Believing policies only log access

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes