snipSorry, I got the sudo command wrong. Confused sudo and su.sudo -u postgres pg_dumpall > /tmp/mypgbackup.sqlcp /tmp/mypgbackup /home/myuser/the response to the sudo . . . is:
pgdumpall: could not connect to database "template1": could not connect to server: No such file or directoryIs the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
ok then. As root try:locate .s.PGSQL.5432See if that shows anything. If not, of if you get an error you may need to:
find / -name .s.PGSQL.5432That may take a while though.
As an alternative you could just do as follows instead:pg_dumpall -h localhost -u postgres > /home/myuser/mydbdump.sqlYou will need to provide the Postgres password in this case.