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
__init__.pyc 2013-12-07 4.4 kB
__init__.pyo 2013-12-07 4.6 kB
__init__.py 2013-12-07 5.7 kB
zlib_codec.pyo 2013-12-07 5.4 kB
zlib_codec.py 2013-12-07 3.0 kB
zlib_codec.pyc 2013-12-07 5.5 kB
uu_codec.pyo 2013-12-07 5.5 kB
uu_codec.py 2013-12-07 3.7 kB
uu_codec.pyc 2013-12-07 5.6 kB
utf_8_sig.pyc 2013-12-07 6.0 kB
utf_8_sig.pyo 2013-12-07 6.0 kB
utf_8_sig.py 2013-12-07 3.7 kB
utf_8.pyc 2013-12-07 2.4 kB
utf_8.pyo 2013-12-07 2.4 kB
utf_7.pyo 2013-12-07 2.3 kB
utf_8.py 2013-12-07 1.0 kB
utf_7.py 2013-12-07 946 Bytes
utf_7.pyc 2013-12-07 2.3 kB
utf_32_le.pyo 2013-12-07 2.3 kB
utf_32_le.py 2013-12-07 930 Bytes
utf_32_le.pyc 2013-12-07 2.3 kB
utf_32_be.pyc 2013-12-07 2.3 kB
utf_32_be.pyo 2013-12-07 2.3 kB
utf_32.pyo 2013-12-07 6.9 kB
utf_32_be.py 2013-12-07 930 Bytes
utf_32.py 2013-12-07 5.1 kB
utf_32.pyc 2013-12-07 6.9 kB
utf_16_le.pyc 2013-12-07 2.4 kB
utf_16_le.pyo 2013-12-07 2.4 kB
utf_16_be.pyo 2013-12-07 2.4 kB
utf_16_le.py 2013-12-07 1.0 kB
utf_16_be.py 2013-12-07 1.0 kB
utf_16_be.pyc 2013-12-07 2.4 kB
utf_16.pyc 2013-12-07 6.2 kB
utf_16.pyo 2013-12-07 6.2 kB
unicode_internal.pyo 2013-12-07 2.7 kB
utf_16.py 2013-12-07 4.0 kB
unicode_escape.pyo 2013-12-07 2.6 kB
unicode_internal.pyc 2013-12-07 2.7 kB
unicode_internal.py 2013-12-07 1.2 kB
unicode_escape.pyc 2013-12-07 2.6 kB
undefined.pyo 2013-12-07 3.2 kB
unicode_escape.py 2013-12-07 1.2 kB
undefined.py 2013-12-07 1.3 kB
undefined.pyc 2013-12-07 3.2 kB
tis_620.py 2013-12-07 12.6 kB
tis_620.pyo 2013-12-07 3.5 kB
string_escape.pyo 2013-12-07 2.5 kB
tis_620.pyc 2013-12-07 3.5 kB
string_escape.pyc 2013-12-07 2.5 kB
shift_jis_2004.pyo 2013-12-07 2.2 kB
string_escape.py 2013-12-07 953 Bytes
shift_jis_2004.pyc 2013-12-07 2.2 kB
shift_jis_2004.py 2013-12-07 1.1 kB
shift_jisx0213.pyc 2013-12-07 2.2 kB
shift_jisx0213.pyo 2013-12-07 2.2 kB
shift_jis.pyo 2013-12-07 2.2 kB
shift_jisx0213.py 2013-12-07 1.1 kB
shift_jis.py 2013-12-07 1.0 kB
shift_jis.pyc 2013-12-07 2.2 kB
rot_13.pyc 2013-12-07 4.3 kB
rot_13.pyo 2013-12-07 4.3 kB
raw_unicode_escape.pyo 2013-12-07 2.7 kB
rot_13.py 2013-12-07 2.6 kB
raw_unicode_escape.pyc 2013-12-07 2.7 kB
quopri_codec.pyo 2013-12-07 4.2 kB
raw_unicode_escape.py 2013-12-07 1.2 kB
quopri_codec.py 2013-12-07 2.1 kB
quopri_codec.pyc 2013-12-07 4.3 kB
punycode.pyc 2013-12-07 9.2 kB
punycode.pyo 2013-12-07 9.2 kB
ptcp154.pyo 2013-12-07 5.5 kB
punycode.py 2013-12-07 6.8 kB
ptcp154.py 2013-12-07 8.9 kB
ptcp154.pyc 2013-12-07 5.5 kB
palmos.py 2013-12-07 2.9 kB
palmos.pyo 2013-12-07 3.6 kB
palmos.pyc 2013-12-07 3.6 kB
mbcs.pyc 2013-12-07 2.4 kB
mbcs.pyo 2013-12-07 2.4 kB
mbcs.py 2013-12-07 1.2 kB
mac_turkish.py 2013-12-07 13.8 kB
mac_turkish.pyc 2013-12-07 3.5 kB
mac_turkish.pyo 2013-12-07 3.5 kB
mac_romanian.pyo 2013-12-07 3.5 kB
mac_romanian.py 2013-12-07 13.9 kB
mac_romanian.pyc 2013-12-07 3.5 kB
mac_roman.pyc 2013-12-07 3.5 kB
mac_roman.pyo 2013-12-07 3.5 kB
mac_latin2.pyo 2013-12-07 5.5 kB
mac_roman.py 2013-12-07 13.7 kB
mac_latin2.py 2013-12-07 8.6 kB
mac_latin2.pyc 2013-12-07 5.5 kB
mac_iceland.pyc 2013-12-07 3.5 kB
mac_iceland.pyo 2013-12-07 3.5 kB
mac_iceland.py 2013-12-07 13.8 kB
mac_greek.pyo 2013-12-07 3.5 kB
mac_greek.py 2013-12-07 14.0 kB
mac_greek.pyc 2013-12-07 3.5 kB
mac_farsi.pyo 2013-12-07 3.4 kB
mac_farsi.py 2013-12-07 15.4 kB
mac_farsi.pyc 2013-12-07 3.4 kB
mac_cyrillic.pyc 2013-12-07 3.5 kB
mac_cyrillic.pyo 2013-12-07 3.5 kB
mac_croatian.pyo 2013-12-07 3.5 kB
mac_cyrillic.py 2013-12-07 13.7 kB
mac_croatian.py 2013-12-07 13.9 kB
mac_croatian.pyc 2013-12-07 3.5 kB
mac_centeuro.pyo 2013-12-07 3.5 kB
mac_centeuro.py 2013-12-07 14.4 kB
mac_centeuro.pyc 2013-12-07 3.5 kB
mac_arabic.py 2013-12-07 36.7 kB
mac_arabic.pyo 2013-12-07 8.6 kB
mac_arabic.pyc 2013-12-07 8.6 kB
latin_1.pyc 2013-12-07 2.8 kB
latin_1.pyo 2013-12-07 2.8 kB
koi8_u.pyo 2013-12-07 3.5 kB
latin_1.py 2013-12-07 1.3 kB
koi8_u.py 2013-12-07 14.0 kB
koi8_u.pyc 2013-12-07 3.5 kB
koi8_r.pyc 2013-12-07 3.5 kB
koi8_r.pyo 2013-12-07 3.5 kB
koi8_r.py 2013-12-07 14.0 kB
johab.pyc 2013-12-07 2.1 kB
johab.pyo 2013-12-07 2.1 kB
iso8859_9.pyo 2013-12-07 3.4 kB
johab.py 2013-12-07 1.0 kB
iso8859_9.py 2013-12-07 13.4 kB
iso8859_9.pyc 2013-12-07 3.4 kB
iso8859_8.py 2013-12-07 11.3 kB
iso8859_8.pyc 2013-12-07 3.5 kB
iso8859_8.pyo 2013-12-07 3.5 kB
iso8859_7.pyo 2013-12-07 3.5 kB
iso8859_7.py 2013-12-07 13.1 kB
iso8859_7.pyc 2013-12-07 3.5 kB
iso8859_6.py 2013-12-07 11.1 kB
iso8859_6.pyo 2013-12-07 3.5 kB
iso8859_6.pyc 2013-12-07 3.5 kB
iso8859_5.pyc 2013-12-07 3.4 kB
iso8859_5.pyo 2013-12-07 3.4 kB
iso8859_4.pyo 2013-12-07 3.4 kB
iso8859_5.py 2013-12-07 13.3 kB
iso8859_4.py 2013-12-07 13.6 kB
iso8859_4.pyc 2013-12-07 3.4 kB
iso8859_3.pyc 2013-12-07 3.5 kB
iso8859_3.pyo 2013-12-07 3.5 kB
iso8859_2.pyo 2013-12-07 3.4 kB
iso8859_3.py 2013-12-07 13.3 kB
iso8859_2.py 2013-12-07 13.7 kB
iso8859_2.pyc 2013-12-07 3.4 kB
iso8859_16.pyo 2013-12-07 3.5 kB
iso8859_16.py 2013-12-07 13.8 kB
iso8859_16.pyc 2013-12-07 3.5 kB
iso8859_15.pyo 2013-12-07 3.5 kB
iso8859_15.py 2013-12-07 13.5 kB
iso8859_15.pyc 2013-12-07 3.5 kB
iso8859_14.pyc 2013-12-07 3.5 kB
iso8859_14.pyo 2013-12-07 3.5 kB
iso8859_13.pyo 2013-12-07 3.5 kB
iso8859_14.py 2013-12-07 13.9 kB
iso8859_13.py 2013-12-07 13.5 kB
iso8859_13.pyc 2013-12-07 3.5 kB
iso8859_11.pyc 2013-12-07 3.6 kB
iso8859_11.pyo 2013-12-07 3.6 kB
iso8859_10.pyo 2013-12-07 3.5 kB
iso8859_11.py 2013-12-07 12.6 kB
iso8859_10.py 2013-12-07 13.8 kB
iso8859_10.pyc 2013-12-07 3.5 kB
iso8859_1.pyc 2013-12-07 3.4 kB
iso8859_1.pyo 2013-12-07 3.4 kB
iso2022_kr.pyo 2013-12-07 2.2 kB
iso8859_1.py 2013-12-07 13.4 kB
iso2022_kr.py 2013-12-07 1.1 kB
iso2022_kr.pyc 2013-12-07 2.2 kB
iso2022_jp_ext.pyc 2013-12-07 2.2 kB
iso2022_jp_ext.pyo 2013-12-07 2.2 kB
iso2022_jp_3.pyo 2013-12-07 2.2 kB
iso2022_jp_ext.py 2013-12-07 1.1 kB
iso2022_jp_3.pyc 2013-12-07 2.2 kB
iso2022_jp_3.py 2013-12-07 1.1 kB
iso2022_jp_2004.pyo 2013-12-07 2.2 kB
iso2022_jp_2.pyo 2013-12-07 2.2 kB
iso2022_jp_2004.pyc 2013-12-07 2.2 kB
iso2022_jp_2004.py 2013-12-07 1.1 kB
iso2022_jp_2.py 2013-12-07 1.1 kB
iso2022_jp_2.pyc 2013-12-07 2.2 kB
iso2022_jp_1.pyc 2013-12-07 2.2 kB
iso2022_jp_1.pyo 2013-12-07 2.2 kB
iso2022_jp.pyo 2013-12-07 2.2 kB
iso2022_jp_1.py 2013-12-07 1.1 kB
idna.pyo 2013-12-07 7.1 kB
iso2022_jp.py 2013-12-07 1.1 kB
iso2022_jp.pyc 2013-12-07 2.2 kB
idna.py 2013-12-07 8.5 kB
idna.pyc 2013-12-07 7.1 kB
hz.pyc 2013-12-07 2.1 kB
hz.pyo 2013-12-07 2.1 kB
hp_roman8.pyo 2013-12-07 4.7 kB
hz.py 2013-12-07 1.0 kB
hp_roman8.py 2013-12-07 7.4 kB
hp_roman8.pyc 2013-12-07 4.7 kB
hex_codec.pyo 2013-12-07 4.3 kB
hex_codec.py 2013-12-07 2.3 kB
hex_codec.pyc 2013-12-07 4.4 kB
gbk.pyc 2013-12-07 2.1 kB
gbk.pyo 2013-12-07 2.1 kB
gb2312.pyo 2013-12-07 2.1 kB
gbk.py 2013-12-07 1.0 kB
gb2312.py 2013-12-07 1.0 kB
gb2312.pyc 2013-12-07 2.1 kB
gb18030.pyo 2013-12-07 2.1 kB
gb18030.py 2013-12-07 1.0 kB
gb18030.pyc 2013-12-07 2.1 kB
euc_kr.pyc 2013-12-07 2.1 kB
euc_kr.pyo 2013-12-07 2.1 kB
euc_kr.py 2013-12-07 1.0 kB
euc_jp.pyc 2013-12-07 2.1 kB
euc_jp.pyo 2013-12-07 2.1 kB
euc_jis_2004.pyo 2013-12-07 2.2 kB
euc_jp.py 2013-12-07 1.0 kB
euc_jis_2004.pyc 2013-12-07 2.2 kB
euc_jisx0213.pyo 2013-12-07 2.2 kB
euc_jis_2004.py 2013-12-07 1.1 kB
euc_jisx0213.pyc 2013-12-07 2.2 kB
euc_jisx0213.py 2013-12-07 1.1 kB
cp950.py 2013-12-07 1.0 kB
cp950.pyc 2013-12-07 2.1 kB
cp950.pyo 2013-12-07 2.1 kB
cp949.py 2013-12-07 1.0 kB
cp949.pyc 2013-12-07 2.1 kB
cp949.pyo 2013-12-07 2.1 kB
cp932.pyo 2013-12-07 2.1 kB
cp875.pyo 2013-12-07 3.4 kB
cp932.pyc 2013-12-07 2.1 kB
cp932.py 2013-12-07 1.0 kB
cp875.py 2013-12-07 13.1 kB
cp875.pyc 2013-12-07 3.4 kB
cp874.pyc 2013-12-07 3.5 kB
cp874.pyo 2013-12-07 3.5 kB
cp869.pyo 2013-12-07 8.7 kB
cp874.py 2013-12-07 12.9 kB
cp869.py 2013-12-07 33.2 kB
cp869.pyc 2013-12-07 8.7 kB
cp866.pyc 2013-12-07 8.9 kB
cp866.pyo 2013-12-07 8.9 kB
cp865.pyo 2013-12-07 8.6 kB
cp866.py 2013-12-07 34.7 kB
cp865.py 2013-12-07 34.9 kB
cp865.pyc 2013-12-07 8.6 kB
cp864.py 2013-12-07 33.9 kB
cp864.pyo 2013-12-07 8.8 kB
cp864.pyc 2013-12-07 8.8 kB
cp863.pyc 2013-12-07 8.6 kB
cp863.pyo 2013-12-07 8.6 kB
cp863.py 2013-12-07 34.5 kB
cp862.pyo 2013-12-07 8.8 kB
cp862.py 2013-12-07 33.6 kB
cp862.pyc 2013-12-07 8.8 kB
cp861.pyo 2013-12-07 8.6 kB
cp861.py 2013-12-07 34.9 kB
cp861.pyc 2013-12-07 8.6 kB
cp860.pyo 2013-12-07 8.6 kB
cp860.pyc 2013-12-07 8.6 kB
cp858.pyo 2013-12-07 8.4 kB
cp860.py 2013-12-07 34.9 kB
cp858.py 2013-12-07 34.3 kB
cp858.pyc 2013-12-07 8.4 kB
cp857.pyo 2013-12-07 8.4 kB
cp857.py 2013-12-07 34.2 kB
cp857.pyc 2013-12-07 8.4 kB
cp856.pyc 2013-12-07 3.5 kB
cp856.pyo 2013-12-07 3.5 kB
cp855.pyo 2013-12-07 8.8 kB
cp856.py 2013-12-07 12.7 kB
cp855.pyc 2013-12-07 8.8 kB
cp852.pyo 2013-12-07 8.7 kB
cp855.py 2013-12-07 34.1 kB
cp852.py 2013-12-07 35.3 kB
cp852.pyc 2013-12-07 8.7 kB
cp850.pyo 2013-12-07 8.4 kB
cp850.py 2013-12-07 34.4 kB
cp850.pyc 2013-12-07 8.4 kB
cp775.pyo 2013-12-07 8.7 kB
cp775.py 2013-12-07 34.7 kB
cp775.pyc 2013-12-07 8.7 kB
cp737.pyo 2013-12-07 8.9 kB
cp737.py 2013-12-07 34.9 kB
cp737.pyc 2013-12-07 8.9 kB
cp720.pyo 2013-12-07 3.5 kB
cp720.pyc 2013-12-07 3.5 kB
cp500.pyo 2013-12-07 3.4 kB
cp720.py 2013-12-07 13.7 kB
cp500.py 2013-12-07 13.4 kB
cp500.pyc 2013-12-07 3.4 kB
cp437.py 2013-12-07 34.8 kB
cp437.pyo 2013-12-07 8.6 kB
cp437.pyc 2013-12-07 8.6 kB
cp424.pyo 2013-12-07 3.4 kB
cp424.pyc 2013-12-07 3.4 kB
cp424.py 2013-12-07 12.3 kB
cp1258.pyo 2013-12-07 3.5 kB
cp1258.pyc 2013-12-07 3.5 kB
cp1257.pyo 2013-12-07 3.5 kB
cp1258.py 2013-12-07 13.6 kB
cp1257.py 2013-12-07 13.6 kB
cp1257.pyc 2013-12-07 3.5 kB
cp1256.pyc 2013-12-07 3.4 kB
cp1256.pyo 2013-12-07 3.4 kB
cp1255.pyo 2013-12-07 3.5 kB
cp1256.py 2013-12-07 13.1 kB
cp1255.py 2013-12-07 12.7 kB
cp1255.pyc 2013-12-07 3.5 kB
cp1254.pyc 2013-12-07 3.4 kB
cp1254.pyo 2013-12-07 3.4 kB
cp1254.py 2013-12-07 13.8 kB
cp1253.pyc 2013-12-07 3.5 kB
cp1253.pyo 2013-12-07 3.5 kB
cp1252.pyo 2013-12-07 3.4 kB
cp1253.py 2013-12-07 13.3 kB
cp1252.py 2013-12-07 13.8 kB
cp1252.pyc 2013-12-07 3.0 kB
cp1251.pyo 2013-12-07 3.4 kB
cp1251.py 2013-12-07 13.6 kB
cp1251.pyc 2013-12-07 3.4 kB
cp1250.pyo 2013-12-07 3.4 kB
cp1250.py 2013-12-07 13.9 kB
cp1250.pyc 2013-12-07 3.4 kB
cp1140.pyo 2013-12-07 3.4 kB
cp1140.py 2013-12-07 13.4 kB
cp1140.pyc 2013-12-07 3.4 kB
cp1026.pyo 2013-12-07 3.4 kB
cp1026.py 2013-12-07 13.4 kB
cp1026.pyc 2013-12-07 3.4 kB
cp1006.py 2013-12-07 13.8 kB
cp1006.pyo 2013-12-07 3.5 kB
cp1006.pyc 2013-12-07 3.5 kB
cp037.pyo 2013-12-07 3.4 kB
cp037.py 2013-12-07 13.4 kB
cp037.pyc 2013-12-07 3.4 kB
charmap.pyo 2013-12-07 4.3 kB
charmap.py 2013-12-07 2.1 kB
charmap.pyc 2013-12-07 4.3 kB
big5hkscs.pyo 2013-12-07 2.2 kB
bz2_codec.pyo 2013-12-07 5.4 kB
bz2_codec.pyc 2013-12-07 5.6 kB
bz2_codec.py 2013-12-07 3.0 kB
big5hkscs.py 2013-12-07 1.0 kB
big5hkscs.pyc 2013-12-07 2.2 kB
big5.pyc 2013-12-07 2.1 kB
big5.pyo 2013-12-07 2.1 kB
base64_codec.pyo 2013-12-07 4.3 kB
big5.py 2013-12-07 1.0 kB
base64_codec.py 2013-12-07 2.3 kB
base64_codec.pyc 2013-12-07 4.5 kB
aliases.pyo 2013-12-07 8.8 kB
ascii.pyc 2013-12-07 2.8 kB
ascii.pyo 2013-12-07 2.8 kB
aliases.py 2013-12-07 14.8 kB
ascii.py 2013-12-07 1.2 kB
aliases.pyc 2013-12-07 8.8 kB
Totals: 360 Items   2.3 MB 0

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