Postgres C API
Connect to the database
// Connect to database jao, as user jao, with password xxxxxxxxxx
{
const char *cnxn_info = "dbname = jao user = jao password = xxxxxxxxxx";
cnxn = PQconnectdb(cnxn_info);
if (PQstatus(cnxn) != CONNECTION_OK) {
oops(cnxn, "cnxnection to database failed");
}
}
|