error: could not load library ~ undefined symbol: errcontext

813 Views Asked by At

First, I installed oracle_fdw and oracle instant client. Second, I set LD_LIBRARY_PATH and ORACLE_HOME (~/.bash_profile). Finally, I ran the make command in the oracle_fdw directory. I installed the oracle_fdw extension as above, but an error occurred.

# login
$ su - postgres

# set system path
$ sudo vim .bash_profile
export LD_LIBRARY_PATH=/oracle_fdw/instantclient_11_2
export ORACLE_HOME=/oracle_fdw/instantclient_11_2
export PG_CONFIG=/usr/pgsql-11/bin
PATH=$LD_LIBRARY_PATH:$PG_CONFIG:$PATH:$HOME/bin
export PATH
PGDATA=/var/lib/pgsql/11/data
export PGDATA

# PostgreSQL Server stop/start
$ cd /usr/pgsql-11/bin
$ ./pg_ctl stop
$ ./pg_ctl start

# make start
$ sudo make clean
$ sudo make
$ sudo make install 

# psql login
$ pgsql -p 15432

postgres=# create extension oracle_fdw; 

The current error was that the path that the previous version was seeing as the master and the Postgresql path that the current user was looking at were different. So, I copied all the extensions and libraries to the path based on the previous version. However, the file is still created with the same old version path and the library fails to load.

As shown below, even if I tried to change the --prefix setting, the problem occurred because ./configure was not supported in oracle_fdw.

$ ./configure --prefix=/usr/pgsql-11

Can you solve this problem?

Details about your comment.

# oracle_fdw build
$ sudo make install
/usr/pgsql-11/bin/mkdir -p '/usr/lib64/pgsql'
/usr/pgsql-11/bin/mkdir -p '/usr/share/pgsql/extension'
/usr/pgsql-11/bin/mkdir -p '/usr/share/pgsql/extension'
/usr/pgsql-11/bin/mkdir -p '/usr/share/doc/pgsql/extension'
/bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 755  oracle_fdw.so '/usr/lib64/pgsql/oracle_fdw.so'
/bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644 ./oracle_fdw.control '/usr/share/pgsql/extension/'
/bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644 ./oracle_fdw--1.1.sql ./oracle_fdw--1.0--1.1.sql  '/usr/share/pgsql/extension/'
/bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644 ./README.oracle_fdw '/usr/share/doc/pgsql/extension/'

#postgreSQL version : 11.15 (before version 9.2.24)

#oracle_fdw version : 1.5.0

#postgreSQL directory : /usr/bin OR /usr/pgsql-11/bin

I want to install relative to /usr/pgsql-11/bin and not /usr/bin. However, the current --prefix is ​​set to /usr, so make install is not possible with the desired path.

1

There are 1 best solutions below

0
On

oracle_fdw version : 2.4.0

If you run make using the latest version of oracle_fdw, the following error occurs.

$ sudo make clean
$ sudo make
gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DLINUX_OOM_SCORE_ADJ=0 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fPIC -I"/sdk/include" -I"/oci/include" -I"/rdbms/public" -I"/" -I/usr/include/oracle/21/client64 -I/usr/include/oracle/19.12/client64 -I/usr/include/oracle/19.12/client -I/usr/include/oracle/19.11/client64 -I/usr/include/oracle/19.11/client -I/usr/include/oracle/19.10/client64 -I/usr/include/oracle/19.10/client -I/usr/include/oracle/19.9/client -I/usr/include/oracle/19.9/client64 -I/usr/include/oracle/19.8/client -I/usr/include/oracle/19.8/client64 -I/usr/include/oracle/19.6/client -I/usr/include/oracle/19.6/client64 -I/usr/include/oracle/19.3/client -I/usr/include/oracle/19.3/client64 -I/usr/include/oracle/18.5/client -I/usr/include/oracle/18.5/client64 -I/usr/include/oracle/18.3/client -I/usr/include/oracle/18.3/client64 -I/usr/include/oracle/12.2/client -I/usr/include/oracle/12.2/client64 -I/usr/include/oracle/12.1/client -I/usr/include/oracle/12.1/client64 -I/usr/include/oracle/11.2/client -I/usr/include/oracle/11.2/client64 -I/usr/include/oracle/11.1/client -I/usr/include/oracle/11.1/client64 -I/usr/include/oracle/10.2.0.5/client -I/usr/include/oracle/10.2.0.5/client64 -I/usr/include/oracle/10.2.0.4/client -I/usr/include/oracle/10.2.0.4/client64 -I/usr/include/oracle/10.2.0.3/client -I/usr/include/oracle/10.2.0.3/client64 -I. -I. -I/usr/include/pgsql/server -I/usr/include/pgsql/internal -D_GNU_SOURCE -I/usr/include/libxml2   -c -o oracle_fdw.o oracle_fdw.c
oracle_fdw.c:11:33: fatal error: access/htup_details.h: No such file or directory
 #include "access/htup_details.h"
                                 ^
compilation terminated.
make: *** [oracle_fdw.o] Error 1

Since the default prefix value is /usr, if you want to change the installation path, you need to change the prefix value.

If I solve the current path problem, it seems to work fine, but even if I try to change the --prefix value, I can't find a file that can be changed.