Multicorn PostgreSQL FDW on FreeBSD
I had to fight against Multicorn Foreign Data Wrappers because installing them on FreeBSD is not ideal. It is worth noting that the platform has not released a new stable version since February 2016, while the commit logs shows active development in order to be compatible with PostgreSQL 10. So what are problems installing Multicorn on FreeBSD? It is simple: Multicorn has not been made for FreeBSD and therefore the toolchain is not portable. In particular, in order to install it you have to:
- use
gmakeinstead ofmake; - change the she-bang line of
preflight-check.shwhich refers to Bash. Yes, really, Bash! Therefore change the first line from#!/bin/bashto#!/usr/local/bin/bash; - install package
python-distutils, for instancepy27-python-distutils-extra-2.39, which in turn installssetuptoolsthat is required bymulticorn.
wrapper_multicorn as FDW, but that is wrong.
The correct FDW to use is multicorn, as can be seen by the code within multicorn.sql:
CREATE FOREIGN DATA WRAPPER multicorn
CREATE SERVER do use multicorn as FOREIGN DATA WRAPPER.
With the above tricks I was able to run the file system FDW, as well as the Git one (which is pretty much un-documented).
Unluckily, the GoogleFDW is both undocumented and not working, due to the need for a Google API and Custom Search that I reported to the module author after a little “debugging” (or kind of).
I also asked to the ITPUG mailing list for someone proficient in Python for a Pull Request, maybe the ITPUG will be able to contribute!