libpgeasy

Essentially, the libpgeasy library provides a simpler interface to the libpq C library.The typical uses of libpgeasy are as follows:

  • connectdb. Connects to the database.

  • doquery. Executes the supplied query.

  • fetch. Retrieves the results from the back end.

  • disconnectdb. Closes the database connection.

The following functions are provided by libpgeasy to accomplish the preceding:

  • PGconn *connectdb(char *options);

  • PGresult *doquery(char *query);

  • int fetch(void *param);

  • int fetchwithnulls(void *param);

  • void reset_fetch();

  • void disconnectdb();

Get PostgreSQL Essential Reference 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.