Download Latest Version Installer-Windows-7-EasyDeployExtensionsPack-32-64-(sqlite_fdw,www_fdw,mysql_fdw,ldap_fdw,couchdb_fdw,oracle_fdw).7z (11.2 MB)
Email in envelope

Get an email when there's a new version of postgresql-mingw-w64

Name Modified Size InfoDownloads / Week
Parent folder
lib 2013-12-07
python27.dll 2013-12-07 3.0 MB
libwinpthread-1.dll 2013-12-07 347.5 kB
mingw32-make.exe 2013-12-07 220.7 kB
i686-w64-mingw32-windres.exe 2013-12-07 804.9 kB
libtoolize 2013-12-07 78.3 kB
libtool 2013-12-07 318.5 kB
ifnames-2.68 2013-12-07 4.2 kB
ifnames-2.13 2013-12-07 2.8 kB
ifnames 2013-12-07 4.4 kB
i686-w64-mingw32-windmc.exe 2013-12-07 716.8 kB
i686-w64-mingw32-strip.exe 2013-12-07 859.6 kB
i686-w64-mingw32-strings.exe 2013-12-07 693.2 kB
i686-w64-mingw32-size.exe 2013-12-07 695.3 kB
i686-w64-mingw32-readelf.exe 2013-12-07 422.4 kB
i686-w64-mingw32-ranlib.exe 2013-12-07 718.3 kB
i686-w64-mingw32-objdump.exe 2013-12-07 1.5 MB
i686-w64-mingw32-objcopy.exe 2013-12-07 859.6 kB
i686-w64-mingw32-ld.exe 2013-12-07 991.7 kB
i686-w64-mingw32-nm.exe 2013-12-07 704.0 kB
i686-w64-mingw32-ld.bfd.exe 2013-12-07 991.7 kB
i686-w64-mingw32-gdb.exe 2013-12-07 5.5 MB
i686-w64-mingw32-jcf-dump.exe 2013-12-07 1.3 MB
i686-w64-mingw32-gprof.exe 2013-12-07 757.8 kB
i686-w64-mingw32-gfortran.exe 2013-12-07 1.7 MB
i686-w64-mingw32-gcov.exe 2013-12-07 1.2 MB
i686-w64-mingw32-gcj.exe 2013-12-07 1.8 MB
i686-w64-mingw32-gcc.exe 2013-12-07 1.7 MB
i686-w64-mingw32-gcc-4.8.0.exe 2013-12-07 1.7 MB
i686-w64-mingw32-gcc-ranlib.exe 2013-12-07 59.4 kB
i686-w64-mingw32-gcc-nm.exe 2013-12-07 59.4 kB
i686-w64-mingw32-gcc-ar.exe 2013-12-07 59.4 kB
i686-w64-mingw32-g++.exe 2013-12-07 1.7 MB
i686-w64-mingw32-cpp.exe 2013-12-07 1.7 MB
i686-w64-mingw32-elfedit.exe 2013-12-07 62.5 kB
i686-w64-mingw32-dllwrap.exe 2013-12-07 76.3 kB
i686-w64-mingw32-dlltool.exe 2013-12-07 751.6 kB
i686-w64-mingw32-c++filt.exe 2013-12-07 692.2 kB
i686-w64-mingw32-c++.exe 2013-12-07 1.7 MB
i686-w64-mingw32-as.exe 2013-12-07 1.2 MB
i686-w64-mingw32-ar.exe 2013-12-07 718.3 kB
i686-w64-mingw32-addr2line.exe 2013-12-07 693.8 kB
gettextize 2013-12-07 42.5 kB
autoupdate-2.68 2013-12-07 33.9 kB
gettext.sh 2013-12-07 4.6 kB
autoupdate 2013-12-07 4.4 kB
autoupdate-2.13 2013-12-07 3.2 kB
autoscan-2.13 2013-12-07 9.5 kB
autoscan-2.68 2013-12-07 17.2 kB
autoreconf-2.68 2013-12-07 21.1 kB
autoscan 2013-12-07 4.4 kB
autoreconf 2013-12-07 4.4 kB
autoreconf-2.13 2013-12-07 6.0 kB
automake-1.9 2013-12-07 223.1 kB
autopoint 2013-12-07 24.3 kB
automake-1.8 2013-12-07 211.0 kB
automake-1.6 2013-12-07 237.0 kB
automake-1.7 2013-12-07 270.9 kB
automake-1.5 2013-12-07 218.0 kB
automake-1.4 2013-12-07 199.7 kB
automake-1.11 2013-12-07 257.1 kB
automake-1.10 2013-12-07 233.9 kB
autom4te-2.68 2013-12-07 32.7 kB
automake 2013-12-07 4.4 kB
autom4te 2013-12-07 4.4 kB
autoheader-2.13 2013-12-07 8.6 kB
autoheader-2.68 2013-12-07 8.6 kB
autoconf-2.68 2013-12-07 14.7 kB
autoheader 2013-12-07 4.4 kB
autoconf-2.13 2013-12-07 4.9 kB
aclocal-1.8 2013-12-07 19.3 kB
autoconf 2013-12-07 4.4 kB
aclocal-1.9 2013-12-07 19.8 kB
aclocal-1.6 2013-12-07 13.3 kB
aclocal-1.7 2013-12-07 12.4 kB
aclocal-1.4 2013-12-07 12.2 kB
aclocal-1.5 2013-12-07 14.1 kB
aclocal-1.11 2013-12-07 31.2 kB
aclocal-1.10 2013-12-07 31.1 kB
aclocal 2013-12-07 4.4 kB
Totals: 80 Items   41.6 MB 2

