Hello Folks!

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!


Aryan

Hey Friends, Thank you for visiting my blog and spending some time reading it. Myself Aryan who works in computer technologies and keeps on pen down my understanding of various topics. This blog is a write-up of my understanding of various technologies after reading different materials about it. I hope that it helps you in some way.

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *