add postgres memo

This commit is contained in:
makayabou 2020-11-13 03:19:18 +01:00
parent af107d8c79
commit d54427bf16
4 changed files with 33 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
geany/
mkdocs-material/
docs/draft

View File

@ -4,3 +4,4 @@
- [Installer Wordpress avec Docker-Compose](wordpress_docker-compose_on_debian-10_with_nginx_reverse-proxy.md)
- [Installer Nextcloud avec Docker-Compose](nextcloud_docker-compose_on_debian-10_with_nginx_reverse-proxy.md)
- [Installer un serveur Debian SSH + Samba](serveur_debian_smb_ssh.md)
- [Un mémo postgres-cli](postgres.md)

View File

@ -0,0 +1,30 @@
# Console postgres
## List databases
```
postgres=# \l
```
## Switch database
```
postgres=# \c db_name
```
List tables
```
db_name=# \dt
```
Show table content
```
db_name=# \d table_name
```
Modify table
```
UPDATE table_name
SET column1 = 'value1',
column2 = 'value2',
...
WHERE condition;
```

View File

@ -65,6 +65,7 @@ nav:
- divers/cmd/screen.md
- divers/cmd/nmcli.md
- divers/cmd/mount.md
- divers/cmd/postgres.md
- "Admin Sys":
- divers/admin/index.md
- "Installer Adobe pdf reader": divers/admin/acroread-debian.md