Install Libpq-Dev on Mac Os?

Does anyone know how I can install libpq-dev on Mac OS 10.6? It's a pre-requisite for something else I want to install.

There doesn't seem to be a macport for it, so how can I install it on a Mac?

4 Answers

Consider using Homebrew

brew install postgresql

It'll give you the necessary headers.

2

You can install libpq (dev files are included) alone using homebrew.

brew install libpq

The include files and libs are then available in the following folders:

/usr/local/opt/libpq/lib
/usr/local/opt/libpq/include

When I've search in ports I've found this:

port search libpq
libpqxx @3.0.2 (databases, devel)
    Official C++ client API for PostgreSQL

libpqxx26 @2.6.9 (databases, devel)
    Official C++ client API for PostgreSQL

You can try one of those.

1

Using macports, this worked for me:

sudo port install postgresql96
sudo port select --set postgresql postgresql96

I believe this installs all the postgres client tools and libs, while macports has a separate port for installing the server, i.e. postgresql96-server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest