云数据库 GaussDB-CREATE SCHEMA:示例

时间:2023-11-01 16:22:51

示例

 1 2 3 4 5 6 7 8 910111213
--创建一个角色role1。openGauss=# CREATE ROLE role1 IDENTIFIED BY 'xxxxxxxxxxx';-- 为用户role1创建一个同名schema,子命令创建的表films和winners的拥有者为role1。openGauss=# 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;--删除schema。openGauss=# DROP SCHEMA role1 CASCADE;--删除用户。openGauss=# DROP USER role1 CASCADE;
support.huaweicloud.com/distributed-devg-v2-opengauss/gaussdb-v5r2c10-0590.html