This package is a system module wrapper for libpq – the official C library for PostgreSQL –, which must be installed separately before using it in Swift projects.
Note: the database itself does not need to be running, only the header and library files matter.
Choose one of the following options:
-
Visit the https://brew.sh to install Homebrew if it isn't already installed.
-
Run the following command:
brew install postgresql pkg-config
-
Download Postgres.app from postgresapp.com.
-
Create a pkgConfig file at
/usr/local/lib/pkgconfig/libpq.pc
with the following content:path=/Applications/Postgres.app/Contents/Versions/latest Cflags: -I${path}/include Libs: -L${path}/lib -lpq
-
Adjust the path as necessary.
-
Download and run the installer from enterprisedb.com.
-
Create a pkgConfig file at
/usr/local/lib/pkgconfig/libpq.pc
with the following content:path=/Library/PostgreSQL/10 Cflags: -I${path}/include Libs: -L${path}/lib -lpq
-
Adjust the version number (
10
in the example) to match the installed version.
Execute the following commands as the superuser:
apt-get update
apt-get upgrade
apt-get install postgresql postgresql-contrib