- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Kill queries in pgAdmin in PostgreSQL?
Sometimes, some rogue queries can take too long to execute. If the queries are blocking in nature, i.e., they restrict access to a table while they are executing, then any other query on the same table will be put on hold, and this leads to a pile-up of queries. This can, depending on your DB load, even cause the max connections to be exceeded. Luckily, you can easily kill long queries in 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.
By clicking on the cross button, you terminate the session itself, while on clicking on the Stop button (black square), you cancel the active query.
It is recommended to click on the cross button itself, especially if your database has breached the connection limit and you need to terminate connections to the database.
- How to Query a DB in pgAdmin in PostgreSQL?
- How to Connect a DB to pgAdmin in PostgreSQL ?
- How to look for partial string matches in queries in PostgreSQL?
- How to apply DISTINCT constraint on select columns in queries in PostgreSQL?
- Kill Process in C++
- How to create a table in PostgreSQL?
- Aliasing in PostgreSQL?
- How to find and kill running processes in linux
- How to Kill a Process by Name in Linux?
- The kill() Function in Perl
- CASE WHEN in PostgreSQL?
- How to define and query json columns in PostgreSQL?
- C# Program to Kill a Thread
- How to add column to an existing table in PostgreSQL?
- How to insert a Python tuple in a PostgreSql database?