Обсуждение: pg_upgrade fails while attempting to Upgrade from postgreSQL 9.1.10 to PostgreSQL 9.3.0
--9.3 Environment settings
-bash-4.1$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bachrc ]; then
. ~/.bashrc
fi
# User specific environment and start-up programs
PATH=/sars/apps/db/9.3/bin:/usr/bin/perl:/sars/apps/db/9.3/pgAdmin3/bin:/opt/ActivePerl-5.16/site/bin:/opt/ActivePerl-5.16/bin:$PATH
LD_LIBRARY_PATH=/sars/apps/db/9.3/lib:/sars/apps/db/9.3/pgAdmin3/lib:/usr/lib64:/lib64:/usr/local/lib
PGDATA=/sars/apps/db/9.3/data
PYTHON=/usr/bin/python2.7
export PATH LD_LIBRARY_PATH PGDATA PYTHON
-bash-4.1$
-- I First successfully upgraded Postgis from 1.5.8 to postgis 2.1.1, then I executed the postgis_restore.pl to restore the data, everything was proceeding fine.
At this point I have in my 9.1.10 instance: Pg_config
-bash-4.1$ pg_config --libdir
/usr/pgsql-9.1/lib
-bash-4.1$ pg_config --pkglibdir
/usr/pgsql-9.1/lib
and in my 9.3.0 instance: Pg_config
-bash-4.1$ pg_config --pkglibdir
/storage/sars/apps/db/9.3/lib/postgresql
-bash-4.1$ pg_config --libdir
/storage/sars/apps/db/9.3/lib
-- The olddb is the original PostgreSQL 9.1.10 with Postgis 1.5.8 database.
-bash-4.1$ psql olddb
psql (9.1.10)
Type "help" for help.
olddb=# select version();
version
---------------------------------------------------------------------------------------------------------------
PostgreSQL 9.1.10 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3), 64-bit
(1 row)
olddb=# select postgis_full_version();
postgis_full_version
--------------------------------------------------------------------------------------------------------
POSTGIS="1.5.8" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.7.6" USE_STATS
(1 row)
olddb=# \connect sarsdb
You are now connected to database "sarsdb" as user "sars".
sarsdb=# select version();
version
---------------------------------------------------------------------------------------------------------------
PostgreSQL 9.1.10 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3), 64-bit
(1 row)
sarsdb=# select postgis_full_version();
postgis_full_version
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
POSTGIS="2.1.1 r12113" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="UNKNOWN" TOPOLOGY RASTER
(1 row)
-bash-4.1$ pg_upgrade -c -k -d /sars/apps/db/data -D /sars/apps/db/9.3/data -b /sars/apps/db/bin -B /sars/apps/db/9.3/bin -p 5432 -P 5432
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is a superuser ok
Checking for prepared transactions ok
Checking for reg* system OID user data types ok
Checking for contrib/isn with bigint-passing mismatch ok
Checking for presence of required libraries fatal
Your installation references loadable libraries that are missing from the
new installation. You can add these libraries to the new installation,
or remove the functions using them from the old installation. A list of
problem libraries is in the file:
loadable_libraries.txt
Failure, exiting
-bash-4.1$ cat loadable_libraries.txt
Could not load library "$libdir/rtpostgis-2.1"
ERROR: incompatible library "/storage/sars/apps/db/9.3/lib/postgresql/rtpostgis-2.1.so": version mismatch
DETAIL: Server is version 9.3, library is version 9.1.
Could not load library "$libdir/postgis-2.1"
ERROR: incompatible library "/storage/sars/apps/db/9.3/lib/postgresql/postgis-2.1.so": version mismatch
DETAIL: Server is version 9.3, library is version 9.1.
Could not load library "$libdir/postgis-1.5"
ERROR: incompatible library "/storage/sars/apps/db/9.3/lib/postgresql/postgis-1.5.so": version mismatch
DETAIL: Server is version 9.3, library is version 9.1.
Does anyone know why, the library is version 9.1, when the /storage/sars/apps/db/9.3/lib directory was created by the postgresql-9.3.0-rc1-linux-x64.run installer, and how do I get the process to point to the correct 9.3 library.
thanks
-bash-4.1$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bachrc ]; then
. ~/.bashrc
fi
# User specific environment and start-up programs
PATH=/sars/apps/db/9.3/bin:/usr/bin/perl:/sars/apps/db/9.3/pgAdmin3/bin:/opt/ActivePerl-5.16/site/bin:/opt/ActivePerl-5.16/bin:$PATH
LD_LIBRARY_PATH=/sars/apps/db/9.3/lib:/sars/apps/db/9.3/pgAdmin3/lib:/usr/lib64:/lib64:/usr/local/lib
PGDATA=/sars/apps/db/9.3/data
PYTHON=/usr/bin/python2.7
export PATH LD_LIBRARY_PATH PGDATA PYTHON
-bash-4.1$
-- I First successfully upgraded Postgis from 1.5.8 to postgis 2.1.1, then I executed the postgis_restore.pl to restore the data, everything was proceeding fine.
At this point I have in my 9.1.10 instance: Pg_config
-bash-4.1$ pg_config --libdir
/usr/pgsql-9.1/lib
-bash-4.1$ pg_config --pkglibdir
/usr/pgsql-9.1/lib
and in my 9.3.0 instance: Pg_config
-bash-4.1$ pg_config --pkglibdir
/storage/sars/apps/db/9.3/lib/postgresql
-bash-4.1$ pg_config --libdir
/storage/sars/apps/db/9.3/lib
-- The olddb is the original PostgreSQL 9.1.10 with Postgis 1.5.8 database.
-bash-4.1$ psql olddb
psql (9.1.10)
Type "help" for help.
olddb=# select version();
version
---------------------------------------------------------------------------------------------------------------
PostgreSQL 9.1.10 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3), 64-bit
(1 row)
olddb=# select postgis_full_version();
postgis_full_version
--------------------------------------------------------------------------------------------------------
POSTGIS="1.5.8" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.7.6" USE_STATS
(1 row)
olddb=# \connect sarsdb
You are now connected to database "sarsdb" as user "sars".
sarsdb=# select version();
version
---------------------------------------------------------------------------------------------------------------
PostgreSQL 9.1.10 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3), 64-bit
(1 row)
sarsdb=# select postgis_full_version();
postgis_full_version
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
POSTGIS="2.1.1 r12113" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="UNKNOWN" TOPOLOGY RASTER
(1 row)
-bash-4.1$ pg_upgrade -c -k -d /sars/apps/db/data -D /sars/apps/db/9.3/data -b /sars/apps/db/bin -B /sars/apps/db/9.3/bin -p 5432 -P 5432
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is a superuser ok
Checking for prepared transactions ok
Checking for reg* system OID user data types ok
Checking for contrib/isn with bigint-passing mismatch ok
Checking for presence of required libraries fatal
Your installation references loadable libraries that are missing from the
new installation. You can add these libraries to the new installation,
or remove the functions using them from the old installation. A list of
problem libraries is in the file:
loadable_libraries.txt
Failure, exiting
-bash-4.1$ cat loadable_libraries.txt
Could not load library "$libdir/rtpostgis-2.1"
ERROR: incompatible library "/storage/sars/apps/db/9.3/lib/postgresql/rtpostgis-2.1.so": version mismatch
DETAIL: Server is version 9.3, library is version 9.1.
Could not load library "$libdir/postgis-2.1"
ERROR: incompatible library "/storage/sars/apps/db/9.3/lib/postgresql/postgis-2.1.so": version mismatch
DETAIL: Server is version 9.3, library is version 9.1.
Could not load library "$libdir/postgis-1.5"
ERROR: incompatible library "/storage/sars/apps/db/9.3/lib/postgresql/postgis-1.5.so": version mismatch
DETAIL: Server is version 9.3, library is version 9.1.
Does anyone know why, the library is version 9.1, when the /storage/sars/apps/db/9.3/lib directory was created by the postgresql-9.3.0-rc1-linux-x64.run installer, and how do I get the process to point to the correct 9.3 library.
thanks