On Wed, Jul 20, 2011 at 12:04 PM, Phoenix Rising <polarisris...@gmail.com> wrote:
> Since recently switching to PostgreSQL from MySQL, I've frequently run > into an annoyance that occurs to me I *may* need to adjust in > database.yml. Obviously I'd Google for this, but I have no idea what > to call this issue. > > When I run my tests, e.g. "rake test:units", I get a notice that > "There are N other session(s) using the database." This is awesome > for production environments, but in development, it's just plain > annoying. > > I'm not sure if this is a warning from the rake task doing the DB > drop, or from PostgreSQL itself. How can I get it to just not care in > development mode, like MySQL does? The error message you're getting is because when PostgreSQL creates a new database it uses an existing database as a template. If somebody is connected to the existing database being used as a template then the create fails. There isn't really any reason to be connecting to the "template1" database, so the way to make this work correctly is to avoid anybody connecting to that. Is the test suite connecting twice and then blowing itself up, or is there another user there? Switching to using template0 is not the correct solution. -- Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.