{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/21226","labels_url":"https://api.github.com/repos/rails/rails/issues/21226/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/21226/comments","events_url":"https://api.github.com/repos/rails/rails/issues/21226/events","html_url":"https://github.com/rails/rails/issues/21226","id":100832329,"number":21226,"title":"Postgres db:structure:dump and :load don't work with remote databases","user":{"login":"schneems","id":59744,"avatar_url":"https://avatars.githubusercontent.com/u/59744?v=3","gravatar_id":"","url":"https://api.github.com/users/schneems","html_url":"https://github.com/schneems","followers_url":"https://api.github.com/users/schneems/followers","following_url":"https://api.github.com/users/schneems/following{/other_user}","gists_url":"https://api.github.com/users/schneems/gists{/gist_id}","starred_url":"https://api.github.com/users/schneems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schneems/subscriptions","organizations_url":"https://api.github.com/users/schneems/orgs","repos_url":"https://api.github.com/users/schneems/repos","events_url":"https://api.github.com/users/schneems/events{/privacy}","received_events_url":"https://api.github.com/users/schneems/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails/rails/labels/activerecord","name":"activerecord","color":"0b02e1"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/rails/rails/milestones/34","html_url":"https://github.com/rails/rails/milestones/5.0.0","labels_url":"https://api.github.com/repos/rails/rails/milestones/34/labels","id":665192,"number":34,"title":"5.0.0","description":null,"creator":{"login":"rafaelfranca","id":47848,"avatar_url":"https://avatars.githubusercontent.com/u/47848?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaelfranca","html_url":"https://github.com/rafaelfranca","followers_url":"https://api.github.com/users/rafaelfranca/followers","following_url":"https://api.github.com/users/rafaelfranca/following{/other_user}","gists_url":"https://api.github.com/users/rafaelfranca/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelfranca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelfranca/subscriptions","organizations_url":"https://api.github.com/users/rafaelfranca/orgs","repos_url":"https://api.github.com/users/rafaelfranca/repos","events_url":"https://api.github.com/users/rafaelfranca/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelfranca/received_events","type":"User","site_admin":false},"open_issues":96,"closed_issues":137,"state":"open","created_at":"2014-05-21T00:58:22Z","updated_at":"2015-08-14T07:57:36Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-08-13T18:07:49Z","updated_at":"2015-08-14T07:57:36Z","closed_at":"2015-08-14T07:57:36Z","body":"On this line https://github.com/rails/rails/blob/e50fe85180648be0c4216bd0111f05be1df0988a/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb#L64\r\n\r\nWe are shelling out to `pg_dump` and passing in the database name. This doesn't include, host, password, or any other connection information. if your database is not on the same server where rails is, then this command will fail with a cryptic error:\r\n\r\n```\r\nError: You must install at least one postgresql-client-<version> package.\r\n```\r\n\r\nThe same is true here: https://github.com/rails/rails/blob/e50fe85180648be0c4216bd0111f05be1df0988a/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb#L71\r\n\r\nWe need to pass in full configuration options to these tasks so that they'll work with remote databases.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/131011145","html_url":"https://github.com/rails/rails/issues/21226#issuecomment-131011145","issue_url":"https://api.github.com/repos/rails/rails/issues/21226","id":131011145,"user":{"login":"matthewd","id":1034,"avatar_url":"https://avatars.githubusercontent.com/u/1034?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewd","html_url":"https://github.com/matthewd","followers_url":"https://api.github.com/users/matthewd/followers","following_url":"https://api.github.com/users/matthewd/following{/other_user}","gists_url":"https://api.github.com/users/matthewd/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewd/subscriptions","organizations_url":"https://api.github.com/users/matthewd/orgs","repos_url":"https://api.github.com/users/matthewd/repos","events_url":"https://api.github.com/users/matthewd/events{/privacy}","received_events_url":"https://api.github.com/users/matthewd/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T07:57:36Z","updated_at":"2015-08-14T07:57:36Z","body":"> `set_psql_env`\r\n\r\nIndeed. @schneems, you need to.. install at least one `postgresql-client-<version>` package.\r\n\r\n(Unless you're saying it's cryptic because you actually already have one. But in that case, it would be a bug for [elsewhere](https://tracker.debian.org/pkg/postgresql-common).)"}}