Informix Error -19803: Only the DBA, or a user granted the role with the WITH GRANT OPTION can grant, revoke, or drop a role.
Cause and resolution
Only the DBA, or a user granted the role with the WITH GRANT OPTION can grant, revoke, or drop a role.
Check your privileges and permissions. Only a DBA can grant, revoke, or drop a default role to a user.
For example, a DBA can grant the default role to a user by running the following statement: GRANT DEFAULT ROLE privilege TO user1;
A user who is granted a role with the WITH GRANT OPTION can grant, revoke, or drop a role, optionally with the WITH GRANT OPTION to another user.
For example, a DBA can grant a privilege with the WITH GRANT OPTION to a user by running the following statement: GRANT privilege TO user1 WITH GRANT OPTION;
Then that user can grant privileges to other users, for example, by running the following statements: GRANT privilege TO user2 WITH GRANT OPTION; GRANT privilege TO user3;
However, a non DBA user cannot grant the default role to a user. For example, the following statement fails: GRANT DEFAULT ROLE privilege TO usr2;
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-19803 fires when a user without the required privilege tries to grant, revoke, or drop a role — per the official guidance.
- A non-DBA user attempting to grant a default role, per the official guidance — only a DBA can grant, revoke, or drop a default role.
- A user without
WITH GRANT OPTIONon the role attempting to grant/revoke/drop it, per the official guidance — a user granted a roleWITH GRANT OPTIONcan grant, revoke, or drop it (optionally alsoWITH GRANT OPTION) to/from others; a plain DBA can also grant a privilegeWITH GRANT OPTIONto a user.
Solutions / Resolution
- Have the DBA perform the operation, for default roles, per the official
guidance — e.g.
GRANT DEFAULT ROLE privilege TO user1;. - Have a user already holding
WITH GRANT OPTIONon the role perform the operation, per the official guidance — e.g.GRANT privilege TO user1 WITH GRANT OPTION;, after whichuser1can runGRANT privilege TO user2 WITH GRANT OPTION;orGRANT privilege TO user3;.
Examples
A non-DBA user granting a default role
-- As usr2 (not DBA):
GRANT DEFAULT ROLE privilege TO usr2;
-- -19803: only the DBA can grant a default role
Corrected
-- As the DBA:
GRANT DEFAULT ROLE privilege TO usr2;
Diagnostic Checks
- Check whether the executing user is the DBA, or holds the role with
WITH GRANT OPTION, and have the appropriate user perform the operation instead.
Related Errors / Related Topics
- -19807 — "Cannot grant privileges to a role WITH GRANT option." A related
WITH GRANT OPTIONrestriction, about re-granting with the option rather than the base privilege to grant/revoke/drop at all.
Only the DBA or a WITH GRANT OPTION holder can grant/revoke/drop a role — check privileges
and have the right user perform the operation.