1

I'm trying to upgrade from 9.2 to 9.5 using the pg_upgrade tool.

I'm using CentOS 7.0

current postgres bin folder: /opt/rh/postgresql92/root/usr/bin
new postgres bin folder: /opt/rh/rh-postgresql95/root/usr/bin
current data folder: /mnt/postgres/data
new data folder: /mnt/postgres/data95

I've set the LD_LIBRARY_PATH=/opt/rh/rh-postgresql95/root/usr/lib64

When I run

/opt/rh/rh-postgresql95/root/usr/bin/pg_upgrade --link --check --old-bindir=/opt/rh/postgresql92/root/usr/bin --new-bindir=/opt/rh/rh-postgresql95/root/usr/bin --old-datadir=/mnt/postgres/data --new-datadir=/mnt/postgres/data95

I get this message :

Performing Consistency Checks
-----------------------------
Checking cluster versions                                   /opt/rh/postgresql92/root/usr/bin/pg_ctl: error while loading shared libraries: libpq.so.postgresql92-5: cannot open shared object file: No such file or directory

Could not get pg_ctl version data using "/opt/rh/postgresql92/root/usr/bin/pg_ctl" --version: No such file or directory
Failure, exiting

I'm not sure why it is trying to use the 9.2 version of pg_ctl

which pg_ctl 

returns

/opt/rh/rh-postgresql95/root/usr/bin/pg_ctl

What have I done wrong?

0

found the way to resolve this, have LD_LIBRARY_PATH with both old and new postgres bin folders

export LD_LIBRARY_PATH=/opt/rh/postgresql92/root/usr/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rh/rh-postgresql95/root/usr/lib64

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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