PostgreSQL DB - Role Vs. User

For  PostgreSQL Database, Role and User are the same thing. Except, User is a role with LOGIN privilege.

Any of the following two commands can be used to create a user in PostgreSQL:

CREATE ROLE user1 LOGIN PASSWORD 'P@ssw0rd1';
or
CREATE USER user1 PASSWORD 'P@ssw0rd1';

CREATE USER command is same as CREATE ROLE command, but CREATE USER command includes the LOGIN attribute by default.

** Email to info@shreyantech.com to get such Tip of the Day in your email

No comments:

Post a Comment