All posts tagged: postgres

Quickly close database connections on the command line

programming

One slightly annoying thing about Postgres over MySQL is that trying to reset a database with rake db:migrate:reset fails if there are connected clients and as I use Pow for development, killing the process doesn’t always free up the connections. To get around this you can quickly kill all connections with this command: [crayon-5f900e296b04f666010540/]

SSH Tunnels with Postgres & pgAdmin

computing

One of my previous posts showed how to use an SSH Tunnel to connect to a remote MySQL server. Since moving to Postgres I’ve been wanting to do the same thing with pgAdmin, which sadly isn’t as simple. There’s no way of creating the tunnel automatically in the app so we need to resort to the terminal. The first step is as before, we create the SSH tunnel to our server: [crayon-5f900e296b38f540364396/] Here I’m mapping […]