Skip to main content

Syntax

Grant database privileges to a user.
Grant schema privileges to a user.
Grant table privileges to a user.
Grant view privileges to a user.
Grant connection privileges to a user.
Grant secret privileges to a user.
Grant function privileges to a user.
For sources, sinks and materialized views, only the SELECT privilege can be assigned and revoked. Grant source privileges to a user.
Grant sink privileges to a user.
Grant materialized view privileges to a user.

Parameters

Parameter or clauseDescription
WITH GRANT OPTION clauseThe WITH GRANT OPTION clause allows the grantee to grant the privilege to other users.
GRANTED BY clauseThe specified user after the GRANTED BY clause must be the current user. By default, the current user is root.

Grant privileges on future objects

To grant privileges that apply automatically to future objects created by a user, use the ALTER DEFAULT PRIVILEGES command. It sets default privileges without manually granting permissions for each new object.

Example

Grant all privileges for all sources in schema1 to user user1.
Grant the SELECT privilege for materialized view schema1.mv1 to user user1. user1 is able to grant the SELECT privilege to other users.
Grant the SELECT privileges for source s1 to user user1.