Build DuckDB FDW

How to build DuckDB FDW extension and its dependencies libduckdb.so

DuckDB FDW depends on the libduckdb.so dynamic library. On Ubuntu and Debian, you can directly use the precompiled binaries provided by DuckDB.

On EL-based operating systems, you need to compile libduckdb from scratch and use this version to compile duckdb_fdw.

Pigsty’s github.com/pgsty/pgsql-rpm repository offers pre-built templates:

DuckDB has provided the libduckdb-src.zip source code, making it convenient for building.


Build Notes

You can only build this on EL8 & EL9 (EL7 not supported), to build duckdb_fdw, you also need to build libduckdb from source.

To build libduckdb-src, use the same building args as building duckdb_fdw:

clang++ -c -fPIC -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 duckdb.cpp -o duckdb.o
clang++ -shared -o libduckdb.so *.o

To build libduckdb:

cd ~/rpmbuild/SPECS && make libduckdb

To build duckdb_fdw:

cd ~/rpmbuild/SPECS && make duckdb_fdw

Last modified 2024-08-04: add extensions (25d8a2b6)