Chapter 1. libpq++ - C++ Binding Library

Table of Contents
1.1. Introduction
1.2. Control and Initialization
1.3. libpq++ Classes
1.3.1. Connection Class: PgConnection
1.3.2. Database Class: PgDatabase
1.4. Database Connection Functions
1.5. Query Execution Functions
1.5.1. Main Routines
1.5.2. Retrieving SELECT Result Information
1.5.3. Retrieving SELECT Result Values
1.5.4. Retrieving Non-SELECT Result Information
1.6. Asynchronous Notification
1.7. Functions Associated with the COPY Command

1.1. Introduction

libpq++ is the C++ API to PostgreSQL. libpq++ is a set of classes that allow client programs to connect to the PostgreSQL backend server. These connections come in two forms: a database class and a large object class.

The database class is intended for manipulating a database. You can send all sorts of SQL queries and commands to the PostgreSQL backend server and retrieve the responses of the server.

The large object class is intended for manipulating a large object in a database. Although a large object instance can send normal queries to the PostgreSQL backend server it is only intended for simple queries that do not return any data. A large object should be seen as a file stream. In the future it should behave much like the C++ file streams cin, cout and cerr.

This chapter is based on the documentation for the libpq C library (see libpq). There are several examples of libpq++ applications in src/interfaces/libpq++/examples in the source distribution.