Zum Inhalt springen

Create and manage users

Diese Seite ist noch nicht in deiner Sprache verfügbar. Englische Seite aufrufen

To get a list of all users for a PostgreSQL Flex instance:

FlagDescription
instance-idInstance ID of the instance you want to query
Terminal window
stackit postgresqlflex user list --instance-id <instance-id>

You get something like the following output:

ID │ USERNAME
───────┼───────────────────
16843 │ crm-tutorial-user

To create a user for a PostgreSQL Flex instance:

FlagDescriptionDefaultOptional
instance-idInstance ID of the instance you want to query
usernameUsername of the new user
rolePermissions of the user (login, createdb)loginx
Terminal window
stackit postgresflex user create --instance-id <instance-id> --username <username> --role <first-role> --role <second-role> ...

You get the following output:

Created user for instance "postgres-qaeq2npfyl75". User ID: 16853
Username: stackit-user-guide-users
Password: pEjB7MK7HRaLfiNAECnObgpY03w1710p5ZfUAyHkDe2hY5vJqhoiMjOVKFLy986e
Roles: [login createdb]
Host: a9b3b1dd-308e-4a00-b269-11d136e65824.postgresql.eu01.onstackit.cloud
Port: 5432
URI: postgresql://stackit-user-guide-users:pEjB7MK7HRaLfiNAECnObgpY03w1710p5ZfUAyHkDe2hY5vJqhoiMjOVKFLy986e@a9b3b1dd-308e-4a00-b269-11d136e65824.postgresql.eu01.onstackit.cloud:5432/stackit

To get details of a user for a PostgreSQL Flex instance:

FlagDescriptionDefaultOptional
instance-idInstance ID of the instance you want to query
user-idThe ID of the user (not its username)
Terminal window
stackit postgresqlflex user describe <user-id> --instance-id <instance-id>

You get the following output:

ID │ 16690
─────────┼──────────────────────────────────────────────────────────────────────
USERNAME │ stackit-user-guide-users
─────────┼──────────────────────────────────────────────────────────────────────
ROLES │ [createdb login]
─────────┼──────────────────────────────────────────────────────────────────────
HOST │ a9b3b1dd-308e-4a00-b269-11d136e65824.postgresql.eu01.onstackit.cloud
─────────┼──────────────────────────────────────────────────────────────────────
PORT │ 5432

To delete a user for a PostgreSQL Flex instance:

FlagDescriptionDefaultOptional
instance-idInstance ID of the instance you want to query
user-idThe ID of the user (not its username)
Terminal window
stackit PostgreSQLflex user delete <user-id> --instance-id <instance-id>

After confirmation, you get the following output:

Deleted user "z8n9ybsi" of instance "PostgreSQL-87ffl67rc1dd"