PreviousSQL Engine Reference (v9 SP2 (9.5) revision 1) Next

ALTER GROUP

Chapter contents

The ALTER GROUP statement adds or removes a user account from a group.

Syntax

ALTER GROUP group-name 
<ADD USER user-name [ , user-name ]...  
| DROP USER user-name [ , user-name ]...> 

Remarks

This function is an extension to SQL grammar as documented in the Microsoft ODBC Programmer's Reference.

Only the Master user can execute this statement.

This statement must be used with one of the available keywords.

A user account cannot be added to a group if the group is not already created in the database. To create users and add them to groups simultaneously, see GRANT .

Dropping a user account from a group does not remove the group from the database.

User accounts cannot belong to multiple groups simultaneously. A user account cannot be added to a group if it is currently a member of another group. Such a user account must first be dropped from its current group and then added to another group.

A user name must be enclosed in double quotes if it contains spaces or other non-alphanumeric characters.

For further general information about users and groups, see Master User and Users and Groups in Advanced Operations Guide, and Assigning Permission Tasks in Pervasive PSQL User's Guide.

Examples

The following examples show how to add a user account to a group:

ALTER GROUP developers ADD USER pgranger 

The user account pgranger is added to the group developers.

ALTER GROUP developers ADD USER "polly granger" 

The user account polly granger (containing non-alphanumeric characters) is added to the group developers.

ALTER GROUP developers ADD USER "polly granger", bflat 

The user accounts polly granger (containing non-alphanumeric characters) and bflat are added to the group developers.


The following examples show how to drop a user account from a group.

ALTER GROUP developers DROP USER pgranger 

The user account pgranger is removed from the group developers.

ALTER GROUP developers DROP USER "polly granger" 

The user account polly granger (with a name containing non-alphanumeric characters) is removed from the group developers.

ALTER GROUP developers DROP USER "polly granger", bflat 

The user accounts polly granger (containing non-alphanumeric characters) and bflat are removed from the group developers.

See Also

ALTER USER

CREATE GROUP

CREATE USER

DROP GROUP

GRANT

REVOKE

SET SECURITY


Chapter contents
Book contents

Prev topic: ALTER (rename)
Next topic: ALTER TABLE