Dumping and Restoring PostgreSQL Database

Dumping is a process of making a file containing SQL queries that can
be used to contruct the whole database. Dumping is commonly used to download
your database for backup or other purposes. Restoring is the reverse process
of dumping.

Dumping PostgreSQL Database

To dump your PostgreSQL database you need to be logged on to your shell
account. Please see the section called â€śLogging in to UNIX Shell Accountâ€ť for more information about
logging on shell account. Assuming your database name is u777_database, you
need to use the following command to dump your PostgreSQL database.

pg_dump -U u777_database u777_database \
> u777_database.sql

That command should create a file named
u777_database.sql in the current directory. You can
use FTP or other means to download the file.

To make a gzip compressed dump file, you can use a few modification
to the above command.