7.7.9 GRANT

Purpose

The GRANT command sets attributes for privileges and roles.

Syntax

GRANT object_type [name] TO sub_object_type [sub_object_name]

Usage Notes

  • object_type can be as follows:

    • PRIVILEGE
    • ROLE
  • The following values can be used for PRIVILEGE object type:

    • name is in the following format:

      { ALL ACTIONS | action } ON { ALL OBJECTS | object }               \
      [{ ALL ATTRIBUTES | ATTRIBUTES attribute1 [, attribute2, ...] }]   \
      [{ WITH ALL OPTIONS | WITH OPTIONS option1 [, option2, ...] }]
      
    • The sub_object_type must be ROLE.

    • The sub_object_name is the name of the role.

  • The following can be used for the ROLE object type:

    • name is the role name.

    • The sub_object_type must be USER.

    • The sub_object_name is the name of the user.