This project is archived and is in readonly mode.
db:test:prepare fails on postgres < 8.2
Reported by Markus Melcher | June 12th, 2008 @ 11:02 AM
Activerecord 2.1.0 uses the DROP DATABASE IF EXISTS statement which is only supported by PostgreSQL versions >= 8.2. Since there are quite a few older PG installations in use it might be a good idea to try and be backwards compatible here. (I don't know if there are any other compatibility issues that might be more difficult to resolve though)
Comments and changes to this ticket
-
ian June 17th, 2008 @ 12:13 AM
Here is a patch that checks the version of postgres and uses the correct syntax
-
Jeremy Kemper June 17th, 2008 @ 12:42 AM
- Milestone set to 2.1.1
- State changed from new to open
- Assigned user set to Jeremy Kemper
-
Markus Melcher June 17th, 2008 @ 10:29 AM
Looks good to me, apart from the fact that now PG 8.1 signals an error when the database does not exist. So I wrapped the whole thing in a begin/rescue clause to take care of that.
Thanks a lot for the patch - I didn't know how to check the DB version.
-
Repository June 23rd, 2008 @ 02:32 AM
- State changed from open to resolved
(from [965848ec61529df53f137bf877fb36abd786da8c]) Only use DROP ... IF EXISTS for PostgreSQL 8.2 or later. [#400 state:resolved]
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>