USAGE appears in GRANT and REVOKE statements to give a role the minimum permission required to reference certain objects. In PostgreSQL it applies to schemas, sequences, types, domains, languages, foreign data wrappers, servers and large objects. It lets the grantee access or call the object but not modify it. For example, USAGE on a schema lets a user access objects inside the schema that they already have rights to, while USAGE on a sequence lets them call nextval and currval. In MySQL and MariaDB USAGE is a global privilege that effectively grants no privileges; its main purpose is to create an account or change attributes without assigning object permissions. In Snowflake or Redshift USAGE is required on higher level containers such as databases and schemas before lower level privileges can be used. USAGE does not imply rights like SELECT, INSERT, UPDATE or EXECUTE, so it is often paired with those when needed. Revoking USAGE blocks all interaction with the object even if other privileges remain.
object_type
(string) - The category of object (SCHEMA, SEQUENCE, DATABASE, etc.)object_name
(identifier) - Name of the object to which the privilege appliesgrantee
(identifier) - User or role receiving the privilegeWITH GRANT OPTION
(keyword, optional) - Allows the grantee to grant the same privilege to othersPostgreSQL 7.3, MySQL 5.0
Schemas, sequences, data types, domains, languages, foreign data wrappers, servers and large objects can all accept USAGE.
Yes. In PostgreSQL USAGE on a sequence implicitly allows nextval, currval and setval, which read or advance the sequence.
REVOKE USAGE ON SCHEMA schema_name FROM role_name; Any attempt to access objects inside that schema will fail unless USAGE is re-granted.
Yes. GRANT USAGE ... WITH GRANT OPTION lets the grantee pass the same USAGE privilege to other roles.