Backup & Restore PostgreSQL DB

-- Backup
pg_dump -h localhost -U name_of_user name_of_database > file

-- Restore
psql -U name_of_user -h localhost name_of_database < file

http://www.postgresql.org/docs/8.1/static/backup.html

-- lancer ton fichier depuis une ligne de commande linux
psql -h monserveur -f monfichiersql

No comments: