- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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.
- Related Articles
- How to Query a DB in 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?
- How to create a table in PostgreSQL?
- Aliasing in PostgreSQL?
- How to define and query json columns in PostgreSQL?
- How to add column to an existing table in PostgreSQL?
- How to find and kill running processes in linux
- How to Kill a Process by Name in Linux?
- How to insert a Python tuple in a PostgreSql database?
- How to get current timestamp and relative timestamps in PostgreSQL?
- How to change the type of a column in PostgreSQL?
- CASE WHEN in PostgreSQL?
- Kill Process in C++
- Kill Commands In Linux
