How to dump and restore a postgresql database

To create a postgresql dump in linux, execute the following commands:Login as root user>su - postgres>pg_dump -U username -W -Z 9 -f /tmp/dump_username.dump.zip -h 127.0.0.1 dbname>passwordTo restore, execute:>psql -U username -f dump_username.dump dbnameOther ways: >pg_dump -U <username>...