A warm Hello to all the readers!

I am back with a small tutorial on PostgreSQL. In this I’ll explain how to create roles and users in PostgreSQL database.

User is a fundamental component of database. DB users are different from operating system users. Users are assigned permissions what database objects they can access.

There are roles and users in postgresql. Both are same but the only difference is that a user is allowed to login using psql command while a role is not allowed to login.

Create PostgreSQL Role

CREATE ROLE apex WITH PASSWORD 'use_secure_password:)';
COMMIT;

Note that the password has to be enclosed in single quotes.

Create PostgreSQL User

CREATE USER apex WITH PASSWORD 'use_secure_password:)';
COMMIT;

And we are done.

Have a good day!

Similar Posts

Error: GraphComment couldn't be load because your settings are invalid. Please visit your admin panel and go to the GraphComment section and enter a valid website URL/ID.