add webi dat dat dat
[webi-installers/.git] / postgres / README.md
1 ---
2 title: Postgres
3 homepage: https://www.postgresql.org/
4 tagline: |
5   PostgreSQL: The World's Most Advanced Open Source Relational Database.
6 ---
7
8 ## Updating `postgres`
9
10 ```bash
11 webi postgres@stable
12 ```
13
14 Use `@x.y.z` for a specific version.
15
16 ## Cheat Sheet
17
18 > Postgres is the all-in-one database for beginners and experts alike. It
19 > handles SQL, 'NoSQL', JSON, HSTORE, Full-Text Search, Messages Queues and
20 > more. Best bang for buck.
21
22 ### Initialize a database with a password
23
24 ```bash
25 echo "postgres" > /tmp/pwfile
26 mkdir -p $HOME/.local/share/postgres/var/
27
28 initdb -D $HOME/.local/share/postgres/var/ \
29     --username postgres --pwfile "/tmp/pwfile" \
30     --auth-local=password --auth-host=password
31
32 rm /tmp/pwfile
33 ```
34
35 ### Start the postgres server
36
37 ```bash
38 postgres -D $HOME/.local/share/var/postgres -p 5432
39 ```
40
41 ### Connect with the psql client
42
43 ```bash
44 psql 'postgres://postgres:postgres@localhost:5432/postgres'
45 ```