How can I set up and maintain the database? Parent topic

The following commands can help you maintain the database:
  • pg_dump –d imss –U sa > YYMMDD.HHMMSS.backup: Back up the database.
  • psql -Usa -d imss < ./YYMMDD.HHMMSS.backup: Retrieve the latest data if errors occur.
  • vacuum: Clean up the database on tables that are frequently accessed or on tables that have large amounts of data. Use this command when email traffic is low or when the device is not connected to your network.
  • vacuumfull: Clean up the entire database when the database is not being heavily utilized or when the device is not connected to your network.
  • redirect_stderr= and log_rotate_***=: Turn on these options in postgresql.conf to redirect old database log entries to the system log, which is rotatable. You can name the log file to start with a dash “-”.