For example, there is a postgres user, base and trust access.

    2 answers 2

    To save a database cluster:

    pg_dumpall -U postgres -w > backup 

    To restore a database cluster:

     psql -U postgres -w -f backup postgres 

      Backup base:

       pg_dump -v -h 127.0.0.0 -F c -U postgres -W -f "base.backup" base