5.1.2. Adding Firebird user accounts

Firebird allows the creation of many different user accounts. Each of them can own databases and also have various types of access to databases and database objects it doesn’t own.

Assuming you are connected to a database as SYSDBA, you can add a user account as follows:

  1. create user billyboy password 'TooLongFor8099Comfort';

The full range of user management commands is:

  1. CREATE USER name PASSWORD 'password' [<options>] [<tags>];
  2. [CREATE OR] ALTER USER name [SET] [PASSWORD 'password'] [<options>] [<tags>];
  3. ALTER CURRENT USER [SET] [PASSWORD 'password'] [<options>] [<tags>];
  4. DROP USER name;
  5. <options> ::= <option> [, <option> ...]
  6. <option> ::=
  7. {FIRSTNAME | MIDDLENAME | LASTNAME} 'stringvalue'
  8. | ACTIVE
  9. | INACTIVE
  10. <tags> ::= TAGS (<tag> [, <tag> ...])
  11. <tag> ::=
  12. tagname = 'stringvalue'
  13. | DROP tagname

Tags are optional key-value pairs that can be freely defined by the user. The key (tag name) must be a valid SQL identifier, the value a non-NULL string of at most 255 bytes.

Only SYSDBA and co-admins can use all these commands. Ordinary users can change their own parameters (such as password, name parts and tags, but not active/inactive) using ALTER USER *name* or ALTER CURRENT USER. It is not possible to change an account name.

Examples:

  1. create user dubya password 'Xwha007_noma'
  2. firstname 'GW' lastname 'Shrubbery';
  3. create user lorna password 'Mayday_domaka'
  4. tags (Street = 'Main Street', Number = '888');
  5. alter user benny tags (shoesize = '8', hair = 'blond', drop weight);
  6. alter current user set password 'SomethingEvenMoreSecretThanThis';
  7. alter user dubya set inactive;
  8. drop user ted;