To backup read here. or use as user postgres:
backup: pg_dumpall | gzip -c > all.dbs.out.gz
and to restore:
gunzip all.dbs.out.gz psql -f all.dbs.out postgres
select datname from pg_database;
or:
\l
\dt