There are some utility functions that enable you to trace the frontend/backend connection and are useful for debugging connection problems.
PQtrace enables tracing of the frontend/backend communication to a debugging file stream.
void PQtrace(PGconn *conn, FILE *debug_port) |
where conn is the connection to debug, and debug_port is the stream to which debug information should be sent.
PQuntrace disables tracing started by PQtrace.
void PQuntrace(PGconn *conn) |
where conn is the connection on which to terminate debugging.