O'Reilly logo

PostgreSQL for Data Architects by Jayadevan Maymala

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Query not responding

Sometimes, we execute a query and we wait and wait. Nothing happens! We do not want to kill the query. What if it has just completed processing and is about to fetch us the results? And yes, it may be an update or some other SQL that will make changes to the data and we have to execute it anyway. The best thing to do in such situations is to find out what exactly is happening in the database. There are a couple of views that are very useful when we want to see what is happening in the database.

The pg_stat_activity view keeps track of all the activities in the database. Note that this view does not have transactions that have been completed. Only live queries can be retrieved from this view. We will cover the important columns ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required