Bird
0
0

How can you combine column-level permissions with row-level security to allow user frank to see only salary column for employees in his own department?

hard📝 Application Q9 of 15
PostgreSQL - Roles and Security
How can you combine column-level permissions with row-level security to allow user frank to see only salary column for employees in his own department?
AGrant SELECT on salary column and create a row-level security policy filtering department = current_user's department
BGrant SELECT on entire table and rely only on row-level security policy
CGrant SELECT on salary column only without any row-level security
DUse GRANT SELECT on salary and REVOKE SELECT on other columns without row-level security
Step-by-Step Solution
Solution:
  1. Step 1: Understand combining permissions

    Column-level permissions restrict columns; row-level security restricts rows.
  2. Step 2: Apply both restrictions for precise control

    Grant SELECT on salary column and create row-level policy filtering department.
  3. Final Answer:

    Grant SELECT on salary column and create a row-level security policy filtering department = current_user's department -> Option A
  4. Quick Check:

    Combine column and row-level controls for fine-grained access [OK]
Quick Trick: Use both column permissions and row-level policies together [OK]
Common Mistakes:
  • Relying only on one type of permission
  • Granting full table access without row filtering
  • Ignoring row-level security policies

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes