GRANT Statement
- Grants privileges to ClickHouse user accounts or roles.
- Assigns roles to user accounts or to the other roles.
To revoke privileges, use the REVOKE statement. Also you can list granted privileges with the SHOW GRANTS statement.
Granting Privilege Syntax
privilege— Type of privilege.role— ClickHouse user role.user— ClickHouse user account.
The WITH GRANT OPTION clause grants user or role with permission to execute the GRANT query. Users can grant privileges of the same scope they have and less.
The WITH REPLACE OPTION clause replace old privileges by new privileges for the user or role, if is not specified it appends privileges.
Assigning Role Syntax
role— ClickHouse user role.user— ClickHouse user account.
The WITH ADMIN OPTION clause grants ADMIN OPTION privilege to user or role.
The WITH REPLACE OPTION clause replace old roles by new role for the user or role, if is not specified it appends roles.
Grant Current Grants Syntax
privilege— Type of privilege.role— ClickHouse user role.user— ClickHouse user account.
Using the CURRENT GRANTS statement allows you to give all specified privileges to the given user or role.
If none of the privileges were specified, then the given user or role will receive all available privileges for CURRENT_USER.
Usage
To use GRANT, your account must have the GRANT OPTION privilege. You can grant privileges only inside the scope of your account privileges.
For example, administrator has granted privileges to the john account by the query:
It means that john has the permission to execute:
SELECT x,y FROM db.table.SELECT x FROM db.table.SELECT y FROM db.table.
john can't execute SELECT z FROM db.table. The SELECT * FROM db.table also is not available. Processing this query, ClickHouse does not return any data, even x and y. The only exception is if a table contains only x and y columns. In this case ClickHouse returns all the data.
Also john has the GRANT OPTION privilege, so it can grant other users with privileges of the same or smaller scope.
Access to the system database is always allowed (since this database is used for processing queries).
You can grant multiple privileges to multiple accounts in one query. The query GRANT SELECT, INSERT ON *.* TO john, robin allows accounts john and robin to execute the INSERT and SELECT queries over all the tables in all the databases on the server.
Wildcard grants
Specifying privileges you can use asterisk (*) instead of a table or a database name. For example, the GRANT SELECT ON db.* TO john query allows john to execute the SELECT query over all the tables in db database.
Also, you can omit database name. In this case privileges are granted for current database.
For example, GRANT SELECT ON * TO john grants the privilege on all the tables in the current database, GRANT SELECT ON mytable TO john grants the privilege on the mytable table in the current database.
The feature described below is available starting with the 24.10 ClickHouse version.
You can also put asterisks at the end of a table or a database name. This feature allows you to grant privileges on an abstract prefix of the table's path.
Example: GRANT SELECT ON db.my_tables* TO john. This query allows john to execute the SELECT query over all the db database tables with the prefix my_tables*.
More examples:
GRANT SELECT ON db.my_tables* TO john
GRANT SELECT ON db*.* TO john
All newly created tables within granted paths will automatically inherit all grants from their parents.
For example, if you run the GRANT SELECT ON db.* TO john query and then create a new table db.new_table, the user john will be able to run the SELECT * FROM db.new_table query.
You can specify asterisk only for the prefixes:
Privileges
A Privilege is a permission given to a user to execute specific kinds of queries.
Privileges have a hierarchical structure and a set of permitted queries depends on the privilege scope.
The hierarchy of privileges in ClickHouse is shown below:
ALLACCESS MANAGEMENTALLOW SQL SECURITY NONEALTER QUOTAALTER ROLEALTER ROW POLICYALTER SETTINGS PROFILEALTER USERCREATE QUOTACREATE ROLECREATE ROW POLICYCREATE SETTINGS PROFILECREATE USERDROP QUOTADROP ROLEDROP ROW POLICYDROP SETTINGS PROFILEDROP USERROLE ADMINSHOW ACCESSSHOW QUOTASSHOW ROLESSHOW ROW POLICIESSHOW SETTINGS PROFILESSHOW USERS
ALTERALTER DATABASEALTER DATABASE SETTINGS
ALTER TABLEALTER COLUMNALTER ADD COLUMNALTER CLEAR COLUMNALTER COMMENT COLUMNALTER DROP COLUMNALTER MATERIALIZE COLUMNALTER MODIFY COLUMNALTER RENAME COLUMN
ALTER CONSTRAINTALTER ADD CONSTRAINTALTER DROP CONSTRAINT
ALTER DELETEALTER FETCH PARTITIONALTER FREEZE PARTITIONALTER INDEXALTER ADD INDEXALTER CLEAR INDEXALTER DROP INDEXALTER MATERIALIZE INDEXALTER ORDER BYALTER SAMPLE BY
ALTER MATERIALIZE TTLALTER MODIFY COMMENTALTER MOVE PARTITIONALTER PROJECTIONALTER SETTINGSALTER STATISTICSALTER ADD STATISTICSALTER DROP STATISTICSALTER MATERIALIZE STATISTICSALTER MODIFY STATISTICS
ALTER TTLALTER UPDATE
ALTER VIEWALTER VIEW MODIFY QUERYALTER VIEW REFRESHALTER VIEW MODIFY SQL SECURITY
BACKUPCLUSTERCREATECREATE ARBITRARY TEMPORARY TABLECREATE TEMPORARY TABLE
CREATE DATABASECREATE DICTIONARYCREATE FUNCTIONCREATE RESOURCECREATE TABLECREATE VIEWCREATE WORKLOAD
dictGetdisplaySecretsInShowAndSelectDROPDROP DATABASEDROP DICTIONARYDROP FUNCTIONDROP RESOURCEDROP TABLEDROP VIEWDROP WORKLOAD
INSERTINTROSPECTIONaddressToLineaddressToLineWithInlinesaddressToSymboldemangle
KILL QUERYKILL TRANSACTIONMOVE PARTITION BETWEEN SHARDSNAMED COLLECTION ADMINALTER NAMED COLLECTIONCREATE NAMED COLLECTIONDROP NAMED COLLECTIONNAMED COLLECTIONSHOW NAMED COLLECTIONSSHOW NAMED COLLECTIONS SECRETS
OPTIMIZESELECTSET DEFINERSHOWSHOW COLUMNSSHOW DATABASESSHOW DICTIONARIESSHOW TABLES
SHOW FILESYSTEM CACHESSOURCESAZUREFILEHDFSHIVEJDBCKAFKAMONGOMYSQLNATSODBCPOSTGRESRABBITMQREDISREMOTES3SQLITEURL
SYSTEMSYSTEM CLEANUPSYSTEM DROP CACHESYSTEM DROP COMPILED EXPRESSION CACHESYSTEM DROP CONNECTIONS CACHESYSTEM DROP DISTRIBUTED CACHESYSTEM DROP DNS CACHESYSTEM DROP FILESYSTEM CACHESYSTEM DROP FORMAT SCHEMA CACHESYSTEM DROP MARK CACHESYSTEM DROP MMAP CACHESYSTEM DROP PAGE CACHESYSTEM DROP PRIMARY INDEX CACHESYSTEM DROP QUERY CACHESYSTEM DROP S3 CLIENT CACHESYSTEM DROP SCHEMA CACHESYSTEM DROP UNCOMPRESSED CACHE
SYSTEM DROP PRIMARY INDEX CACHESYSTEM DROP REPLICASYSTEM FAILPOINTSYSTEM FETCHESSYSTEM FLUSHSYSTEM FLUSH ASYNC INSERT QUEUESYSTEM FLUSH LOGS
SYSTEM JEMALLOCSYSTEM KILL QUERYSYSTEM KILL TRANSACTIONSYSTEM LISTENSYSTEM LOAD PRIMARY KEYSYSTEM MERGESSYSTEM MOVESSYSTEM PULLING REPLICATION LOGSYSTEM REDUCE BLOCKING PARTSSYSTEM REPLICATION QUEUESSYSTEM REPLICA READINESSSYSTEM RESTART DISKSYSTEM RESTART REPLICASYSTEM RESTORE REPLICASYSTEM RELOADSYSTEM RELOAD ASYNCHRONOUS METRICSSYSTEM RELOAD CONFIGSYSTEM RELOAD DICTIONARYSYSTEM RELOAD EMBEDDED DICTIONARIESSYSTEM RELOAD FUNCTIONSYSTEM RELOAD MODELSYSTEM RELOAD USERS
SYSTEM SENDSSYSTEM DISTRIBUTED SENDSSYSTEM REPLICATED SENDS
SYSTEM SHUTDOWNSYSTEM SYNC DATABASE REPLICASYSTEM SYNC FILE CACHESYSTEM SYNC FILESYSTEM CACHESYSTEM SYNC REPLICASYSTEM SYNC TRANSACTION LOGSYSTEM THREAD FUZZERSYSTEM TTL MERGESSYSTEM UNFREEZESYSTEM UNLOAD PRIMARY KEYSYSTEM VIEWSSYSTEM VIRTUAL PARTS UPDATESYSTEM WAIT LOADING PARTS
TABLE ENGINETRUNCATEUNDROP TABLE
NONE
Examples of how this hierarchy is treated:
- The
ALTERprivilege includes all otherALTER*privileges. ALTER CONSTRAINTincludesALTER ADD CONSTRAINTandALTER DROP CONSTRAINTprivileges.
Privileges are applied at different levels. Knowing of a level suggests syntax available for privilege.
Levels (from lower to higher):
COLUMN— Privilege can be granted for column, table, database, or globally.TABLE— Privilege can be granted for table, database, or globally.VIEW— Privilege can be granted for view, database, or globally.DICTIONARY— Privilege can be granted for dictionary, database, or globally.DATABASE— Privilege can be granted for database or globally.GLOBAL— Privilege can be granted only globally.GROUP— Groups privileges of different levels. WhenGROUP-level privilege is granted, only that privileges from the group are granted which correspond to the used syntax.
Examples of allowed syntax:
GRANT SELECT(x) ON db.table TO userGRANT SELECT ON db.* TO user
Examples of disallowed syntax:
GRANT CREATE USER(x) ON db.table TO userGRANT CREATE USER ON db.* TO user
The special privilege ALL grants all the privileges to a user account or a role.
By default, a user account or a role has no privileges.
If a user or a role has no privileges, it is displayed as NONE privilege.
Some queries by their implementation require a set of privileges. For example, to execute the RENAME query you need the following privileges: SELECT, CREATE TABLE, INSERT and DROP TABLE.
SELECT
Allows executing SELECT queries.
Privilege level: COLUMN.
Description
User granted with this privilege can execute SELECT queries over a specified list of columns in the specified table and database. If user includes other columns then specified a query returns no data.
Consider the following privilege:
This privilege allows john to execute any SELECT query that involves data from the x and/or y columns in db.table, for example, SELECT x FROM db.table. john can't execute SELECT z FROM db.table. The SELECT * FROM db.table also is not available. Processing this query, ClickHouse does not return any data, even x and y. The only exception is if a table contains only x and y columns, in this case ClickHouse returns all the data.
INSERT
Allows executing INSERT queries.
Privilege level: COLUMN.
Description
User granted with this privilege can execute INSERT queries over a specified list of columns in the specified table and database. If user includes other columns then specified a query does not insert any data.
Example
The granted privilege allows john to insert data to the x and/or y columns in db.table.
ALTER
Allows executing ALTER queries according to the following hierarchy of privileges:
ALTER. Level:COLUMN.ALTER TABLE. Level:GROUPALTER UPDATE. Level:COLUMN. Aliases:UPDATEALTER DELETE. Level:COLUMN. Aliases:DELETEALTER COLUMN. Level:GROUPALTER ADD COLUMN. Level:COLUMN. Aliases:ADD COLUMNALTER DROP COLUMN. Level:COLUMN. Aliases:DROP COLUMNALTER MODIFY COLUMN. Level:COLUMN. Aliases:MODIFY COLUMNALTER COMMENT COLUMN. Level:COLUMN. Aliases:COMMENT COLUMNALTER CLEAR COLUMN. Level:COLUMN. Aliases:CLEAR COLUMNALTER RENAME COLUMN. Level:COLUMN. Aliases:RENAME COLUMN
ALTER INDEX. Level:GROUP. Aliases:INDEXALTER ORDER BY. Level:TABLE. Aliases:ALTER MODIFY ORDER BY,MODIFY ORDER BYALTER SAMPLE BY. Level:TABLE. Aliases:ALTER MODIFY SAMPLE BY,MODIFY SAMPLE BYALTER ADD INDEX. Level:TABLE. Aliases:ADD INDEXALTER DROP INDEX. Level:TABLE. Aliases:DROP INDEXALTER MATERIALIZE INDEX. Level:TABLE. Aliases:MATERIALIZE INDEXALTER CLEAR INDEX. Level:TABLE. Aliases:CLEAR INDEX
ALTER CONSTRAINT. Level:GROUP. Aliases:CONSTRAINTALTER ADD CONSTRAINT. Level:TABLE. Aliases:ADD CONSTRAINTALTER DROP CONSTRAINT. Level:TABLE. Aliases:DROP CONSTRAINT
ALTER TTL. Level:TABLE. Aliases:ALTER MODIFY TTL,MODIFY TTLALTER MATERIALIZE TTL. Level:TABLE. Aliases:MATERIALIZE TTL
ALTER SETTINGS. Level:TABLE. Aliases:ALTER SETTING,ALTER MODIFY SETTING,MODIFY SETTINGALTER MOVE PARTITION. Level:TABLE. Aliases:ALTER MOVE PART,MOVE PARTITION,MOVE PARTALTER FETCH PARTITION. Level:TABLE. Aliases:ALTER FETCH PART,FETCH PARTITION,FETCH PARTALTER FREEZE PARTITION. Level:TABLE. Aliases:FREEZE PARTITION
ALTER VIEWLevel:GROUPALTER VIEW REFRESH. Level:VIEW. Aliases:ALTER LIVE VIEW REFRESH,REFRESH VIEWALTER VIEW MODIFY QUERY. Level:VIEW. Aliases:ALTER TABLE MODIFY QUERYALTER VIEW MODIFY SQL SECURITY. Level:VIEW. Aliases:ALTER TABLE MODIFY SQL SECURITY
Examples of how this hierarchy is treated:
- The
ALTERprivilege includes all otherALTER*privileges. ALTER CONSTRAINTincludesALTER ADD CONSTRAINTandALTER DROP CONSTRAINTprivileges.
Notes
- The
MODIFY SETTINGprivilege allows modifying table engine settings. It does not affect settings or server configuration parameters. - The
ATTACHoperation needs the CREATE privilege. - The
DETACHoperation needs the DROP privilege. - To stop mutation by the KILL MUTATION query, you need to have a privilege to start this mutation. For example, if you want to stop the
ALTER UPDATEquery, you need theALTER UPDATE,ALTER TABLE, orALTERprivilege.
BACKUP
Allows execution of [BACKUP] in queries. For more information on backups see "Backup and Restore".
CREATE
Allows executing CREATE and ATTACH DDL-queries according to the following hierarchy of privileges:
CREATE. Level:GROUPCREATE DATABASE. Level:DATABASECREATE TABLE. Level:TABLECREATE ARBITRARY TEMPORARY TABLE. Level:GLOBALCREATE TEMPORARY TABLE. Level:GLOBAL
CREATE VIEW. Level:VIEWCREATE DICTIONARY. Level:DICTIONARY
Notes
- To delete the created table, a user needs DROP.
CLUSTER
Allows executing ON CLUSTER queries.
By default, queries with ON CLUSTER require the user to have the CLUSTER grant.
You will get the following error if you to try to use ON CLUSTER in a query without first granting the CLUSTER privilege:
The default behavior can be changed by setting the on_cluster_queries_require_cluster_grant setting,
located in the access_control_improvements section of config.xml (see below), to false.
DROP
Allows executing DROP and DETACH queries according to the following hierarchy of privileges:
DROP. Level:GROUPDROP DATABASE. Level:DATABASEDROP TABLE. Level:TABLEDROP VIEW. Level:VIEWDROP DICTIONARY. Level:DICTIONARY
TRUNCATE
Allows executing TRUNCATE queries.
Privilege level: TABLE.
OPTIMIZE
Allows executing OPTIMIZE TABLE queries.
Privilege level: TABLE.
SHOW
Allows executing SHOW, DESCRIBE, USE, and EXISTS queries according to the following hierarchy of privileges:
SHOW. Level:GROUPSHOW DATABASES. Level:DATABASE. Allows to executeSHOW DATABASES,SHOW CREATE DATABASE,USE <database>queries.SHOW TABLES. Level:TABLE. Allows to executeSHOW TABLES,EXISTS <table>,CHECK <table>queries.SHOW COLUMNS. Level:COLUMN. Allows to executeSHOW CREATE TABLE,DESCRIBEqueries.SHOW DICTIONARIES. Level:DICTIONARY. Allows to executeSHOW DICTIONARIES,SHOW CREATE DICTIONARY,EXISTS <dictionary>queries.
Notes
A user has the SHOW privilege if it has any other privilege concerning the specified table, dictionary or database.
KILL QUERY
Allows executing KILL queries according to the following hierarchy of privileges:
Privilege level: GLOBAL.
Notes
KILL QUERY privilege allows one user to kill queries of other users.
ACCESS MANAGEMENT
Allows a user to execute queries that manage users, roles and row policies.
ACCESS MANAGEMENT. Level:GROUPCREATE USER. Level:GLOBALALTER USER. Level:GLOBALDROP USER. Level:GLOBALCREATE ROLE. Level:GLOBALALTER ROLE. Level:GLOBALDROP ROLE. Level:GLOBALROLE ADMIN. Level:GLOBALCREATE ROW POLICY. Level:GLOBAL. Aliases:CREATE POLICYALTER ROW POLICY. Level:GLOBAL. Aliases:ALTER POLICYDROP ROW POLICY. Level:GLOBAL. Aliases:DROP POLICYCREATE QUOTA. Level:GLOBALALTER QUOTA. Level:GLOBALDROP QUOTA. Level:GLOBALCREATE SETTINGS PROFILE. Level:GLOBAL. Aliases:CREATE PROFILEALTER SETTINGS PROFILE. Level:GLOBAL. Aliases:ALTER PROFILEDROP SETTINGS PROFILE. Level:GLOBAL. Aliases:DROP PROFILESHOW ACCESS. Level:GROUPSHOW_USERS. Level:GLOBAL. Aliases:SHOW CREATE USERSHOW_ROLES. Level:GLOBAL. Aliases:SHOW CREATE ROLESHOW_ROW_POLICIES. Level:GLOBAL. Aliases:SHOW POLICIES,SHOW CREATE ROW POLICY,SHOW CREATE POLICYSHOW_QUOTAS. Level:GLOBAL. Aliases:SHOW CREATE QUOTASHOW_SETTINGS_PROFILES. Level:GLOBAL. Aliases:SHOW PROFILES,SHOW CREATE SETTINGS PROFILE,SHOW CREATE PROFILE
ALLOW SQL SECURITY NONE. Level:GLOBAL. Aliases:CREATE SQL SECURITY NONE,SQL SECURITY NONE,SECURITY NONE
The ROLE ADMIN privilege allows a user to assign and revoke any roles including those which are not assigned to the user with the admin option.
SYSTEM
Allows a user to execute SYSTEM queries according to the following hierarchy of privileges.
SYSTEM. Level:GROUPSYSTEM SHUTDOWN. Level:GLOBAL. Aliases:SYSTEM KILL,SHUTDOWNSYSTEM DROP CACHE. Aliases:DROP CACHESYSTEM DROP DNS CACHE. Level:GLOBAL. Aliases:SYSTEM DROP DNS,DROP DNS CACHE,DROP DNSSYSTEM DROP MARK CACHE. Level:GLOBAL. Aliases:SYSTEM DROP MARK,DROP MARK CACHE,DROP MARKSSYSTEM DROP UNCOMPRESSED CACHE. Level:GLOBAL. Aliases:SYSTEM DROP UNCOMPRESSED,DROP UNCOMPRESSED CACHE,DROP UNCOMPRESSED
SYSTEM RELOAD. Level:GROUPSYSTEM RELOAD CONFIG. Level:GLOBAL. Aliases:RELOAD CONFIGSYSTEM RELOAD DICTIONARY. Level:GLOBAL. Aliases:SYSTEM RELOAD DICTIONARIES,RELOAD DICTIONARY,RELOAD DICTIONARIESSYSTEM RELOAD EMBEDDED DICTIONARIES. Level:GLOBAL. Aliases:RELOAD EMBEDDED DICTIONARIES
SYSTEM MERGES. Level:TABLE. Aliases:SYSTEM STOP MERGES,SYSTEM START MERGES,STOP MERGES,START MERGESSYSTEM TTL MERGES. Level:TABLE. Aliases:SYSTEM STOP TTL MERGES,SYSTEM START TTL MERGES,STOP TTL MERGES,START TTL MERGESSYSTEM FETCHES. Level:TABLE. Aliases:SYSTEM STOP FETCHES,SYSTEM START FETCHES,STOP FETCHES,START FETCHESSYSTEM MOVES. Level:TABLE. Aliases:SYSTEM STOP MOVES,SYSTEM START MOVES,STOP MOVES,START MOVESSYSTEM SENDS. Level:GROUP. Aliases:SYSTEM STOP SENDS,SYSTEM START SENDS,STOP SENDS,START SENDSSYSTEM DISTRIBUTED SENDS. Level:TABLE. Aliases:SYSTEM STOP DISTRIBUTED SENDS,SYSTEM START DISTRIBUTED SENDS,STOP DISTRIBUTED SENDS,START DISTRIBUTED SENDSSYSTEM REPLICATED SENDS. Level:TABLE. Aliases:SYSTEM STOP REPLICATED SENDS,SYSTEM START REPLICATED SENDS,STOP REPLICATED SENDS,START REPLICATED SENDS
SYSTEM REPLICATION QUEUES. Level:TABLE. Aliases:SYSTEM STOP REPLICATION QUEUES,SYSTEM START REPLICATION QUEUES,STOP REPLICATION QUEUES,START REPLICATION QUEUESSYSTEM SYNC REPLICA. Level:TABLE. Aliases:SYNC REPLICASYSTEM RESTART REPLICA. Level:TABLE. Aliases:RESTART REPLICASYSTEM FLUSH. Level:GROUPSYSTEM FLUSH DISTRIBUTED. Level:TABLE. Aliases:FLUSH DISTRIBUTEDSYSTEM FLUSH LOGS. Level:GLOBAL. Aliases:FLUSH LOGS
The SYSTEM RELOAD EMBEDDED DICTIONARIES privilege implicitly granted by the SYSTEM RELOAD DICTIONARY ON *.* privilege.
INTROSPECTION
Allows using introspection functions.
INTROSPECTION. Level:GROUP. Aliases:INTROSPECTION FUNCTIONSaddressToLine. Level:GLOBALaddressToLineWithInlines. Level:GLOBALaddressToSymbol. Level:GLOBALdemangle. Level:GLOBAL
SOURCES
Allows using external data sources. Applies to table engines and table functions.
SOURCES. Level:GROUPAZURE. Level:GLOBALFILE. Level:GLOBALHDFS. Level:GLOBALHIVE. Level:GLOBALJDBC. Level:GLOBALKAFKA. Level:GLOBALMONGO. Level:GLOBALMYSQL. Level:GLOBALNATS. Level:GLOBALODBC. Level:GLOBALPOSTGRES. Level:GLOBALRABBITMQ. Level:GLOBALREDIS. Level:GLOBALREMOTE. Level:GLOBALS3. Level:GLOBALSQLITE. Level:GLOBALURL. Level:GLOBAL
The SOURCES privilege enables use of all the sources. Also you can grant a privilege for each source individually. To use sources, you need additional privileges.
Examples:
- To create a table with the MySQL table engine, you need
CREATE TABLE (ON db.table_name)andMYSQLprivileges. - To use the mysql table function, you need
CREATE TEMPORARY TABLEandMYSQLprivileges.
dictGet
dictGet. Aliases:dictHas,dictGetHierarchy,dictIsIn
Allows a user to execute dictGet, dictHas, dictGetHierarchy, dictIsIn functions.
Privilege level: DICTIONARY.
Examples
GRANT dictGet ON mydb.mydictionary TO johnGRANT dictGet ON mydictionary TO john
displaySecretsInShowAndSelect
Allows a user to view secrets in SHOW and SELECT queries if both
display_secrets_in_show_and_select server setting
and
format_display_secrets_in_show_and_select format setting
are turned on.
NAMED COLLECTION ADMIN
Allows a certain operation on a specified named collection. Before version 23.7 it was called NAMED COLLECTION CONTROL, and after 23.7 NAMED COLLECTION ADMIN was added and NAMED COLLECTION CONTROL is preserved as an alias.
NAMED COLLECTION ADMIN. Level:NAMED_COLLECTION. Aliases:NAMED COLLECTION CONTROLCREATE NAMED COLLECTION. Level:NAMED_COLLECTIONDROP NAMED COLLECTION. Level:NAMED_COLLECTIONALTER NAMED COLLECTION. Level:NAMED_COLLECTIONSHOW NAMED COLLECTIONS. Level:NAMED_COLLECTION. Aliases:SHOW NAMED COLLECTIONSSHOW NAMED COLLECTIONS SECRETS. Level:NAMED_COLLECTION. Aliases:SHOW NAMED COLLECTIONS SECRETSNAMED COLLECTION. Level:NAMED_COLLECTION. Aliases:NAMED COLLECTION USAGE, USE NAMED COLLECTION
Unlike all other grants (CREATE, DROP, ALTER, SHOW) grant NAMED COLLECTION was added only in 23.7, while all others were added earlier - in 22.12.
Examples
Assuming a named collection is called abc, we grant privilege CREATE NAMED COLLECTION to user john.
GRANT CREATE NAMED COLLECTION ON abc TO john
TABLE ENGINE
Allows using a specified table engine when creating a table. Applies to table engines.
Examples
GRANT TABLE ENGINE ON * TO johnGRANT TABLE ENGINE ON TinyLog TO john
ALL
Grants all the privileges on regulated entity to a user account or a role.
The privilege ALL is not supported in ClickHouse Cloud, where the default user has limited permissions. Users can grant the maximum permissions to a user by granting the default_role. See here for further details.
Users can also use the GRANT CURRENT GRANTS as the default user to achieve similar effects to ALL.
NONE
Doesn't grant any privileges.
ADMIN OPTION
The ADMIN OPTION privilege allows a user to grant their role to another user.