更新时间:2023-10-23 GMT+08:00
分享

aclitem类型

aclitem数据类型是用来存储对象权限信息的,它的内部实现是int类型,支持的格式为‘user1=privs/user2’。

aclitem[]数据类型为aclitem组成的数组,支持的格式为‘{user1=privs1/user3user2=privs2/user3}’。

其中user1,user2和user3为数据库中已存在的用户/角色名,privs为数据库中支持的权限(参见表1)。

示例:

openGauss=# create table table_acl (id int,priv aclitem,privs aclitem[]);
-- 新建一张数据表table_acl,有三个字段,类型分别为int,aclitem,aclitem[]
openGauss=# insert into table_acl values (1,'user1=arw/omm','{omm=d/user2,omm=w/omm}');
--向数据表table_acl插入一条内容为(1,'user1=arw/omm','{omm=d/user2,omm=w/omm}')的数据
openGauss=# insert into table_acl values (2,'user1=aw/omm','{omm=d/user2}');
--向数据表table_acl再插入一条内容为(2,'user1=aw/omm','{omm=d/user2}')的数据
openGauss=# select * from  table_acl;
 id |     priv      |          privs
----+---------------+-------------------------
  1 | user1=arw/omm | {omm=d/user2,omm=w/omm}
  2 | user1=aw/omm  | {omm=d/user2}
(2 rows)
分享:

    相关文档

    相关产品