📝 — Use sudo -u postgres in PostgreSQL doc

This commit is contained in:
Luc Didry 2023-12-14 17:31:11 +01:00
parent 4cfc845fca
commit 1a5a44fe6a
No known key found for this signature in database
GPG key ID: EA868E12D0257E3C

View file

@ -14,15 +14,10 @@ Here are a few steps for you to install postgresql on your system:
sudo apt install postgresql
```
By default, the `postgres` user has no password and can hence only connect if ran by the `postgres` system user. The following command will assign it:
```bash
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
```
```bash
psql postgres -c "CREATE DATABASE argos;"
psql postgres -c "ALTER DATABASE argos SET TIMEZONE TO 'UTC';"
sudo -u postgres createuser -P argos
sudo -u postgres createdb -O argos argos
sudo -u postgres psql -c "ALTER DATABASE argos SET TIMEZONE TO 'UTC';"
```
## MacOS