# Column-Level Security

> People may read a table but not all its columns. The private columns stay closed.

**Field:** Data Engineering  
**Category:** Governance & Quality  
**Also known as:** Column-Level Access Control, Column Permissions, Column Privileges

## Think of it like

It is like a letter with some lines covered by tape. You can read the rest, but not those lines.

## Definition

Column-level security lets people read a table but not every column in it. A rule says which roles may see which columns. A support agent may see a name and an order, but not a card number. Asking for a blocked column gives an error, not the data. This keeps one table useful for many teams. The private columns stay closed.

## Example

A shop lets its support role read the name and total columns, but not email. A query that asks for email fails with an error.

## Example code

```sql
GRANT SELECT (name, total) ON customers TO support;
```

The support role may read two columns of the table. Every other column stays closed.

## Why it matters

Most tables mix plain fields and private ones. This shares the plain fields without making a cut-down copy.

## Common mistake

Thinking a closed column is the same as a masked one. A closed column fails the query. A masked one returns stars.

## Three principles

- **Per column.** Rights are set field by field.
- **Set by role.** Roles decide which fields show.
- **Refused, not blank.** A closed column gives an error.

## Related terms

- [Data Access Control](https://learn.benibix.com/term/data/data-access-control)
- [Row-Level Security (RLS)](https://learn.benibix.com/term/data/row-level-security)
- [Data Masking](https://learn.benibix.com/term/data/data-masking)
- [Personally Identifiable Information (PII)](https://learn.benibix.com/term/data/personally-identifiable-information)
- [Data Classification](https://learn.benibix.com/term/data/data-classification)

## Told apart from

- [Column-Level Security vs Data Masking](https://learn.benibix.com/compare/column-level-security-vs-data-masking): People think closing a column and masking it do the same job. A closed column cannot be read at all. A query that asks for it fails with an error. A masked column can be read, but the value comes back hidden, like a card number shown as stars. Closing suits fields a role never needs. Masking suits fields a role needs to see exist.

![Two copies of one customer table with region, customer, email and total columns. On the left, the whole table the data owner can read. On the right, what Lucy, an analyst for Europe, can read: the two US rows and the email column are greyed out.](https://learn.benibix.com/diagrams/dat2-access-control.svg)

---

Source: https://learn.benibix.com/term/data/column-level-security
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
