Recently I needed to copy some libraries to a PostgreSQL database and wasn’t sure about correct paths. My os is (still) a Centos 7 system.

So write this command:

ps -ef |grep postgres

and on the right screen you will see something like /usr/pgsql-13/bin/ just before postmaster word. So enter this directory and write the following command to find lib directory:

./pg_config --libdir