数据仓库服务 GAUSSDB(DWS)-通过视图管控数据权限:场景

时间:2024-09-24 16:54:35

场景

dbadmin用户连接集群后,创建示例表customer:

1
CREATE TABLE customer (id bigserial NOT NULL, province_id bigint NOT NULL, user_info varchar, primary key (id)) DISTRIBUTE BY HASH(id);

向示例表customer插入测试数据:

1
2
INSERT INTO customer(province_id,user_info) VALUES (1,'Alice'),(1,'Jack'),(2,'Jack'),(3,'Matu');
INSERT 0 4

查询示例表customer:

1
2
3
4
5
6
7
8
SELECT * FROM customer;
 id | province_id | user_info
----+-------------+-----------
  3 |           2 | Jack
  1 |           1 | Alice
  2 |           1 | Jack
  4 |           3 | Matu
(4 rows)
support.huaweicloud.com/bestpractice-dws/dws_05_0112.html