SELECT on specific columns using PostgreSQL-style syntax:
SELECT * expands only to their permitted columns, explicit references to unpermitted columns are rejected, and catalog views like information_schema.columns hide those columns from view.
How column-level security works
CLS extends Firebolt’s existing Role-Based Access Control (RBAC) model. A table-levelSELECT grant (no column list) continues to mean “access to all columns.” Column-level grants add a finer level of control within a table.
Key rules:
- Table-level SELECT grants all columns. If a role has
GRANT SELECT ON TABLE t, it can read every column regardless of any column-scoped grants. To restrict the role to specific columns, you must firstREVOKE SELECT ON TABLEand then grant column-level access. - Column grants are additive. Granting
(col_a)and then(col_b)is equivalent to granting(col_a, col_b)— the sets are merged. - Union across roles. A user sees the union of columns granted across all their roles. If
role_agrantsSELECT (col1)androle_bgrantsSELECT (col2), a user with both roles can read both columns. - Column identity is stable. Privileges are stored using internal column IDs, not column names. Renaming a column does not affect access. Dropping and re-adding a column with the same name creates a new ID, so old grants do not apply to the new column.
- Unauthorized columns are invisible. Referencing an unauthorized column produces the same error as referencing a column that does not exist.
Prerequisites
Before configuring column-level security, make sure:- You have a user with
GRANTprivileges (typically anaccount_adminor a role with the relevant permissions). - You understand RBAC basics and table permissions.
- The target database and schema exist, and you have
USAGEon both.
Grant SELECT on specific columns
UseGRANT with a column list to restrict a role to specific columns:
SELECT on TABLE objects. You cannot use column lists with other privileges (such as INSERT or DELETE) or on views.
Example
Suppose you have anemployees table with sensitive salary and SSN data:
analyst_role access to only the non-sensitive columns:
Revoke SELECT on specific columns
UseREVOKE with a column list to remove access to specific columns:
REVOKE subtracts from the column-scoped grant only. It does not affect table-level SELECT grants.
Example
Remove access to thedepartment column:
employee_id and name.
Interaction with table-level grants
Column-level and table-levelSELECT grants follow an OR rule, consistent with PostgreSQL:
| Role state | Effect |
|---|---|
Table-level SELECT (no column list) | Role can read all columns. |
Column-scoped SELECT for columns {A, B} | Role can read columns A and B only. |
| Both table-level and column-scoped grants | Same as table-level: role can read all columns. |
No SELECT at all | Access denied at the table level. |
Moving from full table access to column-scoped access
You cannot “punch holes” in table-level access with a column-listREVOKE. To restrict a role from full table access to a subset of columns:
- Revoke the table-level
SELECT: - Grant access to only the desired columns:
Table-level REVOKE removes column-scoped grants
REVOKE SELECT ON TABLE (without a column list) removes all SELECT on that table for the role, including any column-scoped grants. This matches PostgreSQL behavior.
Schema evolution
Column-level privileges use stable column IDs. When the table schema changes:ADD COLUMN: The new column is not included in any existing column-scoped grant. Roles with column-scopedSELECTcannot read the new column until an administrator explicitly grants it.DROPand re-add column: Dropping and re-adding a column with the same name creates a new internal column ID. Previous grants do not apply to the new column.RENAME COLUMN: Renaming a column does not affect access. The grant follows the column’s stable internal ID, not its name.
STRUCT columns
CLS operates at the top-level column granularity. ASTRUCT column is granted or denied as a whole. Individual sub-fields cannot be independently granted or revoked.
Catalog visibility
| View | Behavior under CLS |
|---|---|
information_schema.columns | Shows only columns the current user is permitted to read. |
information_schema.object_privileges | Shows the SELECT privilege for the table without exposing the column list. Both column-scoped and table-level grants appear as SELECT on the table. |
Views and column-level security
When a query references a view, column-level access on the underlying table is evaluated using the view owner’s privileges, not the querying user’s. This is the same owner rights model that Firebolt applies to all views. For example, if a view owner hasSELECT (a, b) on a table and a view is defined as SELECT a, b FROM t, any user with SELECT on the view can see both columns through the view, even if their own direct table grants are narrower.
Example: multi-role column access
The following example sets up two roles with different column access on the same table, then shows the effective access for a user with both roles:Related topics
- GRANT — Syntax reference for granting privileges
- REVOKE — Syntax reference for revoking privileges
- Table permissions — Table-level privilege reference
- Using secure views — View-based security for data masking and row-level security
- Role-Based Access Control — Overview of Firebolt’s RBAC model
- information_schema.columns — Column metadata filtered by access