I would like to share with you on how to fix “An old version of the database format was found” While Starting PostgreSQL server. This error usually happen after we upgrade the postgresql from the lower version to higher version. As an example, we upgrade the postgresql version 8.2 to postgresql version 8.4.1 as below. You will get an error while you starting the postgresql.
This error will appeared when starting the postgresql service
[[email protected] ~]# service postgresql start An old version of the database format was found. You need to upgrade the data format before using PostgreSQL. See /usr/share/doc/postgresql-8.4.1/README.rpm-dist for more information.
1. Assume that you have successfully backup the postgresql database.
2. Run this command.
[[email protected] ~]# cd /var/lib/pgsql/data [[email protected] data]# ls base pg_clog pg_ident.conf pg_multixact pg_tblspc PG_VERSION postgresql.conf global pg_hba.conf pg_log pg_subtrans pg_twophase pg_xlog postmaster.opts [[email protected] data]# rm -rf *
Reinitialize the database.
[[email protected] data]# service postgresql initdb Initializing database: [ OK ]
or you can proceed to directly start the database service.
[[email protected] data]# service postgresql start Starting postgresql service: [ OK ]