Informix Error -19807: Cannot grant privileges to a role WITH GRANT option.
Cause and resolution
Cannot grant privileges to a role WITH GRANT option.
A user that is granted a role with the WITH GRANT option cannot in turn grant the role to a user and include the WITH GRANT option. Use the GRANT statement without the WITH GRANT option.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-19807 fires when a user holding a role WITH GRANT OPTION tries to re-grant that role
including WITH GRANT OPTION — per the official guidance.
- A
WITH GRANT OPTIONholder re-granting the role, also includingWITH GRANT OPTION, per the official guidance — the direct, only cause.
Solutions / Resolution
- Use
GRANTwithout theWITH GRANT OPTIONclause, per the official guidance.
Examples
Re-granting WITH GRANT OPTION
-- As a user holding myrole WITH GRANT OPTION:
GRANT myrole TO otheruser WITH GRANT OPTION;
-- -19807
Corrected
GRANT myrole TO otheruser;
Diagnostic Checks
- Check whether the
GRANTstatement includesWITH GRANT OPTION, and remove it if the grantor only holds the role (not a privilege) with the option.
Related Errors / Related Topics
- -19803 — "Only the DBA, or a user granted the role with the WITH GRANT OPTION can
grant, revoke, or drop a role." The general privilege requirement for role grants, which
this narrows further for the
WITH GRANT OPTIONclause specifically.
WITH GRANT OPTION can't be re-granted on a role — omit that clause.