Db2

Db2

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  DB2 foreign data wrapper - db2_fdw.dll

    Posted Wed November 13, 2024 11:14 AM

    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
    ------------------------------


  • 2.  RE: DB2 foreign data wrapper - db2_fdw.dll

    Posted Wed November 13, 2024 01:18 PM

    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
    ------------------------------



  • 3.  RE: DB2 foreign data wrapper - db2_fdw.dll

    Posted Tue April 15, 2025 08:23 AM

    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
    ------------------------------



  • 4.  RE: DB2 foreign data wrapper - db2_fdw.dll

    Posted Tue April 15, 2025 12:52 PM

    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.

    Building db2_fdw:

    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:

    $ make
    $ make install
    

    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

    $ make NO_PGXS=1
    


    ------------------------------
    Jan Nelken
    Support engineer
    Persistent Systems Ltd
    Cracow
    +48 783 109 863
    ------------------------------



  • 5.  RE: DB2 foreign data wrapper - db2_fdw.dll

    Posted Tue April 15, 2025 12:58 PM

    PS.

    You can get all the source files (like IKEA says - some assembly required):








    ------------------------------
    Jan Nelken
    Support engineer
    Persistent Systems Ltd
    Cracow
    +48 783 109 863
    ------------------------------