云数据库 GaussDB-CREATE SCHEMA:示例

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

示例

--创建一个角色role1。openGauss=# CREATE ROLE role1 IDENTIFIED BY 'xxxxxxxxx';-- 为用户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/centralized-devg-v2-opengauss/devg_03_0568.html