Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
postgresql_user_management [2020/03/09 16:52] – andonovj | postgresql_user_management [2020/09/11 13:42] (current) – removed andonovj | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====Overview===== | ||
- | 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: | ||
- | |||
- | - Create the role with password | ||
- | - Allow the role in the pg_hba.conf | ||
- | |||
- | |||
- | So let's get going: | ||
- | |||
- | =====User Creation===== | ||
- | 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: | ||
- | |||
- | |||
- | =====Password===== | ||
- | To reset the password, we can use the following command: | ||
- | |||
- | < | ||
- | ALTER USER integration_playson WITH PASSWORD ' | ||
- | </ |