I am using psycopg2 2.7.4 to connect to the PostgreSQL database server using asynchronoussupport. It is working absolutely fine. I have used sshtunnel v0.1.3 in pgAdmin4. When I connect the PostgreSQL database server using ssh tunnel and run the valid/correct query it works fine, but when I run any wrong query(invalid column of table) my application gets hang on conn.poll() function.