数据仓库服务 GAUSSDB(DWS)-CREATE SCHEMA:示例

时间:2024-12-06 15:12:41

示例

创建一个角色role1:

1
CREATE ROLE role1 IDENTIFIED BY '{password}';

为用户role1创建一个同名schema,子命令创建的表films和winners的拥有者为role1:

1
2
3
4
CREATE SCHEMA AUTHORIZATION role1
     CREATE TABLE films (title text, release date, awards text[])      
     CREATE VIEW winners AS         
     SELECT title, release FROM films WHERE awards IS NOT NULL;

support.huaweicloud.com/sqlreference-910-dws/dws_06_0173.html