Informix Error -298
-298 Cannot grant permission to public with grant option.
The clause WITH GRANT OPTION allows the receiver of the grant to grant the same privilege to others. In this case, the receiver of the grant is PUBLIC. If this statement were executed, everyone would have the privilege, and everyone could grant the privilege. This operation is prohibited. Either name specific grantees, or omit the clause WITH GRANT OPTION.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-298 is a security guardrail: GRANT ... TO PUBLIC WITH GRANT OPTION is rejected outright,
because it would let literally every user redistribute the privilege to anyone else, defeating
the point of controlling who can grant it.
- A
GRANTstatement targetingPUBLICcombined withWITH GRANT OPTION— the direct, only cause. - Copy-pasted or templated
GRANTstatements that always includeWITH GRANT OPTIONout of habit, without considering that the target isPUBLICthis time. - Misunderstanding what
WITH GRANT OPTIONis for — it's meant for delegating administration of a privilege to specific trusted users, not for blanket open access.
Solutions / Resolution
- Remove
WITH GRANT OPTIONwhen granting toPUBLIC, per the official guidance, if the intent is simply for everyone to have the privilege (without the ability to re-grant it). - If the ability to re-grant is genuinely needed, grant to specific named users instead of
PUBLIC, each withWITH GRANT OPTIONindividually.
Examples
The disallowed combination
GRANT SELECT ON customers TO PUBLIC WITH GRANT OPTION;
-- -298: PUBLIC cannot receive a re-grantable privilege
Fix — if everyone just needs the privilege, drop WITH GRANT OPTION:
GRANT SELECT ON customers TO PUBLIC;
Fix — if specific users need to be able to re-grant it, name them individually instead:
GRANT SELECT ON customers TO app_admin, report_admin WITH GRANT OPTION;
Diagnostic Checks
- Check whether the
GRANTstatement's target isPUBLICand whetherWITH GRANT OPTIONis also present — the combination is what triggers this, not either clause alone.
Related Errors / Related Topics
- -201 — "A syntax error has occurred." The general SQL-parsing-error family this fits into.
WITH GRANT OPTION and PUBLIC are mutually exclusive — pick named grantees if re-granting
needs to be possible, or drop the grant option if PUBLIC access alone is the goal.