NEW !

Support for two additional extensions (mysql_fdw and ldap_fdw) have been added to the project. (See This Wiki Page for HOWTO compile them)


Procedure for compiling PosgreSQL-9.3.1 + "sqlite_fdw" + "www_fdw":

(Using mingw-w64 - (cross-compiling => i686) / gcc 4.8.0)


Note 1:

In the following "/usr/local/" corresponds to "C:\mingw32\msys\local\", because I installed MSYS in the root directory of mingw "C:\mingw32" ...

Note 2:

See at the bottom of this page the final value for the "PATH" environment variable (to avoid missing something during the next steps of this procedure).


Setting up the system:

0.1. More handy for the next steps (change "SRCDIR" and "MGWDIR" at your convenience):

    * export ARCH="i686-w64-mingw32"; export SRCDIR="/d/32/"; 
    * export MGWDIR="/c/mingw32/" (should be the same as given in /etc/fstab)

0.2. To find the include files ".h" added later on:

    * export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/include

1.1. Intall libz [Source: http://zlib.net/zlib-1.2.8.tar.gz]

    - cd $SRCDIR"zlib-1.2.8"
    - patch win32/Makefile.gcc:
        patch win32/Makefile.gcc < ../fix-zlib-1.2.8-Makefile.gcc-mingw64.patch
    - make -f win32/Makefile.gcc
    - mkdir /usr/local/; mkdir /usr/local/bin ;mkdir /usr/local/include; mkdir /usr/local/lib;
    - cp zlib1.dll /usr/local/bin/zlib1.dll
    - cp zconf.h zlib.h /usr/local/include
    - cp libz.a /usr/local/lib
    - cp libz.dll.a /usr/local/lib/libz.dll.a

    - cp /usr/local/bin/zlib1.dll /usr/local/bin/libz.dll

1.2. Compile PostgreSQL-9.3.1 [Sources: http://ftp.postgresql.org/pub/source/v9.3.1/postgresql-9.3.1.tar.gz]

    * unzip postgresql-9.3.1.tar.gz
    * cd $SRCDIR"postgresql-9.3.1"
    * cp /usr/local/bin/libz.dll $MGWDIR$ARCH"/lib/"
    * ./configure --build=$ARCH --host=$ARCH
    * make
    * make install

        => install log:
            tout dans -> /usr/local/pgsql

    * Point to postgres utlities (pg_config.exe, ...):
        - export PATH=$PATH:/usr/local/pgsql/bin/

2.1 Compile Sqlite3 [Sources: http://www.sqlite.org/2013/sqlite-autoconf-3080100.tar.gz]

    * Download sqlite-autoconf-3080100.tar.gz (contains a "configure" script)
    * unzip
    * cd $SRCDIR"sqlite-autoconf-3080100"
    * ./configure --build=$ARCH --host=$ARCH
    * make 
    * make install

        => install log:
            sqlite3.h, sqlite3ext.h -> /usr/local/include
            libsqlite3-0.dll, sqlite3.exe -> /usr/local/bin

    * For MinGW to find the DLL while compiling "sqlite_fdw":
        - cp /usr/local/bin/libsqlite3-0.dll /usr/local/pgsql/lib/libsqlite3.dll
          [Think about removing the "-0"]

2.2 Compiling the extension sqlite_fdw

    * Get the source from SVN repository:
        - mkdir $SRCDIR"sqlite_fdw/"
        - cd $SRCDIR"sqlite_fdw"
        - svn checkout https://github.com/gleu/sqlite_fdw
    * cd $SRCDIR"sqlite_fdw/trunk"
    * make
    * make install

        => Install log:
            sqlite_fdw.dll -> /usr/local/pgsql/lib
            sqlite_fdw.control -> /usr/local/pgsql/share/extension
            sql/sqlite_fdw--0.0.1.sql -> /usr/local/pgsql/share/extension
            doc/sqlite_fdw.md -> /usr/local/pgsql/share/doc/extension

3. Compiling the extension www_fdw

  • Install iconv [Sources: http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz]

        * cd $SRCDIR"libiconv-1.14"
        * ./configure --build=$ARCH --host=$ARCH
        * make
        * make install
    
  • Install libxml2 [Sources: ftp://xmlsoft.org/libxml2/libxml2-2.9.1.tar.gz]

        * cp $WINDIR"/SysWOW64/ws2_32.dll" $MGWDIR$ARCH"/lib/libws2_32.dll"
            ("SysWOW64" - 'Sysnative' being a redirection - is the place where 32-bit versions of the libraries are located)
            [http://stackoverflow.com/q/20188451/1715716]
    
        * cd $SRCDIR"libxml2-2.9.1"
    
        * Adding Python 2.7 support:
    
            - Get the "opt" directory from "x32-4.8.0-release-win32-dwarf-rev2.7z" to "/c/mingw32"
    

    [Download: http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.0/32-bit/threads-win32/dwarf/x32-4.8.0-release-win32-dwarf-rev2.7z/download]

            - Patch by hand the very first line of "python2.7-config", "python-config" and "python2-config" into:
                #!/c/mingw32/opt/bin/python2.7.exe
                => OR, use the patch (which assumes msys's "fstab" was set correctly):
                    - cd $MGWDIR"opt/bin/"
                    - cp $SRCDIR/python-confg-files-32.patch ./
                    - patch -p1 < python-confg-files-32.patch
                    - rm python-confg-files-32.patch
    
            - cp $MGWDIR"opt/bin/libpython2.7.dll" $MGWDIR$ARCH"/lib/"
    
            - Apply patch to the originzal "configure" script of libxml2-2.9.1
                patch configure < ../fix-libxml2-2.9.1-configure-mingw64.patch
    
        * ./configure --build=$ARCH --host=$ARCH --with-zlib="/usr/local/" --with-iconv="/usr/local/" --with-python=$MGWDIR"opt/"
        * export C_INCLUDE_PATH=$C_INCLUDE_PATH:$MGWDIR"opt/include/python2.7/"
        * export LIBS="-lpython2.7"; export LDFLAGS="-L"$MGWDIR"opt/bin/"
        * make
        * make install
        * cp /usr/local/bin/libxml2-2.dll /usr/local/pgsql/lib/libxml2.dll
            [Think about removing the "-2"]
        * export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/include/libxml2
    
  • Install OpenSSL [Sources: http://www.openssl.org/source/openssl-1.0.1e.tar.gz]

        - cd $SRCDIR"openssl-1.0.1e"
    
        - Required patch: http://www.linuxfromscratch.org/patches/blfs/svn/openssl-1.0.1e-fix_parallel_build-1.patch
        - Required patch: http://www.linuxfromscratch.org/patches/blfs/svn/openssl-1.0.1e-fix_pod_syntax-1.patch
        - patch -Np1 -i ../openssl-1.0.1e-fix_parallel_build-1.patch &&
          patch -Np1 -i ../openssl-1.0.1e-fix_pod_syntax-1.patch
    
        - perl Configure mingw64 --cross-compile-prefix=$ARCH"-" shared zlib-dynamic no-asm
        - make depend
        - make
        - make install
    
  • Install curl [Sources: http://curl.haxx.se/download/curl-7.33.0.tar.gz]

        - cd $SRCDIR"curl-7.33.0/"
        - ./configure --build=$ARCH --host=$ARCH --with-ssl="/usr/local/ssl" --with-zlib="/usr/local/"
    
                    >> configure output: Configured to build curl/libcurl:
    
                          curl version:     7.33.0
                          Host setup:       i686-w64-mingw32
                          Install prefix:   /usr/local
                          Compiler:         gcc
                          SSL support:      enabled (OpenSSL)
                          SSH support:      no      (--with-libssh2)
                          zlib support:     enabled
                          GSSAPI support:   no      (--with-gssapi)
                          SPNEGO support:   no      (--with-spnego)
                          TLS-SRP support:  enabled
                          resolver:         default (--enable-ares / --enable-threaded-resolver)
                          ipv6 support:     no      (--enable-ipv6)
                          IDN support:      no      (--with-{libidn,winidn})
                          Build libcurl:    Shared=yes, Static=no
                          Built-in manual:  enabled
                          --libcurl option: enabled (--disable-libcurl-option)
                          Verbose errors:   enabled (--disable-verbose)
                          SSPI support:     no      (--enable-sspi)
                          ca cert bundle:   no
                          ca cert path:     no
                          LDAP support:     enabled (winldap)
                          LDAPS support:    enabled
                          RTSP support:     enabled
                          RTMP support:     no      (--with-librtmp)
                          metalink support: no      (--with-libmetalink)
                          HTTP2 support:    disabled (--with-nghttp2)
                          Protocols:        DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS 
                                            POP3 POP3S RTSP SMTP SMTPS TELNET TFTP
    
        - make
        - make install
        - cp /usr/local/bin/libcurl-4.dll /usr/local/pgsql/lib/libcurl.dll
            [Think about removing "-4"]
    
  • Get the source from SVN repository

        - mkdir $SRCDIR"www_fdw/"
        - cd $SRCDIR"www_fdw"
        - svn checkout https://github.com/gleu/www_fdw
    
  • Patch source file $SRCDIR"www_fdw/trunk/src/utils.h"

        - patch trunk/src/utils.h < ../fix-www_fdw-utils.h-mingw64.patch
    
  • Build

        * cd $SRCDIR"www_fdw/trunk"
        * make
        * make install
    
            => Install log:
                www_fdw.dll -> /usr/local/pgsql/lib
                www_fdw.control -> /usr/local/pgsql/share/extension
                sql/www_fdw--0.1.6.sql -> /usr/local/pgsql/share/extension
    

Testing the extensions (Windows Prompt):

1. Add "C:\mingw32\msys\local\pgsql\bin" and "C:\mingw32\msys\local\pgsql\lib" to $PATH 2. Add "C:\mingw32\msys\local\bin" to $PATH (accessing "libsqlite3-0.dll", "sqlite3.exe") 3. Add "C:\mingw32\msys\bin" to $PATH (accessing "msys-iconv-2.dll", "msys-1.0.dll")

4. Initialize the "data" (database) directory for the server:

    * cd C:\mingw32\msys\local\pgsql\
    * bin\initdb -Ddata

5. Start the PostgreSQL server:

    * bin\postgres -Ddata

6. Create the superuser and role "postgres" (asking for password)

    * bin\createuser -s -r -W postgres

7.1. Creating and testing the sqlite_fdw extension (depends on sqlite3.dll):

    * CREATE EXTENSION sqlite_fdw;

    * cd D:\postgresql-test-extensions
    * Create a sqlite database (file "test.db")
        [or use the one I provide]

        - cd /usr/local/bin
        - sqlite3 "test.db"

                SQLite version 3.8.1 2013-10-17 12:57:35
                Enter ".help" for instructions
                Enter SQL statements terminated with a ";"
                sqlite> create table tbl1(one varchar(10), two smallint);
                sqlite> insert into tbl1 values('hello!',10);
                sqlite> insert into tbl1 values('goodbye', 20);
                sqlite> select * from tbl1;
                hello!|10
                goodbye|20
                sqlite>

    * Into the "postgres" database, create the sqlite server:

        CREATE SERVER sqlite_server
          FOREIGN DATA WRAPPER sqlite_fdw
          OPTIONS (database 'D:\postgresql-test-extxtensions\test.db'); /* adapt to your config. */

    * Mapping between "tbl1" (sqlite DB) and the new "local_tbl1"
        CREATE FOREIGN TABLE local_tbl1(one varchar(10), two smallint)
          SERVER sqlite_server
          OPTIONS (table 'tbl1');

    * Executing a request:
        SELECT * from local_tbl1;

7.2. Creating and testing the extension www_fdw (depends on iconv.dll and libxml2.dll)

    * CREATE EXTENSION www_fdw;

    * Create a server (example with a "google search" one...):
        [Example grabbed from: https://github.com/cyga/www_fdw/wiki/Examples]

        CREATE SERVER www_fdw_google_search_server FOREIGN DATA WRAPPER www_fdw 
            OPTIONS (
                uri 'https://ajax.googleapis.com/ajax/services/search/web?v=1.0',
                cainfo 'C:\mingw32\msys\local\share\curl\curl-ca-bundle.crt'
                );
        /* Adapt "cainfo" option to your config. The path MUST be written the Windows way */

        CREATE USER MAPPING FOR current_user SERVER www_fdw_google_search_server;

        CREATE FOREIGN TABLE www_fdw_google_search (
          title text,
          link text,
          snippet text,
          q text /* used for easy query specifying */
        ) SERVER www_fdw_google_search_server;

        Note:   "curl --with-ssl" (the default) requiring a certificate, 
        -----   this example only works if we specify the "cainfo" option 
                (".crt" certificate file)

    * Request:
        SELECT title,snippet FROM www_fdw_google_search WHERE q='cat dog' LIMIT 3;

PATH environment variable:

    C:\mingw32\bin;
    C:\mingw32\lib;
    C:\mingw32\msys\local\pgsql\bin;
    C:\mingw32\msys\local\pgsql\lib;
    C:\mingw32\msys\local\bin;
    C:\mingw32\msys\bin;
    C:\mingw32\msys\local\ssl\bin;
    C:\mingw32\i686-w64-mingw32\bin;
    C:\mingw32\i686-w64-mingw32\lib;
    C:\mingw32\opt\bin;

=>

    SET PATH=%PATH%;C:\mingw32\bin;C:\mingw32\lib;C:\mingw32\i686-w64-mingw32\bin;C:\mingw32\msys\local\pgsql\bin;C:\mingw32\msys\local\pgsql\lib;C:\mingw32\msys\local\bin;C:\mingw32\msys\bin;C:\mingw32\msys\local\ssl\bin;C:\mingw32\i686-w64-mingw32\lib;C:\mingw32\opt\bin;

OR, using MSYS:

    export PATH=$PATH:$MGWDIR"bin":$MGWDIR"lib":$MGWDIR$ARCH"/bin:/usr/local/pgsql/bin":/usr/msys/local/pgsql/lib:/usr/local/bin:/usr/bin:/usr/local/ssl/bin:$MGWDIR$ARCH"/lib":$MGWDIR"opt/bin"

TODO: create a ".sh" script that builds the standalone version from the mingw-32/64's install directory. (Identical script for both 32 and 64-bit versions using the environment variables: $ARCH, $SRCDIR and $MGWDIR)

01_Piwik_img

Source: README.md, updated 2013-12-29