3.27. Users

In the object hierarchy under every cluster are Users. You can add users by selecting CREATE USER from the Users context menu. Once a user has been created, it can be altered and dropped. This section describes how to create, alter, and drop a user with Administrator.

In this example, you will create a user called store_manager.

  1. A user is an object under a cluster, so to create a user, first expand the cluster you wish to create the user under (click the O- beside the cluster name).

  2. Right-click on Users and select CREATE USER.

  3. The only required field is the name for the user. Type: store_manager

    The remaining fields are optional; only those related to groups are used in this example:

    • The UID Selection allows entry of a user ID. Type: 2323

    • The controls in the Password Set-up area are used to set up password authentication. The text under the password entry boxes reflects the current status of the password. Password Encryption determines whether the password entered should be encrypted; Password Expires determines when the password has to be renewed.

      No password is used in this example.

    • The User Privileges controls determine whether the new user can be allowed to create databases and create users.

      Select Can Create Databases.

    • The Group Membership box lists which groups the new user is a member of. Choose groups from the Groups Available box and click Add to move those names to the Group Membership box.

      For this example, select the group in_store_workers in the Groups Available box and click Add.

    Figure 3-83. The CREATE USER Dialog

  4. Click OK to create the user.

Figure 3-84. The Users Tree View and Detail View

Note that the user store_manager has been added under the Users node in the Tree View.

Administrator also enables you to perform the following operations on existing users:

Altering

ALTER USER has two types of alterations: altering the user's attributes and altering variables.

To alter a user, right-click on it and select ALTER USER => ATTRIBUTES. All of the characteristics that you could set with CREATE USER (except for User ID) you can modify with ALTER USER; consequently, the dialogs are very similar.

To set a variable for a user session and as the default for the user's subsequent logins, right-click on the user and select ALTER USER => SET VARIABLE. A dialog box asks for the values that need to be set/reset. The SET field takes the arguments that would be passed to SET in the ALTER USER command. Similar, RESET takes the arguments that would be passed to RESET in the ALTER USER command. RESET ALL restores all changeable variables to the default values.

Dropping

To drop a user, right-click on it and select DROP USER. If Preferences => Ask For Confirmations is enabled, you are asked to confirm that you want the user dropped; if it is disabled, the user is dropped immediately. This action cannot be undone.

Privileges

See Section 3.18 Privileges.

Refer to the PostgreSQL 7.3 Administrator's Guide for more information on password authentication, privilege setup, and group membership.