When doing a PostgreSQL database server upgrade, you first need to backup all of the databases because the format changes from version to version.

Postgresql documentation states you need to run the command:

pg_dumpall > outputfile

I ran this, and received the error message:

pg_dumpall: could not connect to database "template1": FATAL: role "root" does not exist

So after some head scratching and googling without any results; I noticed that I had created a user for postgres; namely ‘postgres’. I sued to that user and ran the command - what do you know - it works fine! I’m glad that error message was so clear.

So, the thing that the documentation does not state - make sure you are running under the Postgresql user before running the backup command.


This post has 2 comments. Add your own.

Comments

Mike - 07 Mar 08 at 21:25:44

Don’t ya just love crappy error messages?

Jochen - 24 Jul 08 at 14:42:52

Thx!
You and Google just saved me a lot of time

Trackbacks