This project is archived and is in readonly mode.

#5621 open
Kane

db tasks do not work with jdbcpostgresql

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

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.

Comments and changes to this ticket

  • Kane

    Kane September 16th, 2010 @ 11:24 AM

    • Assigned user set to “José Valim”
  • x0f

    x0f October 9th, 2010 @ 02:53 PM

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

  • David Trasbo

    David Trasbo October 9th, 2010 @ 03:24 PM

    • 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.

  • Kane

    Kane October 9th, 2010 @ 05:26 PM

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

  • Kane

    Kane October 9th, 2010 @ 05:40 PM

    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.

  • David Trasbo

    David Trasbo October 9th, 2010 @ 07:16 PM

    • 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. ;)

  • Kane

    Kane October 9th, 2010 @ 07:38 PM

    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.

  • David Trasbo

    David Trasbo October 9th, 2010 @ 08:14 PM

    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.

  • Kane

    Kane October 12th, 2010 @ 05:31 PM

    • Tag set to patch jdbc postgresql rake task
  • Kane

    Kane October 12th, 2010 @ 05:32 PM

    • Tag changed from patch jdbc postgresql rake task to rake task, jdbc, patch, postgresql
  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:30 PM

    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.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:30 PM

    • State changed from “open” to “stale”
  • Kane

    Kane April 6th, 2011 @ 01:29 AM

    • 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.

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>

Attachments

Pages