This project is archived and is in readonly mode.

#5776 ✓stale
JackC

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

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

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.

Comments and changes to this ticket

  • JackC

    JackC October 9th, 2010 @ 10:43 PM

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

  • Kane

    Kane October 9th, 2010 @ 11:32 PM

    appended a patch against edge

  • Jeff Kreeftmeijer

    Jeff Kreeftmeijer October 10th, 2010 @ 08:15 AM

    • 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”
  • Jason Weathered

    Jason Weathered November 19th, 2010 @ 12:09 AM

    +1 This bug also exists in 3.x.

  • James Herdman

    James Herdman December 14th, 2010 @ 03:11 PM

    1. Burned by this big time right now.
  • rails

    rails March 15th, 2011 @ 12:00 AM

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

  • rails

    rails March 15th, 2011 @ 12:00 AM

    • State changed from “open” to “stale”
  • Nigel Ramsay

    Nigel Ramsay March 29th, 2011 @ 11:13 PM

    • Tag changed from 23x, minor, patch, pg_dump, postgresql to 23x, ident, minor, patch, pg_dump, postgresql

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