Hi Mark
Try to read and follow the installation steps from readme file; db2_fdw.h is a header file used (with Db2 header files) to compile db2_fdw.c C source file.
You will need C compiler as well.
6 Installation
If you use a binary distribution of db2_fdw, skip to "Installing the extension" below.
db2_fdw has been written as a PostgreSQL extension and uses the Extension Building Infrastructure PGXS. It should be easy to install.
You will need PostgreSQL headers and PGXS installed (if your PostgreSQL was installed with packages, install the development package). You need to install DB2's C header files as well (SDK package for Instant Client). If you use the Instant Client ZIP files provided by DB2 and you are not on Windows, you will have to create a symbolic link from libclntsh.so
to the actual shared library file yourself.
Make sure that PostgreSQL is configured --without-ldap
(at least the server). See the Problems section.
Make sure that pg_config
is in the PATH (test with pg_config --pgxs
). Set the environment variable DB2_HOME to the location of the DB2 installation.
Unpack the source code of db2_fdw and change into the directory. Then the software installation should be as simple as:
For the second step you need write permission on the directories where PostgreSQL is installed.
If you want to build db2_fdw in a source tree of PostgreSQL, use
------------------------------
Jan Nelken
Support engineer
Persistent Systems Ltd
Cracow
+48 783 109 863
------------------------------
Original Message:
Sent: Tue April 15, 2025 08:23 AM
From: Mark Gillis
Subject: DB2 foreign data wrapper - db2_fdw.dll
Hi Jan
I'm on a similar journey to establish a Federated access from PostgreSQL to Db2. I have followed the links you provided above but I am struggling to get the db2_fdw wrapper installed. The GitHub that Wolfgang has published contains several different modules called db2_fdw.* but the instructions state
Unpack the source code of db2_fdw and change into the directory
I'm not clear which source code that would be. There is reference to a tar ball but I don't see that. Elsewhere there is reference to the two modules db2_fdw.h and db2_fdw.c having to be separate entities but not how they would be installed. I'm missing something basic here; could you give me a couple of pointers?
------------------------------
Mark Gillis
Principal Consultant
Triton Consulting
Original Message:
Sent: Wed November 13, 2024 01:17 PM
From: Jan Nelken
Subject: DB2 foreign data wrapper - db2_fdw.dll
Did you consider using tool called Google?
1. https://github.com/wolfgangbrandl/db2_fdw
2. https://pgxn.org/dist/db2_fdw/doc/db2_fdw.html
3. https://www.cybertec-postgresql.com/en/wrapping-db2-with-postgresql/
------------------------------
Jan Nelken
Original Message:
Sent: Wed November 13, 2024 08:40 AM
From: Aditya Balraj Menon
Subject: DB2 foreign data wrapper - db2_fdw.dll
Hi,
I am a data engineer and i am currently trying to build a foreign data wrapper from Postgres to DB2. This requires a DB2 extension to be available in postgres which includes a control file, SQL file and a db2_fdw.ddl file. However, i do not have the DDL file for the aforementioned. Can anybody provide insight as to how to generate one, get one or if anyone has it, can it be shared?
------------------------------
Aditya Balraj Menon
------------------------------