Re: Upgrade db format without older version of PostgreSQL

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Upgrade db format without older version of PostgreSQL
Дата
Msg-id 4AC238FE.8050007@hogranch.com
обсуждение исходный текст
Ответ на Upgrade db format without older version of PostgreSQL  (Kelly Jones <kelly.terry.jones@gmail.com>)
Список pgsql-general
Kelly Jones wrote:
> I recently upgraded PostgreSQL, and now this happens:
>
> # /etc/init.d/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.3.8/README.rpm-dist for more information.
>
> Unfortunately, I upgraded due to a hardware failure, and can't
> dump/undump, since I don't have the old PostgreSQL server anymore.
>
> Can I upgrade the data format w/o installing Postgres 7.2 (my
> "data/base/1/PG_VERSION" file says "7.2")?
>
> If not, can Fedora 11's "yum" install Postgres 7.2 (so I can at least
> do a clean install/uninstall and then re-install 8.3.8)?
>


thats going to be pretty painful, actually.

first, make sure you have a backup of the postgres 7.2 data directory
and everything in it.

2nd, find and build 7.2, configuring it to run in a directory like
/home/pg72/ and restore a copy of your old data directory to
/home/pg72/data. make sure all these files are owned by hte postgres
user.    edit the postgresql.conf file in that data dir to use a
different port, like 5433 rather than the default 5432.  manually start
this 7.2 server like...

     # su postgres -c "/home/pg72/bin/pg_ctl start -D /home/pg72/data"

now, clear the postgres 8.3.8 data directory where you tried to restore
your 7.2 $PGDATA, and create a new 8.3 cluster wiht initdb, and start 8.3...

    # rm -rf /var/log/pgsql/data/*
    # service postgresql initdb
    # service postgresql start

now, try this...

    # su - postgres
    $ pg_dumpall -p 5433 | psql

and this should dump your 7.2 database using the 8.3.8 pg_dumpall tool,
and restore it to the 8.3.8 database.

В списке pgsql-general по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: computed values in plpgsql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Upgrade db format without older version of PostgreSQL