If you want to use an existing Postgres application with vFabric Postgres, you can relink the application.

Because vFabric Postgres libpq.so is dynamically linked with libssl, the static ld linker does not recognize the rpath of $ORIGIN. You can relink to specify the rpath.

Install the vFabric Postgres client tools. You can relink without installing the development RPMs.

Relink with vFabric Postgres based on your operating system.

Operating System

Relinking Process

Linux

a

See /opt/vmware/vpostgres/current/share/libpq-doc/README.vpostgres-libpq.

b

Override the dynamic library search path by adding /opt/vmware/vpostgres/current/lib-public to LD_LIBRARY_PATH.

# export LD_LIBRARY_PATH=/opt/vmware/vpostgres/current/lib-public
# mypgapp

- or -

c

Relink using the vFabric Postgres libpq.

# gcc -o t t.c -L/opt/vmware/vpostgres/current/lib -Wl,'-rpath=/opt/vmware/vpostgres/current/lib' -lpq

Windows

Copy libpq and other libraries to the directory of the application binaries and relink.

By default , the libraries and header files are in the following locations.

Development libraries

C:\Program Files\VMware\vPostgres\9.1\dev

libpgport.lib and libpq.lib libraries

C:\Program Files\VMware\vPostgres\9.1\dev\lib

libpq header files

C:\Program Files\VMware\vPostgres\9.1\dev\include

Mac OS X

Perform one of the following tasks.

Override the dynamic library search path by adding the /opt/vmware/vpostgres/9.1/lib to the DYLD_LIBRARY_PATH environment variable, as follows:

# export DYLD_LIBRARY_PATH=/opt/vmware/vpostgres/9.1/lib
# mypgapp

Relink using the vFabric Postgres libpq library during compilation. Relinking requires the Xcode developer toolset. For example, to embed the full path of libpq.dylib in the executable binary mypgapp, run this command.

# gcc -o mypgapp mypgapp.c -L/opt/vmware/vpostgres/9.1/lib -lpq 

Relink using the vFabric Postgres libpq after compilation. Relinking requires the Xcode developer toolset.

Note

This changes the binary to use vPostgres libpq

# install_name_tool -change "/usr/lib/libpq.5.dylib" "/opt/vmware/vpostgres/9.1/lib/libpq.5.dylib" mypgapp

To confirm which library is linked, run this command.

# otool -L mypgapp