Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pgAdmin query tool stays frozen even after query is over

Tags:

pgadmin

I am running postgresql 9.6 in my windows 7 laptop. Nobody else connects to the database. I ran an insert SQL in Query Tool of Pgadmin4. The query got over after 20 minutes or so. The records got inserted & the state in pg_stat_activity went from active to idle which I checked by opening the other query tool window. But the original window in which the query was run continued to be frozen with message

"waiting for the query execution to complete"

How can I fix this problem. I did some research. Does it have something to do with TCP/IP connection getting broken as mentioned in below links

Link 1

and

Link 2 (under Connection to database dropped)

like image 554
John Avatar asked Sep 22 '16 12:09

John


People also ask

How do I force quit pgAdmin?

Go to Dashboard in your pgAdmin. At the bottom, in the Server Activity section, under the Sessions Tab, you can see all the Active queries. Now, notice the cross button and the Stop button to the left of each query.

How do I close a query editor in pgAdmin?

To close a copy of the Query tool, click the X in the upper-right hand corner of the tab bar. The Query Tool features two panels: The upper panel displays the SQL Editor.

How do I reset my pgAdmin GUI?

The File Menu¶ Click to open the Preferences dialog to customize your pgAdmin settings. If you have modified the workspace, click to restore the default layout.

How do I enable query tool in pgAdmin 4?

You can access the Query Tool via the Query Tool menu option on the Tools menu, or through the context menu of select nodes of the Browser tree control.


2 Answers

Restart pgadmin and try the query again.

as of 2018 pgadmin seems to handle connection timeouts really badly, so you will often need to restart the entire pgadmin appliction after a period of not using it, and then go through the process of expanding the tree again to get right down to the table you were working with.

It does make me wonder whether the authors of pgadmin actually eat their own dogfood, as it's quite painful to use day-to-day compared to say SQL Server's Management Studio.

like image 144
Matthew Lock Avatar answered Oct 21 '22 06:10

Matthew Lock


Not exactly a solution but got a work around. The problem was that after query execution it was running the autovacuum and then even after it got over, pgadmin was staying frozen. I disabled autovacuum in the config file and it started working fine. Not sure if this will have any impact on performance or anything else. Will see.

like image 44
John Avatar answered Oct 21 '22 06:10

John