Several errors occur when attempting to create a function included in a self-written C library file.
Error 1:
# CREATE OR REPLACE FUNCTION containsprofanity(text) # RETURNS bool # AS '$libdir/searchterms','containsprofanity' # LANGUAGE C WITH (iscachable, isstrict); ERROR: could not access file "$libdir/searchterms": No such file or directory
Error 2:
# CREATE OR REPLACE FUNCTION containsprofanity(text) # RETURNS bool # AS '$libdir/searchterms','containsprofanity' # LANGUAGE C WITH (iscachable, isstrict); ERROR: could not load library "/usr/local/greenplum-db-4.3.8.1/lib/postgresql/searchterms.so": /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/local/greenplum-db-4.3.8.1/lib/postgresql/searchterms.so)
Error 3:
# CREATE OR REPLACE FUNCTION containsprofanity(text) # RETURNS bool # AS '$libdir/searchterms','containsprofanity' # LANGUAGE C WITH (iscachable, isstrict); ERROR: could not load library "/usr/local/greenplum-db-4.3.8.1/lib/postgresql/searchterms.so": /usr/local/greenplum-db-4.3.8.1/lib/postgresql/searchterms.so: undefined symbol: MemoryContextAlloc
Error 1
The library file was put to $GPHOME/lib/
which is not correct for GPDB. Instead it should be in $GPHOME/lib/postgresql/M/code>
Error 2
Library file
searchterms.so
was compiled on a system with different version of GLIBC from system running GPDB software. In this case GPDB system has GLIBC_2.12
, however searchterms.so
was built in a system with GLIBC_2.14
.
Error 3
The library file was built in a non-GPDB environment containing some symbol that is not provided by GPDB libraries. In this case
searchterms.so
was built in Postgresql environment instead of GPDB.
Error 1
Put the library file to $GPHOME/lib/postgresql/
Error 2
Build library file in a system which has compatible GLIBC with the one running GPDB software.
Error 3
Rebuild the library file in a GPDB environment by sourcing greenplum_path.sh
to let compiler link libraries shipped with GPDB.