title: How to find the queries that is blocking another query?
body: <p>I am trying to drop an empty table
  <code>drop table temp;</code> the query is running forever.</p>
  <p>So, I tried to find other queries that could block the current query.
  Here is what I tried:</p>
  <pre><code>SELECT *
    FROM pg_locks l
    JOIN pg_class t ON l.relation = t.oid AND t.relkind = 'r'
   WHERE t.relname = 'temp';
  
  </code></pre>
  <p>This query returns with zero results</p>
  <pre><code>SELECT database, gid FROM pg_prepared_xacts;
  </code></pre>
  <p>This does not give any result as well.</p>
  <p>The table is a partitioned table, the partitions attached to the table has been deleted successfully already.</p>
  <p>I am not even able to get result for <code>\d temp</code>.</p>
  <p>What has happened?
  How can I get this fixed?</p>
  <p>This does not happen when I tried the same in local. Works perfectly fine.</p>