PostgreSQL how to create user via createuser utility

PostgreSQL how to create user via createuser utility

Colleagues hello to all.

In today's article, we'll talk about how to create users in a PostgreSQL database using the createuser utility. In PostgreSQL, you can create a large number of users, and usernames must consist of letters and numbers.

 

Article content:

  1. Create a user using the createuser utility.

 

1. Creating a user using the createuser utility.

1.1. Creating a simple database user.

$. createuser inzhener --login --pwprompt

postgresql_create_user


 

1.2. Create a user and assign him the right to create databases.

$. createuser inzhener --createdb --pwprompt

postgresql_create_user


 

1.3. Create a user and assign him the right to create users in the database.

$. createuser inzhener --createrole --pwprompt

postgresql_create_user


 

1.4. Create a super user.

$. createuser inzhener --superuser --pwprompt

postgresql_create_user


 

1.5. Create a user and assign him the right to create backups and the ability to implement replication.

$. createuser inzhener --replication --pwprompt

postgresql_create_user


 

Thank you all, I hope that my article helped you in some way.

SIMILAR ARTICLES

PostgreSQL - How to determine which files on disk correspond to tables in a database
PostgreSQL - How to determine which files on disk correspond to tables in a database
POSTGRESQL
Read more
PostgreSQL - How to find out the size of tables in a database
PostgreSQL - How to find out the size of tables in a database
POSTGRESQL
Read more
PostgreSQL - How to check user privileges
PostgreSQL - How to check user privileges
POSTGRESQL
Read more