Text Size: Normal / Large

CREATE GROUP

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 of users. You must be a database superuser to use this command.

Note that both users and groups are defined at the database cluster level, and so are valid in all databases in the cluster.

Use ALTER GROUP to change a group's membership, and DROP GROUP 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. This is normally not necessary, but may be useful if you need to recreate a group referenced in the permissions of some object.

If this is not specified, the highest assigned group ID plus one (with a minimum of 100) 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;

Compatibility

There is no CREATE GROUP statement in the SQL standard. Roles are similar in concept to groups.


User Comments

No comments could be found for this page.

Add Comment

Please use this form to add your own comments regarding your experience with particular features of PostgreSQL, clarifications of the documentation, or hints for other users. Please note, this is not a support forum, and your IP address will be logged. If you have a question or need help, please see the faq, try a mailing list, or join us on IRC. Note that submissions containing URLs or other keywords commonly found in 'spam' comments may be silently discarded. Please contact the webmaster if you think this is happening to you in error.

In order to submit a comment, you must have a community account.

* Comment
 

* denotes required field

Privacy Policy | Project hosted by hub.org | Designed by tinysofa
Copyright © 1996 – 2007 PostgreSQL Global Development Group