表组

【产品名称】oceanbae-cs


【产品版本】3.1


【问题描述】

obclient -h 25.1.1.100 -P 2883 -uroot@test#obcluster -p -c -A tpcc

create tablegroup tpcc_group partition by hash partitions 12;


obclient -h 25.1.1.100 -P 2883 -utpcc@test#obcluster -p -c -A tpcc

create table bmsql_warehouse (

 w_id       integer  not null,

 w_ytd      decimal(12,2),

 w_tax      decimal(4,4),

 w_name     varchar(10),

 w_street_1 varchar(20),

 w_street_2 varchar(20),

 w_city     varchar(20),

 w_state    char(2),

 w_zip      char(9),

 primary key(w_id)

)tablegroup='tpcc_group' partition by hash(w_id) partitions 12;


问题:

只有租户的管理员才有权创建表组。

那么,租户的管理员root@test创建的表组,为什么可以被租户的普通用户tpcc@test引用呢?



从创建tablegroup的时候可以简单看出并不需要切换到指定的database下进行,可见tablegroup和database地位是平级的,如下所示:

(tenant----->database/tablegoup---->table/view)

谢谢。