2023-11-28 18:41:20 +01:00

592 B

Create a new role by executing the createuser command. With the options below, the new role will not be a superuser and will not have privileges for creating new databases or new roles (this is usually the default for the createuser command).

k exec -it -n postgres postgres-postgresql-0 -- bash

createuser -U postgres USER_NAME -S -D -R -P

You will be prompted to enter first the password for the new role and to reenter it, and then to enter the postgres role password.

Create a new database with the new role as the owner:

createdb -U postgres DATABASE_NAME -O USER_NAME