feat: adjust postgres-create-user.md
This commit is contained in:
parent
e434cb5e7a
commit
ce43b5c80f
|
@ -7,10 +7,15 @@
|
|||
* create a database user called <user name> with password <key>
|
||||
```
|
||||
sudo -u postgres psql -W
|
||||
CREATE USER <user name> with encrypted password <key>;
|
||||
CREATE USER <user name> with encrypted password '<key>';
|
||||
grant all privileges on database <database name> to <user name>;
|
||||
```
|
||||
|
||||
* OPTION: if <user name> already exist, pw can be changed this way
|
||||
```
|
||||
ALTER USER <user name> WITH ENCRYPTED PASSWORD '<key>';
|
||||
```
|
||||
|
||||
* OPTION: gant user <user_name> access to database ```postgres``` so that this user is able to login without providing a database
|
||||
```
|
||||
sudo -u postgres psql -W
|
||||
|
|
Loading…
Reference in New Issue