2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-11 01:10:31 +00:00
cheat.sheets/sheets/postgresql

11 lines
302 B
Plaintext
Raw Normal View History

2019-09-11 10:45:58 +00:00
# PostgreSQL database administration
# check connection to a database on host `localhost` and port `5432`
pg_isready -h localhost -p 5432
# backup database named `anitya`, add CREATE statement
sudo -u postgres pg_dump -C anitya > anitya.dump
# restore database
sudo -u postgres pqsql -f anitya.dump