* Update PostgreSQL lib version and fix resource cleanup - update the bundled PostgreSQL/libpq headers and static libraries to 18.4 (resolve #1802) - adjust pgsql extension link inputs for the newer libpq split libraries, and drop unsupported macOS pgsql builds - build connection parameters with instead of manually formatting a connection string - make own and clear its , preventing leaks when prepared statements are executed repeatedly - close prepared statements with when statement handles are destroyed - track copied vs borrowed prepared-statement parameter buffers so borrowed strings/blobs are not freed (resolve #1946) * Rebuild libs --------- Co-authored-by: Nicholas Hastings <[email protected]>
2.2 KiB
PostgreSQL Static Libraries
This extension bundles PostgreSQL 18.4 static libraries built by:
https://github.com/ProjectSky/build-postgresql-library
Use that project to rebuild or update the bundled libraries. It contains the current PostgreSQL version, Linux configure flags, Windows Meson flags, and release packaging details.
Manual Build
The current build uses PostgreSQL 18.4.
-
Install the build dependencies.
Linux requires
build-essential gcc-multilib g++-multilib.Windows requires an MSVC developer shell,
winflexbison3,meson, andninja. -
Download and unpack postgresql-18.4.tar.gz
-
For Linux, create a separate build directory for each architecture and configure with
--without-readline --without-icu --without-zlib.Use
CFLAGS="-fPIC -m32" LDFLAGS="-m32"forlib_linux, orCFLAGS="-fPIC -m64" LDFLAGS="-m64"forlib_linux64. -
Build the Linux static libraries:
make -C src/backend generated-headers
make -C src/port libpgport_shlib.a
make -C src/common libpgcommon_shlib.a
make -C src/interfaces/libpq libpq.a SHLIB_PREREQS=
- For Windows, configure from an MSVC developer shell:
python -m mesonbuild.mesonmain setup build-win64 . --backend=ninja -Dreadline=disabled -Dicu=disabled -Dlibcurl=disabled -Dzlib=disabled -Dssl=none -Db_vscrt=mt
- Build the Windows static libraries:
python -m ninja -C build-win64 src/interfaces/libpq/libpq.a src/common/libpgcommon_shlib.a src/port/libpgport_shlib.a
Use build-win32 from an x86 MSVC shell for lib_win.
- Copy the three static libraries plus
libpq-fe.handpostgres_ext.hinto the matchinglib_*directory. Windows packages rename the.aoutputs to.lib.
Bundled Files
Linux:
lib_linux/libpq.alib_linux/libpgcommon_shlib.alib_linux/libpgport_shlib.alib_linux64/libpq.alib_linux64/libpgcommon_shlib.alib_linux64/libpgport_shlib.a
Windows:
lib_win/libpq.liblib_win/libpgcommon_shlib.liblib_win/libpgport_shlib.liblib_win64/libpq.liblib_win64/libpgcommon_shlib.liblib_win64/libpgport_shlib.lib
Headers:
libpq-fe.hpostgres_ext.h
macOS pgsql builds are not currently supported.