Thread: Guidance on building Foreign Data Wrapper on Windows.

Guidance on building Foreign Data Wrapper on Windows.

From
Silk Parrot
Date:
Hi Hackers,

     I am interested in writing a FDW. I setup my environment on
Windows. However, I am not able to figure out how to build FDW
successfully.  Here is what I have done:

-Install the 9.2.2 by using EnterpriseDB installer. Add bin/ to the PATH
-I have followed the windows build instruction here:
http://www.postgresql.org/docs/9.2/static/install-windows-full.html. I
can run and debug it in Visual Studio.

But when I tried to build any existing FDW via cygwin, it just tells me
this:
C:/PostgreSQL/9.2/lib/pgxs/src/makefiels/pgxs.mk: No such file or directory

There is no pgxs.mk in that folder.

I have also read 35.16 Extension Building Infrastructure
http://www.postgresql.org/docs/current/static/extend-pgxs.html. But it
doesn't tell how to get PGXS.

     Since I see that file_fdw is available on windows. I am just
wondering what's the right way to build fdw.

     Thanks in advance.

Ryan

Re: Guidance on building Foreign Data Wrapper on Windows.

From
Magnus Hagander
Date:
On Tue, Feb 12, 2013 at 8:05 AM, Silk Parrot <silkparrot@gmail.com> wrote:
> Hi Hackers,
>
>     I am interested in writing a FDW. I setup my environment on Windows.
> However, I am not able to figure out how to build FDW successfully.  Here is
> what I have done:
>
> -Install the 9.2.2 by using EnterpriseDB installer. Add bin/ to the PATH
> -I have followed the windows build instruction here:
> http://www.postgresql.org/docs/9.2/static/install-windows-full.html. I can
> run and debug it in Visual Studio.
>
> But when I tried to build any existing FDW via cygwin, it just tells me
> this:
> C:/PostgreSQL/9.2/lib/pgxs/src/makefiels/pgxs.mk: No such file or directory
>
> There is no pgxs.mk in that folder.

You cannot use cygwin to build with the native win32 version. You
should probably use mingw instead. Though even with that you probably
don't get the pgxs files - you will also need to do a source install
of PostgreSQL itself somewhere to get the required build files. This
is because the official binaries are built with the Microsoft
compilers, which don't have a build system compatible with pgxs.

You can also build it with the free compilers from MS, but thta will
at this point require you to manually set up a project file in Visual
Studio Express - but for something as simple as an FDW, that shouldn't
be every hard.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/