CompTIA Data+ (DA0-002) free question 10 / 10 · Domain 5: Data governance
A PostgreSQL table holds orders for many regions, and each regional manager should see only the rows for their own region. Which feature enforces this inside the database?
- Column privileges, which grant a user access to particular columns of the table
- Data partition encryption, which protects the files on the disk of the server
- A table comment, which records a note about the intended audience of the table
- Row security policies, which restrict which rows a user can see in queries
Show the answer and explanation
Answer: D
Why this is correct
The manual says that, in addition to the standard privilege system, tables can have row security policies. These restrict, on a per-user basis, which rows can be returned by normal queries or modified by data modification commands. A policy that matches the user's region against the region column limits each manager to their own rows.
Why the other options are wrong
"Column privileges, which grant a user access to particular columns of the table" … Column privileges decide which columns a user can read. They do not separate the rows of one region from those of another.
"A table comment, which records a note about the intended audience of the table" … A comment is documentation. It does not stop anyone from reading the rows.
"Data partition encryption, which protects the files on the disk of the server" … Disk encryption protects data at rest on lost hardware. Users who can query the table would still see the rows of other regions.
Key points
Privileges control columns and objects, row security controls rows. Use the one that matches the boundary you need.
Go to the CompTIA Data+ (DA0-002) practice app (10 free questions; purchase unlocks all questions)