Granting privileges for a default role

About this task

To define and grant privileges for a default role:

Procedure

  1. Select an existing role in the current database to use as a default role or create the role that you want to use as a default role. Use the CREATE ROLE rolename statement to create a new role in the current database.
  2. Use the GRANT statement to grant privileges to the role.
  3. Grant the role to a user and set the role as the default user or PUBLIC role by using the syntax GRANT DEFAULT ROLE rolename TO username or GRANT DEFAULT ROLE rolename TO PUBLIC.

Results

Use the REVOKE DEFAULT ROLE statement to disassociate a default role from a user.

A user must use the SET ROLE DEFAULT statement to change any other current role to the default role.

See the Informix® Guide to SQL: Syntax for more information about using these statements.