Informix Error -19805: No privilege to set to the role.
Cause and resolution
No privilege to set to the role.
Check your privileges and permissions. A user or role must be granted a role using the GRANT statement before the role can be set.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-19805 fires when SET ROLE targets a role that hasn't been granted to the user — per the
official guidance.
- A
SET ROLEtarget not yet granted to the user viaGRANT, per the official guidance — the direct, only cause.
Solutions / Resolution
- Have the role granted to the user/role via
GRANTbefore setting it, per the official guidance.
Examples
Setting an ungranted role
SET ROLE myrole;
-- -19805: myrole was never granted to this user
Corrected
-- As the DBA or a WITH GRANT OPTION holder:
GRANT myrole TO current_user;
-- As current_user:
SET ROLE myrole;
Diagnostic Checks
- Check the user's/role's grants for the target role before setting it.
Related Errors / Related Topics
- -19804 — "The role does not exist." A related role error, about the role not existing at all rather than existing but not granted.
SET ROLE targeted a role never granted to the user — grant it first.