Prerequisites

When you write a client application using libpq, you'll need a C compiler. I'll assume that you have the GNU C compiler (gcc) installed and ready to use. I'll also assume that you have GNU make available, and I'll use that tool to actually invoke the compiler (and linker).

APIs that are used within a C application are usually made up of two components: a set of header files and an object code library.

The header files contain data type definitions and function prototypes (in other words, the header files describe the API to your C compiler). The object code library contains the actual implementation for each function contained in the API. When you use libpq, you will need to include the libpq-fe.h header file within your C code ...

Get PostgreSQL, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.