Building on FreeBSD

At one time, FreeBSD’s threading library would malfunction if it was dynamically loaded after the start of a program that did not use threads itself. That was a problem for PL/Java on FreeBSD, because PostgreSQL itself does not use threads, but Java does. The only known workaround was to build PostgreSQL itself from source, with the thread library included in linking.

The same problem was reported to affect other PostgreSQL extensions such as plv8 and imcs also.

The manual page for FreeBSD’s libthr was edited in February 2015 to remove the statement of that limitation, and the updated manual page appears first in FreeBSD 10.2, so in FreeBSD 10.2 or later, PL/Java (and other affected extensions) may work without the need to build PostgreSQL from source.