CREATE USER
Creates a Firebird user account
DSQL
CREATE USER username <user_option> [<user_option> ...] [TAGS (<user_var> [, <user_var> ...]] <user_option> ::= PASSWORD 'password' | FIRSTNAME 'firstname' | MIDDLENAME 'middlename' | LASTNAME 'lastname' | {GRANT | REVOKE} ADMIN ROLE | {ACTIVE | INACTIVE} | USING PLUGIN plugin_name <user_var> ::= tag_name = 'tag_value' | DROP tag_name
Parameter | Description |
---|---|
username |
Username.The maximum length is 63 characters, following the rules for Firebird identifiers. |
password |
User password.Valid or effective password length depends on the user manager plugin.Case-sensitive. |
firstname |
Optional: User’s first name.Maximum length 32 characters |
middlename |
Optional: User’s middle name.Maximum length 32 characters |
lastname |
Optional: User’s last name.Maximum length 32 characters. |
plugin_name |
Name of the user manager plugin. |
tag_name |
Name of a custom attribute.The maximum length is 63 characters, following the rules for Firebird regular identifiers. |
tag_value |
Value of the custom attribute.The maximum length is 255 characters. |
If the user already exist in the Firebird security database for the specified user manager plugin, an error is raised.It is possible to create multiple users with the same name: one per user manager plugin.
The username argument must follow the rules for Firebird regular identifiers: see Identifiers in the Structure chapter.Usernames are case-sensitive when double-quoted (in other words, they follow the same rules as other delimited identifiers).
Important
|
Usernames follow the general rules and syntax of identifiers.Thus, a user named
|
The PASSWORD
clause specifies the user’s password, and is required.The valid or effective password length depends on the user manager plugin, see also [fblangref50-security-auth].
The optional FIRSTNAME
, MIDDLENAME
and LASTNAME
clauses can be used to specify additional user properties, such as the person’s first name, middle name and last name, respectively.These are VARCHAR(32)
fields and can be used to store anything you prefer.
If the GRANT ADMIN ROLE
clause is specified, the new user account is created with the privileges of the RDB$ADMIN
role in the security database ({secdb}
or database-specific).It allows the new user to manage user accounts from any regular database they log into, but it does not grant the user any special privileges on objects in those databases.
The REVOKE ADMIN ROLE
clause is syntactically valid in a CREATE USER
statement, but has no effect.It is not possible to specify GRANT ADMIN ROLE
and REVOKE ADMIN ROLE
in one statement.
The ACTIVE
clause specifies the user is active and can log in, this is the default.
The INACTIVE
clause specifies the user is inactive and cannot log in.It is not possible to specify ACTIVE
and INACTIVE
in one statement.The ACTIVE
/INACTIVE
option is not supported by the Legacy_UserManager
and will be ignored.
The USING PLUGIN
clause explicitly specifies the user manager plugin to use for creating the user.Only plugins listed in the UserManager
configuration for this database (firebird.conf
, or overridden in databases.conf
) are valid.The default user manager (first in the UserManager
configuration) is applied when this clause is not specified.
Important
|
Users of the same name created using different user manager plugins are different objects.Therefore, the user created with one user manager plugin can only be altered or dropped by that same plugin. From the perspective of ownership, and privileges and roles granted in a database, different user objects with the same name are considered one and the same user. |
The TAGS
clause can be used to specify additional user attributes.Custom attributes are not supported (silently ignored) by the Legacy_UserManager
.Custom attributes names follow the rules of Firebird identifiers, but are handled case-insensitive (for example, specifying both "A BC"
and "a bc"
will raise an error).The value of a custom attribute can be a string of maximum 255 characters.The DROP tag_name
option is syntactically valid in CREATE USER
, but behaves as if the property is not specified.
Warning
|
Users can view and alter their own custom attributes.Do not use this for sensitive or security related information. |
Note
|
|