I have a rails application running over Postgres.
I have two servers: one for testing and the other for production.
Very often I need to clone the production
Let your application close the connection when it's done. PostgreSQL doesn't keep connections open , it's the application keeping the connection.