postgresql_user_management

This is an old revision of the document!


User management in postgresql is quite different than other databases. In PostgreSQL, you should remember one thing, EVERYTHING IS ROLE. You have roles which can connect (e.g. users) and roles which cannot connect (groups). You can nest roles one into another and thus granding privileges and groups to other users.

In order to create a user in PostgreSQL, you have to:

  1. Create the role with password
  2. Allow the role in the pg_hba.conf

So let's get going:

Again, user is a role which can connect and has password, that is the only difference between user and group in PostgreSQL. So to create a user we can use the following:

To reset the password, we can use the following command:

Reset password

ALTER USER integration_playson WITH PASSWORD 'xjaR3IvMDXF9NvPHwVSe';
  • postgresql_user_management.1583772750.txt.gz
  • Last modified: 2020/03/09 16:52
  • by andonovj