postgresql.rst 915 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ############
  2. PostgreSQL
  3. ############
  4. PostgreSQL is a enterprise grade open source database.
  5. http://www.postgresql.org/
  6. Backup
  7. ------
  8. The following assumes the database username is fusionpbx and the
  9. database to backup is fusionpbx. Make sure you have the database
  10. password ready.
  11. | ``su postgres``
  12. | ``pg_dump -U fusionpbx fusionpbx -b -v -f /tmp/fusionpbx.sql``
  13. Restore
  14. -------
  15. Assuming username fusionpbx and database fusionpbx
  16. ``psql -U fusionpbx -d fusionpbx -f fusionpbx.sql``
  17. Console
  18. -------
  19. | ``su postgres``
  20. | ``psql``
  21. list the databases
  22. ``\l``
  23. connect to the database
  24. ``\connect fusionpbx``
  25. or
  26. ``\c fusionpbx``
  27. list tables
  28. ``\d``
  29. drop the database
  30. ``DROP DATABASE fusionpbx;``
  31. create the database
  32. ``CREATE DATABASE fusionpbx;``
  33. Links
  34. -----
  35. http://www.mkyong.com/database/backup-restore-database-in-postgresql-pg_dumppg_restore/
  36. http://www.postgresql.org/docs/9.1/static/backup.html