/* Is this all it takes? */
PQconnectdb("host=127.0.0.1 dbname=-exploit user=postgres password=postgres port=5432");
PQconnectdb("host=127.0.0.1 dbname=-exploit user=postgres password=postgres port=5432");
EDIT: They are not overwritten but just appended to.