I am still having the same problem. I tried to eliminate any possible network issues by placing the application on the server itself, but the same thing happened. However, I had an interesting discovery today that I don't understand. I left the insert query that was stuck running. Then, without changing any parameters, I ran reload configuration, aka. sending SIGHUP, and the query immediately completed and went on to the next insert. I also noticed that I am having the similar issue with SELECT statements. Same SELECT statement will run fine 3-4 times in a row and then get stuck and run forever with no results. But if I reload the configuration like above, the query immediatelly returns with correct result. Why does this happen, and could this give any insight in my problem? Thanks.