docs/content/v2.20/api/ysql/the-sql-language/statements/dcl_grant.md
Use the GRANT statement to grant access privileges on database objects as well as to assign membership in roles.
{{%ebnf%}} grant, grant_table, grant_table_col, grant_seq, grant_db, grant_domain, grant_schema, grant_type, grant_role, grantee_role {{%/ebnf%}}
GRANT can be used to assign privileges on database objects as well as memberships in roles.
GRANT on database objectsThis variant of GRANT command is used to assign privileges on database objects to one or more roles.
If keyword PUBLIC is used instead of role_name, then it means that the privileges are to be granted to all roles, including those that might be created later.
If WITH GRANT OPTION is specified, the recipient of the privilege can in turn grant it to others. Without a grant option, the recipient cannot do that. Grant options cannot be granted to PUBLIC.
There is no need to grant privileges to the owner of an object (usually the user that created it), as the owner has all privileges by default. (The owner could, however, choose to revoke some of their own privileges for safety.)
Possible privileges are
SELECT
INSERT
UPDATE
DELETE
TRUNCATE
REFERENCES
TRIGGER
CREATE
CONNECT
TEMPORARY / TEMP
EXECUTE
USAGE
currval() and nextval() functions.ALL PRIVILEGES
GRANT on rolesThis variant of GRANT is used to grant membership in a role to one or more other roles.
If WITH ADMIN OPTION is specified, the member can in turn grant membership in the role to others, and revoke membership in the role as well.
yugabyte=# GRANT SELECT ON stores TO PUBLIC;
yugabyte=# GRANT SysAdmins TO John;