164 Star 224 Fork 1.2K

openGauss / docs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ALTER-GROUP.md 1.67 KB
一键复制 编辑 原始数据 按行查看 历史

ALTER GROUP

功能描述

修改一个用户组的属性。

注意事项

ALTER GROUP是ALTER ROLE的别名,非SQL标准语法,不推荐使用,建议用户直接使用ALTER ROLE替代。

语法格式

  • 向用户组中添加用户。

    ALTER GROUP group_name 
        ADD USER user_name [, ... ];
  • 从用户组中删除用户。

    ALTER GROUP group_name 
        DROP USER user_name [, ... ];
  • 修改用户组的名称。

    ALTER GROUP group_name 
        RENAME TO new_name;

参数说明

请参考ALTER ROLE的参数说明

示例

--向用户组中添加用户。
postgres=# ALTER GROUP super_users ADD USER lche, jim;

--从用户组中删除用户。
postgres=# ALTER GROUP super_users DROP USER jim;

--修改用户组的名称。
postgres=# ALTER GROUP super_users RENAME TO normal_users;

相关链接

ALTER GROUPDROP GROUPALTER ROLE

1
https://gitee.com/opengauss/docs.git
git@gitee.com:opengauss/docs.git
opengauss
docs
docs
1.0.1

搜索帮助