Fedora 28 не может обновить Postgres до 10

611
Bart Friederichs

При запуске сервера Postgres на Fedora 28 я получаю эту ошибку:

May 25 14:36:14 localhost.localdomain systemd[1]: Starting PostgreSQL database server... May 25 14:36:14 localhost.localdomain postgresql-check-db-dir[11816]: An old version of the database format was found. May 25 14:36:14 localhost.localdomain postgresql-check-db-dir[11816]: Use 'postgresql-setup --upgrade' to upgrade to version '10' May 25 14:36:14 localhost.localdomain postgresql-check-db-dir[11816]: See /usr/share/doc/postgresql/README.rpm-dist for more information. May 25 14:36:14 localhost.localdomain systemd[1]: postgresql.service: Control process exited, code=exited status=1 May 25 14:36:14 localhost.localdomain systemd[1]: postgresql.service: Failed with result 'exit-code'. May 25 14:36:14 localhost.localdomain systemd[1]: Failed to start PostgreSQL database server. 

Запуск обновления дает мне:

[root@localhost lib]# postgresql-setup --upgrade * Upgrading database. ERROR: pg_upgrade tool failed ERROR: Upgrade failed. * See /var/lib/pgsql/upgrade_postgresql.log for details. 

Файл журнала затем дает мне:

... Setting frozenxid and minmxid counters in new cluster ok Restoring global objects in the new cluster  *failure*  Consult the last few lines of "pg_upgrade_utility.log" for the probable cause of the failure. Failure, exiting 

(почему это похоже на поиск сокровищ ...?), тогда этот журнал дает мне:

... command: "/usr/bin/psql" --echo-queries --set ON_ERROR_STOP=on --no-psqlrc --dbname=template1 --host /var/lib/pgsql --port 5432 --username postgres -f "pg_upgrade_dump_globals.sql" >> "pg_upgrade_utility.log" 2>&1 /usr/bin/psql: symbol lookup error: /usr/bin/psql: undefined symbol: PQencryptPasswordConn 

Ах! Видимо мне не хватает какого-то символа. Но как получить этот символ?

1

1 ответ на вопрос

2
Bart Friederichs

Оказалось, у меня лежали старые лиги Postgres:

[root@localhost pgsql]# ldd $(which psql) linux-vdso.so.1 (0x00007ffc3317a000) libpq.so.5 => /usr/pgsql-9.6/lib/libpq.so.5 (0x00007f27a2913000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f27a26f4000) libreadline.so.7 => /lib64/libreadline.so.7 (0x00007f27a24a7000) 

Как видите, libpqуказывает на старую версию. Простое удаление всего каталога было решением. В libpqin /lib64/были правильные символы и мое обновление прошло нормально.

Похожие вопросы