# Backup & Restore
# Backup
Backup one database
pg_dump DATABASE_NAME > /PATH/TO/DUMPFILE.sql
Backup entire cluster
pg_dumpall > /PATH/TO/DUMPFILE_ALL.sql
# Restore
Restore one database
psql DATABASE_NAME < /PATH/TO/DUMPFILE.sql
Restore entire cluster
psql -f /PATH/TO/DUMPFILE_ALL.sql postgres
# Management
# List Databases
psql --list \
--host HOSTNAME \
--port PORT \
--username USER \
--password
Last Update: 2024-11-14 20:06:48 Source File