NAME
CREATE GROUP - 定义一个新的用户组
SYNOPSIS
CREATE GROUP name [ [ WITH ] option [ ... ] ] where option can be: SYSID gid | USER username [, ...]
DESCRIPTION 描述
CREATE GROUP 将在数据库集群上创建一个新组。 要使用这条命令,你必须是数据库超级用户。
使用 ALTER GROUP [alter_group(7)] 修改组成员,DROP GROUP [drop_group(7)] 删除一个组。
PARAMETERS 参数
- name
- 组名。
- gid
- SYSID 子句可以用于选择 PostgreSQL 里新组的组标识(group ID)。 不过,这样做不是必须的。
如果没有声明这个,将使用从 1 开始的,已分配的最高组标识加一作为缺省值。 - username
包括到组里面的用户列表。用户必须已经存在。
EXAMPLES 例子
创建一个空组:
CREATE GROUP staff;
创建一个有成员的组:
CREATE GROUP marketing WITH USER jonathan, david;
#p#
NAME
CREATE GROUP - define a new user group
SYNOPSIS
CREATE GROUP name [ [ WITH ] option [ ... ] ] where option can be: SYSID gid | USER username [, ...]
DESCRIPTION
CREATE GROUP will create a new group in the database cluster. You must be a database superuser to use this command.
Use ALTER GROUP [alter_group(7)] to change a group's membership, and DROP GROUP [drop_group(7)] to remove a group.
PARAMETERS
- name
- The name of the group.
- gid
- The SYSID clause can be used to choose the PostgreSQL group ID of the new group. It is not necessary to do so, however.
If this is not specified, the highest assigned group ID plus one, starting at 1, will be used as default.
- username
- A list of users to include in the group. The users must already exist.
EXAMPLES
Create an empty group:
CREATE GROUP staff;
Create a group with members:
CREATE GROUP marketing WITH USER jonathan, david;