Daniel Collis-puro
2007-Feb-06 15:38 UTC
Postgres, testing and maybe spurious database DROPpings?
Folks, I don''t like that I have to grant CREATEDB rights to the test user to get testing working smoothly with Postgres. What is the philosophical reason that Rails wants to drop and recreate databases during the testing? It would seem to me that "pg_dump -c" (the "clean" dump option, similar to mysqldump''s --add-drop-tables ) would suffice when you''re using SQL format schema dumps. Another problem with dropping databases is that procedural languages are lost unless they are loaded into template1. The workaround is to just install procedural languages into template1 and grant CREATEDB rights to the test user, but it would feel cleaner to leave database creation up to the postgres admin user to me. "Principle of least privilege" and all that. Thoughts? -DJCP Software Engineer EndPoint.com -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
apsoto-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-07 17:52 UTC
Re: Postgres, testing and maybe spurious database DROPpings?
I just don''t think in practice people really care about the test users privileges since it doesn''t run against critical databases (like production). On Feb 6, 7:38 am, Daniel Collis-puro <rails-mailing-l...@andreas- s.net> wrote:> Folks, > > I don''t like that I have to grant CREATEDB rights to the test user to > get testing working smoothly with Postgres. > > What is the philosophical reason that Rails wants to drop and recreate > databases during the testing? It would seem to me that "pg_dump -c" (the > "clean" dump option, similar to mysqldump''s --add-drop-tables ) would > suffice when you''re using SQL format schema dumps. > > Another problem with dropping databases is that procedural languages are > lost unless they are loaded into template1. > > The workaround is to just install procedural languages into template1 > and grant CREATEDB rights to the test user, but it would feel cleaner to > leave database creation up to the postgres admin user to me. "Principle > of least privilege" and all that. > > Thoughts? > > -DJCP > Software Engineer > EndPoint.com > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---