The same query will also hang indefinitely. Stack shown below. Doing the same query with psql completes immediately. It is simple query: select * from table where column='x'; pqSocketCheck pqWaitTimed pqWait PQgetResult PQexecFinish Under what conditions is this possible? Is there any logging the server side that may aid finding the cause?