GRANT assigns privileges on databases, tables, or columns to users or roles in ClickHouse.
GRANT lets administrators give fine-grained privileges—like SELECT, INSERT, or ALTER—so users access only the data they need. It supports column-level, database-level, and role-based permissions.
Use GRANT privilege_list ON scope TO user_or_role. Separate multiple privileges with commas. “ALL” grants every privilege allowed for the object.
Run:GRANT SELECT ON ecommerce.Orders TO alice;
Alice can now read every row and column in Orders.
Yes.Column-level security keeps sensitive data hidden.GRANT SELECT(name, price) ON ecommerce.Products TO analyst_role;
GRANT SELECT, INSERT, UPDATE ON ecommerce.OrderItems TO warehouse_app;
This one line replaces three separate GRANT calls.
Create a role, grant privileges to the role, then assign users to it.CREATE ROLE reporting_role; GRANT SELECT ON ecommerce.* TO reporting_role; GRANT reporting_role TO bob;
Use REVOKE to remove privileges.REVOKE INSERT ON ecommerce.Orders FROM alice;
To replace a privilege set, use:GRANT ...WITH REPLACE OPTION
• Follow least-privilege—grant only what’s required.
• Use roles for teams, not individuals.
• Keep an audit log of GRANT and REVOKE statements via system.query_log.
ClickHouse lacks schemas and uses database.table notation, supports column-level GRANT out-of-the-box, but does not yet support row-level security through GRANT.
.
Yes. Use ON *.* or list databases explicitly, e.g., GRANT SELECT ON sales.*, marketing.* TO analyst_role;
No. First run CREATE USER
or CREATE ROLE
, then GRANT privileges to them.
Query system.grants
or run SHOW GRANTS FOR user_name;