CREATE GROUP 中文man頁面
NAME
CREATE GROUP - 定義一個新的用戶組
SYNOPSIS
CREATE GROUP name [ [ WITH ] option [ ... ] ] where option can be: SYSID gid | USER username [, ...]
DESCRIPTION 描述
CREATE GROUP 將在數(shù)據(jù)庫集群上創(chuàng)建一個新組。 要使用這條命令,你必須是數(shù)據(jù)庫超級用戶。
使用 ALTER GROUP [alter_group(7)] 修改組成員,DROP GROUP [drop_group(7)] 刪除一個組。
PARAMETERS 參數(shù)
- name
- 組名。
- gid
- SYSID 子句可以用于選擇 PostgreSQL 里新組的組標(biāo)識(group ID)。 不過,這樣做不是必須的。
如果沒有聲明這個,將使用從 1 開始的,已分配的最高組標(biāo)識加一作為缺省值。 - username
包括到組里面的用戶列表。用戶必須已經(jīng)存在。
EXAMPLES 例子
創(chuàng)建一個空組:
CREATE GROUP staff;
創(chuàng)建一個有成員的組:
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;