Firebird Documentation IndexFirebird 2.5 Language Ref. UpdateSecurity and access control → SQL user management commands
Firebird Home Firebird Home Prev: AUTO ADMIN MAPPINGFirebird Documentation IndexUp: Security and access controlNext: Context variables

SQL user management commands

Table of Contents

CREATE USER
ALTER USER
DROP USER

Available in: DSQL

Added in: 2.5

Description: Firebird 2.5 and up provide SQL statements for user account management. Except in one case, they are only available to the following privileged users:

Non-privileged users can only use ALTER USER, to change their own account details.

CREATE USER

Description: Creates a Firebird user account.

Syntax: 

CREATE USER username PASSWORD 'password'
   [FIRSTNAME 'firstname']
   [MIDDLENAME 'middlename']
   [LASTNAME 'lastname']
   [GRANT ADMIN ROLE]

GRANT ADMIN ROLE gives the new user the RDB$ADMIN role in the security database. This allows him to manage user accounts, but doesn't give him any special privileges in regular databases. For more information, see The RDB$ADMIN role.

Examples: 

create user bigshot password 'buckshot'
create user john password 'fYe_3Ksw' firstname 'John' lastname 'Doe'
create user mary password 'lamb_chop' firstname 'Mary' grant admin role

ALTER USER

Description: Alters details of a Firebird user account. This is the only account management statement that can also be used by non-privileged users, in order to change their own account details.

Syntax: 

ALTER USER username
   [PASSWORD 'password']
   [FIRSTNAME 'firstname']
   [MIDDLENAME 'middlename']
   [LASTNAME 'lastname']
   [{GRANT|REVOKE} ADMIN ROLE]

-- At least one of the optional parameters must be present.
-- GRANT/REVOKE ADMIN ROLE is reserved to privileged users.

Examples: 

alter user bobby password '67-UiT_G8' grant admin role
alter user dan firstname 'No_Jack' lastname 'Kennedy'
alter user dumbbell revoke admin role

DROP USER

Description: Removes a Firebird user account.

Syntax: 

DROP USER username

Example: 

drop user timmy
Prev: AUTO ADMIN MAPPINGFirebird Documentation IndexUp: Security and access controlNext: Context variables
Firebird Documentation IndexFirebird 2.5 Language Ref. UpdateSecurity and access control → SQL user management commands