Updated on 2023-10-23 GMT+08:00

ACLItem

The ACLItem data type is used to store object permission information. Its internal implementation is of the int type and supports the 'user1=privs/user2' format.

The aclitem[] data type is an array consisting of ACL items. The supported format is {user1=privs1/user3, user2=privs2/user3}.

In the preceding command, user1, user2, and user3 indicate the existing users or roles in the database, and privs indicates the permissions supported by the database. For details, see Table 1.

Example:

openGauss=# create table table_acl (id int,priv aclitem,privs aclitem[]);
-- Create a data table table_acl that contains three fields of the int, aclitem, and aclitem[] types.
openGauss=# insert into table_acl values (1,'user1=arw/omm','{omm=d/user2,omm=w/omm}');
-- Insert a record whose content is (1,'user1=arw/omm','{omm=d/user2,omm=w/omm}') into the table_acl table.
openGauss=# insert into table_acl values (2,'user1=aw/omm','{omm=d/user2}');
-- Insert a record whose content is (2,'user1=aw/omm','{omm=d/user2}') into the table_acl table.
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)