Bird
0
0

Which command is used to enable row-level security on a PostgreSQL table named orders?

easy📝 Conceptual Q2 of 15
PostgreSQL - Roles and Security
Which command is used to enable row-level security on a PostgreSQL table named orders?
AALTER TABLE orders SET RLS ENABLED;
BALTER TABLE orders ENABLE ROW LEVEL SECURITY;
CSET ROW LEVEL SECURITY ON orders;
DCREATE POLICY orders ENABLE RLS;
Step-by-Step Solution
Solution:
  1. Step 1: Recall syntax to enable RLS

    The correct syntax is ALTER TABLE table_name ENABLE ROW LEVEL SECURITY;.
  2. Step 2: Match options

    Only ALTER TABLE orders ENABLE ROW LEVEL SECURITY; matches the correct syntax exactly.
  3. Final Answer:

    ALTER TABLE orders ENABLE ROW LEVEL SECURITY; -> Option B
  4. Quick Check:

    Enable RLS = ALTER TABLE ... ENABLE ROW LEVEL SECURITY [OK]
Quick Trick: Use ALTER TABLE ... ENABLE ROW LEVEL SECURITY to activate RLS. [OK]
Common Mistakes:
  • Using CREATE POLICY to enable RLS
  • Trying SET command for RLS
  • Incorrect ALTER TABLE syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes