我在H2上运行脚本执行以下操作:
create role admin_role;
create user app_user password 'password' ;
grant admin_role to app_user;
create sequence from_event_seq;
grant select on from_event_seq to admin_role;
Run Code Online (Sandbox Code Playgroud)
令人沮丧的是这不起作用,我收到以下错误:
[Error Code: 42102, SQL State: 42S02] Table "FROM_EVENT_SEQ" not found; SQL statement: grant select on from_event_seq to admin_role [42102-154]
Run Code Online (Sandbox Code Playgroud)
奇怪的是,错误消息似乎认为我试图授予一个表(42102是一个表未找到错误).此外,我实际上可以查询序列,它的工作原理(这意味着它已被创建).H2的授权语法未指定应将授权应用于哪种对象类型.
我错过了什么?