The libpgeasy library is a nice addition to libpq. You can mix and match libpgeasy and libpq functions. libpgeasy makes it easy to write simple utility applications, but it is not well suited to writing applications that need a lot of user input. If your application needs to execute commands that are not known at compile time, you should probably use libpq instead?libpgeasy won't offer you many advantages.

The source code for libpgeasy is available in the PostgreSQL source distributions. I recommend that you read through the code?you'll see some good sample code that will help in your libpq programming efforts. You will also gain a better understanding of some of the limitations of libpgeasy.

    Part II: Programming with PostgreSQL