0

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

2 Answers 2

1

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.

1
  • Thanks for the answer; this could help somebody in future.
    – PP.
    Dec 10, 2009 at 14:35
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .