PostgreSQL - Roles and SecurityWhy 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.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand RLS enabling rationaleEnabling RLS is explicit to prevent breaking existing apps by restricting access unexpectedly.Step 2: Evaluate other optionsRLS does not encrypt data or only log access; it controls row visibility.Final Answer:To avoid accidental access restrictions on existing applications. -> Option AQuick 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 dataAssuming RLS slows queries by defaultBelieving policies only log access
Master "Roles and Security" in PostgreSQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PostgreSQL Quizzes Advanced PL/pgSQL - Exception handling (BEGIN-EXCEPTION-END) - Quiz 10hard Advanced PL/pgSQL - Cursor declaration and usage - Quiz 12easy Advanced PL/pgSQL - Exception handling (BEGIN-EXCEPTION-END) - Quiz 11easy Indexing Strategies - BRIN index for large sequential data - Quiz 15hard Roles and Security - Table-level permissions - Quiz 1easy Roles and Security - Column-level permissions - Quiz 8hard Table Partitioning - Hash partitioning for distribution - Quiz 5medium Table Partitioning - Sub-partitioning - Quiz 11easy Table Partitioning - Range partitioning by date - Quiz 13medium Triggers in PostgreSQL - Trigger for audit logging - Quiz 12easy