Next: Examples
Up: Writing PostgreSQL Applications
Previous: Why Use a Database?
The following figure illustrates how applications communicate to the
database:
Libpq is the POSTGRESQL C library that allows applications
to communicate with the database. Using libpq is a fairly straightforward
process:
- Call a libpq function to connect to the database
- Receive a connection handle (PGconn)
- Issue a query
- Use the connection handle to issue a query
- Receive a result handle (PGresult)
- Access the result
- Issue more queries if desired
- Close the database connection
Bruce Momjian
2003-01-31