Previous Topic

Next Topic

Create User

Valid in: SQL, ESQL

The Create User statement defines a new user.

Previous Topic

Next Topic

Syntax

The Create User statement has the following format:

[EXEC SQL] CREATE USER user_name

[WITH with_item {, with_item}]

with_item = NOPRIVILEGES| PRIVILEGES = ( priv {, priv} )
                            | NOGROUP | GROUP = default_group
                            | SECURITY_AUDIT= ( audit_opt {,audit_opt})
                            | NOEXPIREDATE | EXPIRE_DATE = 'expire_date'
                            | DEFAULT_PRIVILEGES = (priv {,priv})| ALL
| NODEFAULT_PRIVILEGES
                            | NOPROFILE | PROFILE= profile_name
                            | NOPASSWORD | PASSWORD = 'user_password'
| PASSWORD = X'encrypted_role_password'
                            | EXTERNAL_PASSWORD

Previous Topic

Next Topic

Embedded Usage

In an embedded Create User statement, specify the with clause using a host string variable (with :hostvar).

Previous Topic

Next Topic

Permissions

You must have the maintain_users privilege and be connected to the iidbdb database.

Additional privileges are required to perform certain operations, as summarized here:

Action

Privilege Required

Set security audit attributes

maintain_audit

Previous Topic

Next Topic

Locking

The Create User statement locks pages in the iiuser system catalog.

Previous Topic

Next Topic

Related Statements

Alter Profile

Alter User

Create Profile

Drop Profile

Drop User

Previous Topic

Next Topic

Examples: Create User

The following are Create User statement examples:

  1. Create a new user, specifying group and privileges.

    create user bspring with
    group = publishing,
    privileges = (createdb, security);

  2. Create a new user, group and no privileges.

    create user barney with
    group = sales,
    noprivileges;

  3. Define user expiration date.

    create user bspring
    with expire_date = '6-jun-1995'

  4. Define an expiration date relative to the date the statement is executed.

    create user bspring
    with expire_date = '1 month'

  5. Specify no expiration date for a user.

    create user bspring
    with noexpire_date

  6. Create a user with a password.

    create user bspring
    with password='mypassword';

  7. Create a user with several privileges, and a smaller set of default privileges.

    create user bspring
    with privileges=(write_down, write_fixed, trace,
    default_privileges = (trace);

  8. Specify a profile for a particular user.

    create user bspring with profile = dbop

    where dbop is an existing profile.

  9. Specify a user with an externally verified password.

    create user bspring
    with external_password;


© 2007 Ingres Corporation. All rights reserved.