17
votes

I installed Python 2.7.8 and pgxn client. And I tried to run this statement from command line from the bin folder and path is setup correctly

pgxnclient install  http://api.pgxn.org/dist/pg_repack/1.2.1/pg_repack-1.2.1.zip

But I got an error pg_config executable not found.

2
I have no idea if pgxn supports Windows at all. Given that PGXS (the compilation system for extensions) doesn't support Windows, I rather doubt it can work for any extension that requires C compilation. - Craig Ringer
Mladen, what operating system are you trying this on? You will need pg_config available, as well as the PostgreSQL headers installed (if installing on Linux from a packaging system, there is usually a -dev package needed). In case you are trying this on Windows, pg_repack is basically untested/unsupported on Windows. - Josh Kupershmidt
I am using the Win 7 x64 bit as stated in the question. I am just exploring the PostgreSQL. It seems that the best way to use it is on linux. There is a project inside the zip file for 2010, but I need to adapt it for PostgreSQL 9.3 which I am using. It will wait for some time. - Mladen Uzelac
@Mladen I would be interested if you successfully compiled it for PG 9.3 under Visual 2010. - JB. With Monica.
I didn't and currently I am not planning to. I tried PostgreSQL on linux and it's much more performant and easier to use. In future I'll be using more Linux and software running on it. ;) PS. I had a lot of hassle to configure Visual studio for compiling 64 bit, I recommend to use VS 2012 immediately. - Mladen Uzelac

2 Answers

29
votes

Bakground: pg_config is the configuration utility provided by PostgreSQL. This utility is used by various applications.

Solution:

  1. Install PostgreSQL.
  2. Set the path. System Properties > Advanced

    PATH:C:\Program Files (x86)\PostgreSQL\9.4\bin\;

From this point on, any application that requires pg_config can find it here.

I suggest this method because the build is directly from the author. You can also find viable alternatives for standalone pg_config builds.

3
votes

I had this same error, and pg_config was in my path

You can try

pgxnclient install --pg_config "c:\path\to\pg_config.exe" $extensionName

You almost definitely need to run cmd.exe as an admin