July 2005
Intermediate to advanced
1032 pages
27h 10m
English
Our first client is very simple—it connects to a server, disconnects, and then exits.
There are two sets of functions that you can use to connect to a PostgreSQL server: the simple form uses the PQconnectdb() function, whereas the more complex form uses PQconnectStart() and PQconnectPoll(). PQconnectdb() is easier to use because it is a synchronous function; when you call PQconnectdb(), your program will not continue until the connection attempt succeeds or fails. The PQconnectStart() and PQconnectPoll() functions give your application a way to connect to a server asynchronously. A call to PQconnectStart() returns immediately—it won't wait for the connection attempt to complete. The PQconnectPoll() function can ...
Read now
Unlock full access