The path to pg_config is added to the PATH variable on installation, but if it was not done automatically for some reason, you can add it manually by adding
export PATH="$PATH:/path/to/postgresql/installation/bin"
at the end of .bashrc
or .bash_profile
files and then using source ~/.bashrc
If you do not know the original path of the pg_config file, you can use the command find . -name pg_config
. The pg_config file which we need is directly under the bin directory.
After exporting you can check it by using which pg_config
. This should return the path to the executable file.