TIL is my collection of short, technical daily learnings. 188 and counting.
Terminate Database Connections
To maintain data integrity, certain actions like rake db:drop will not execute when there are active sessions on a Postgres database. You’ll get an error like this: ERROR: database "database_name" is being accessed by other users DETAIL: There are 2 other session(s) using the database. Sessions can be killed from the command line, but a safer route is to kill them with a database method. First, revoke all public access from the database: ...