See
Refer to "Database Connection Control Functions" in "Client Interfaces" in the PostgreSQL Documentation.
In addition, refer to "6.3 Connecting with the Database" in "Embedded SQL in C " for information on connection string.