Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

db:test:prepare fails on postgres < 8.2

#400

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)

Reported by Markus Melcher · June 12th, 2008 @ 11:02 AM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. ian
    ian

    Here is a patch that checks the version of postgres and uses the correct syntax

    June 17th, 2008 @ 12:13 AM

  2. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 2.1.1
    • State changed from new to open
    • Assigned user set to Jeremy Kemper

    June 17th, 2008 @ 12:42 AM

  3. Markus Melcher
    Markus Melcher

    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.

    June 17th, 2008 @ 10:29 AM

  4. Repository
    Repository
    • State changed from open to resolved

    (from [965848ec61529df53f137bf877fb36abd786da8c]) Only use DROP ... IF EXISTS for PostgreSQL 8.2 or later. [#400 state:resolved]

    http://github.com/rails/rails/co...

    June 23rd, 2008 @ 02:32 AM