Maintenance for PostgreSQL Database

To backup the database (on Linux):

  1. Open a command prompt
  2. Type:

pg_dump -U [database-user] -Ft [database-name] > [filename]
This will create a dump file which can be restored using the pg_restore command. Please read the Postgresql administration guide for more options and details.

To backup the database (on Microsoft Windows):

  1. Open pgAdmin tool.
  2. Open the server node and navigate to your database.
  3. Right click on your database and choose Backup...
  4. Enter a file name. Leave the other defaults as is.
  5. Click OK

It is recommended that you set the autovacuum parameter in postgresql.conf to on. This will automatically optimize your database.