Showing posts with label Postgre. Show all posts
Showing posts with label Postgre. Show all posts

Sunday, June 12, 2016

Find Active Session and Kill it on PostgreSQL

I happen to encounter a case when I want to drop a database and not allowed by system since there are an active session. I ended up having to restart database and the perform the drop. this is not ideal if there are more than 2 database or its already run on production, but here's how to do it

Restore PostgreSQL Database

Without having to use tools like pgAdmin, you can backup and restore database using console command