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 tasks do not work with jdbcpostgresql

#5621

The rake tasks from active record do not work with the jdbc adapter for postgresql.

This is cause the tasks match the adapter name for postgresql with a string not a regex.
For mysql the match is /mysql/ therefore the jdbc adapter for mysql works.

I appended a patch with updates all comparisons to use regex.

Reported by Kane · September 12th, 2010 @ 08:13 PM

State: open
Milestone: none
Assigned to: José Valim José Valim
Importance: Medium

Activity

  1. Kane
    Kane
    • Assigned user set to José Valim

    September 16th, 2010 @ 11:24 AM

  2. x0f
    x0f

    yep, needed to monkey-patch this for my last to projects

    October 9th, 2010 @ 02:53 PM

  3. David Trasbo
    David Trasbo
    • Importance changed from to Low

    Seems to me there should be a way for adapters to tell which database they interact with. I mean, regular expressions are fine, but they don't seem to make for a very stable or agnostic solution in this case.

    October 9th, 2010 @ 03:24 PM

  4. Kane
    Kane

    okey so now its a low priority to use rails with jruby if you are not using mysql

    October 9th, 2010 @ 05:26 PM

  5. Kane
    Kane

    i also would like a clean adapter interface, no messy switch cases in rake db and the possibility to specify the gem you want to use for a connection.

    i think there is plenty of room for improvement.
    example: the adapters extend ar base with things like "postgresql_connection"
    and on and on..

    i just thought the apprach to fix the tasks to handle every thing with regex, like it is done for mysql would be a quick win.

    October 9th, 2010 @ 05:40 PM

  6. David Trasbo
    David Trasbo
    • State changed from new to open
    • Importance changed from Low to Medium

    Kane,

    Don't worry about the priority. The default value is Low, and tickets really only will get special attention if it's High. I'll make it Medium, though, just because it's you. ;)

    October 9th, 2010 @ 07:16 PM

  7. Kane
    Kane

    okey thanks ;)

    now the question is what do i need to do to get this issue resolved.
    Should i try the approach you suggested and supply a patch which extends the abstract adapter with the suggested method, 'dbms_name' or something like that, which can be used in the rake tasks?
    If we go that way all adapters need to be patched.

    October 9th, 2010 @ 07:38 PM

  8. David Trasbo
    David Trasbo

    I think going with the regular expressions for now is fine, but in the future it might be worth working out a more permanent solution. For that further discussion with the core team etc. is needed, though.

    October 9th, 2010 @ 08:14 PM

  9. Kane
    Kane
    • Tag set to patch jdbc postgresql rake task

    October 12th, 2010 @ 05:31 PM

  10. Kane
    Kane
    • Tag changed from patch jdbc postgresql rake task to rake task, jdbc, patch, postgresql

    October 12th, 2010 @ 05:32 PM

  11. Santiago Pastorino
    Santiago Pastorino

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:30 PM

  12. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:30 PM

  13. Kane
    Kane
    • State changed from stale to open

    [state:open]

    this is still an issue.
    For example i cant drop the database, it silently fails under jruby.

    I would love to do something about it, but since i already but some effort into this last year only to see that nothing happens, this time i would like some hints on how to approch this to get it applied.

    April 6th, 2011 @ 01:29 AM