Error pg config executable not found


Introduction

error pg config executable not found is an error message that can occur when installing the postgres database. Several things can cause this, but the most common cause is that the postgres package is not installed on your system.

What is the error?

This error indicates that the pgc onfig executable was not found in your system path. This is required for PostgreSQL development and cannot be resolved without this executable.

What causes the error?


The error message “error pg config executable not found” is caused by a misconfiguration in the PostgreSQL settings. This can happen if the PostgreSQL version is not set correctly, or if the wrong path is set for the pgconfig executable.

To fix this, you will need to edit the PostgreSQL configuration file (postgresql.conf) and set the correct values for the following parameters:

postgresql_version – This should be set to the version of PostgreSQL that you are using. For example, 9.3 for PostgreSQL 9.3
pgconfig_executable – This should be set to the full path of the pgconfig executable. For example, /usr/local/bin/pgconfig

Once you have modified the configuration file, you will need to restart the PostgreSQL server for the changes to take effect.

How to fix the error?

The error pgconfig executable not found is a very common error when trying to install PostgreSQL on Windows. This error can be caused by a couple of different things, but the most common cause is that the PostgreSQL install path is not added to the Windows PATH environment variable. To fix this, simply add the PostgreSQL install path to the Windows PATH environment variable and restart your computer. You can do this by following these steps:

  1. Open the Control Panel and go to System > Advanced system settings.
  2. In the Advanced tab, click on Environment Variables.
  3. In the Environment Variables window, click on New in the System variables section.
  4. In the New System Variable dialog, enter PGDATA for the Variable name and C:\Program Files\PostgreSQL\9.6\data for the Variable value. Click OK to save your changes.
  5. In the Environment Variables window, click on New in the User variables section.
  6. In the New User Variable dialog, enter PATH for the Variable name and C:\Program Files\PostgreSQL\9.6\bin for the Variable value. Click OK to save your changes.
  7. Restart your computer for the changes to take effect and try installing PostgreSQL again
    Conclusion

    If you receive the error message “error pgconfig executable not found”, it means that the pg_config program could not be found in your PATH. pg_config is required to build PostgreSQL extensions, such as those needed for PostGIS.

There are a few ways to solve this problem:

  • Add the directory containing pg_config to your PATH. For example, if pg_config is in /usr/local/bin, you can add that directory to your PATH with the following command:
export PATH="/usr/local/bin:$PATH"
  • Install the postgresql-server-dev-X.Y package, which will provide the necessary header files and pg_config. For example, for PostgreSQL 9.4, you would install the postgresql-server-dev-9.4 package. Whether or not this package is available depends on your operating system; if it’s not available, try installing from source (see below).
  • Install PostgreSQL from source. This will provide everything you need to build extensions, including pg_config.

Leave a Reply

Your email address will not be published.