Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Background: I was migrating a system from one Ubuntu host to another and along with it a Postgresql database. Unfortunately I don't have access to the original server any longer and the backup file that I was going to use has corrupted.

I have been trying to reinstate the data directory of the postgresql database (of which I do have a filesystem copy) on the target server. However, every time I start Postgresql through init.d, I receieve the error message:

Could not determine cluster encoding

I have searched for this error message and found nothing and my knowledge of Postgresql does not stretch far enough to understand exactly what is causing the issue.

The original host was Ubuntu 8.04, the target 9.10 and both were/are running Postgresql 8.3 installed from the ubuntu default repositories.

Any insight you can give as to why this error might be occurring would be greatly appreciated.

Thanks,

Niall

share|improve this question

2 Answers 2

up vote 1 down vote accepted

After much head scratching I discovered that the issue was due to the fact that the host system was 32 bit and the target system 64 bit. Since Postgresql encodes the data directorys differently for each version, the 64 bit server could not load the 32 bit data directory.

To resolve this I simply created a seperate 32 bit Ubuntu instance and copied the data directory to it. Once the server was up and running I ran pg_dumpall to export the database and transferred the output back to the target machine to load.

share|improve this answer
    
Thanks for the answer; this could help somebody in future. –  PP. Dec 10 '09 at 14:35

I assume all the files are properly owned by the database superuser's account, and permissions are correct?

What is in your PG_VERSION file?

Perhaps a ls -lR would help.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.