This project is archived and is in readonly mode.
[PATCH] Create schema during 'rake db:create' from schema_search_path if it does not exist for PostgreSQL
-
Jim Gay
Didn't realize where the tests needed to go. I'm working on them now... sorry for the early noise
-
Pratik
- State changed from new to incomplete
Could you please upload a patch using git-format-patch ? http://guides.rails.info/contrib... should help.
Thanks !
-
Jim Gay
Lighthouse is not saving my message when I add the patch file.
-
Jim Gay
Trying again...
-
Pratik
- State changed from incomplete to open
-
Rizwan Reza
- State changed from open to verified
- Tag changed from 2.3, adapters, databases.rake, patch, postgresql, rake to 3.0, adapters, databases.rake, patch, postgresql, rake
- Assigned user changed from Tarmo Tänav to Pratik
- Title changed from Create schema during 'rake db:create' from schema_search_path if it does not exist for PostgreSQL to [PATCH] Create schema during 'rake db:create' from schema_search_path if it does not exist for PostgreSQL
- Milestone cleared.
This is exactly the same patch but applies cleanly on master.
-
Rizwan Reza
- State changed from verified to resolved
Done, committed here: http://github.com/rails/rails/commit/6c2a0675f11a9b5b8e88ed7dbccd65...
-
eagle.anton (at gmail)
- Assigned user changed from Pratik to Rizwan Reza
This commit breaks test database prepare by rake db:test:prepare.
Because query:SELECT schema_name FROM information_schema.schemata;doesn't return any schema for non SUPERUSER and it tries to create it.
And how result we have error:PGError: ERROR: permission denied for database postgres : CREATE SCHEMA "public" AUTHORIZATION "user"and not created test db.
-
Rizwan Reza
Don't you need to have authorization for 'postgres' database to create schemas?
-
eagle.anton (at gmail)
Ok. Let's talk about workflow with postgres.
There are my steps:
There is i don't want to grant superuser privileges to user. User is having permissions to create db only now. In that way new db will be created in public schema which for all users same time. Should i give him authorization to create 'public' schema in 'postgres' db? I think no. Am i right?sudo -u postgres psql CREATE ROLE user_name with createdb login password 'pass'; -
Michael Koziarski
- State changed from resolved to open
eagle.anton is right, this breaks my ability to run tests,
the cure is worse than the disease here.
Also, why's it trying to create the public schema anyway?
-
Dan Pickett
- Tag changed from 3.0, adapters, databases.rake, patch, postgresql, rake to 3.0, adapters, bugmash, databases.rake, patch, postgresql, rake
-
Rizwan Reza
- State changed from open to stale
- Assigned user cleared.
