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.

rake db:structure:dump fails with PostgreSQL 9.0 and ident authentication

#5776

rake db:structure:dump fails with PostgreSQL 9.0 and ident authentication.

pg_dump: [archiver (db)] connection to database "myproject_development" failed: FATAL: no PostgreSQL user name specified in startup packet

Problem is in the following line in lib/tasks/databases.rake:

pg_dump -i -U "#{abcs[RAILS_ENV]["username"]}" -s -x -O -f db/#{RAILS_ENV}_structure.sql #{search_path} #{abcs[RAILS_ENV]["database"]}

When using PostgreSQL's ident authentication there is no user name. So it is passing -U "" to pg_dump which is invalid.

Solution would be to only include the user name option if a user name is set.

Reported by JackC · October 9th, 2010 @ 10:20 PM

State: stale
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. JackC
    JackC
    • Tag changed from pg_dump postgresql 9.0 ident, 2.3.x to pg_dump postgresql 9.0 ident, 2.3.x, minor

    A simple workaround is to explicitly include username in database.yml.

    October 9th, 2010 @ 10:43 PM

  2. Kane
    Kane

    appended a patch against edge

    October 9th, 2010 @ 11:32 PM

  3. Jeff Kreeftmeijer
    Jeff Kreeftmeijer
    • State changed from new to open
    • Tag changed from pg_dump postgresql 9.0 ident, 2.3.x, minor to 2.3.x, minor, patch, pg_dump, postgresql
    • Importance changed from to Low

    October 10th, 2010 @ 08:15 AM

  4. Jason Weathered
    Jason Weathered

    +1 This bug also exists in 3.x.

    November 19th, 2010 @ 12:09 AM

  5. James Herdman
    James Herdman
    1. Burned by this big time right now.

    December 14th, 2010 @ 03:11 PM

  6. rails
    rails
    • Tag changed from 2.3.x, minor, patch, pg_dump, postgresql to 23x, minor, patch, pg_dump, postgresql

    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.

    March 15th, 2011 @ 12:00 AM

  7. rails
    rails
    • State changed from open to stale

    March 15th, 2011 @ 12:00 AM

  8. Nigel Ramsay
    Nigel Ramsay
    • Tag changed from 23x, minor, patch, pg_dump, postgresql to 23x, ident, minor, patch, pg_dump, postgresql

    March 29th, 2011 @ 11:13 PM