This chapter should have given you a good feel for how to build C applications using ecpg. Don't let the last section throw you off too much?ecpg isn't all that well suited to processing dynamic SQL (at least in comparison to libpq or libpgeasy).

The ecpg preprocessor and library are remarkably well designed for building complete PostgreSQL applications quickly.

If you don't need to process dynamic queries, I think that ecpg is the quickest and easiest way to connect a C application to a PostgreSQL database. If you do need to handle dynamic queries, you should consider coding the static parts of your application using ecpg and using libpq (or libpgeasy) for the dynamic parts.

Most of the features in ecpg come from the SQL3 standard and you should find that it is reasonably easy to move embedded SQL applications among various databases (assuming that you haven't used too many "special" features).

    Part II: Programming with PostgreSQL