Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

pg:pull with connection string not just db name #2020

Open
wants to merge 1,354 commits into
base: master
Choose a base branch
from

Conversation

Robsteranium
Copy link

pg:pull should convert a connection string for a localhost target
(e.g. to force a port rather than socket connection) into (i.e. -h and
-p) arguments to postgres cli tools.

This was the case pg_dump and pg_restore but not for createdb.
This patch adjust the call of createdb to use the connection string
rather than just the database name.

Timothée Peignier and others added 30 commits September 30, 2015 15:28
report errors in removing old versions to rollbar
Since Postgres backups are tied to the app and not the add-on, but
we require *an* add-on to interact with, make sure that that add-on
is attached to the right app.
…achable-resources-issues

Improve handling of shareable add-ons w.r.t. Postgres backups
since they happen asynchronously now
remove all files when uninstalling on windows
do not delete v4 if error reading commands
fix localappdata with non-ascii characters
…gnose

Remove 9.1 warning on pg:diagnose output
Jeff Dickey and others added 29 commits June 29, 2016 11:51
right now these are ignored because they are flagged as hidden in the
new CLI. Really though we don't want these hidden, so adding this
exception in allows us to show the commands in the new CLI and still
have the old one keep the old functionality.
caller gets this stacktrace:

```
SSL_connect SYSCALL returned=5 errno=0 state=unknown state
/usr/lib/ruby/2.1.0/net/http.rb:920:in `connect'
/usr/lib/ruby/2.1.0/net/http.rb:920:in `block in connect'
/usr/lib/ruby/2.1.0/timeout.rb:76:in `timeout'
/usr/lib/ruby/2.1.0/net/http.rb:920:in `connect'
/usr/lib/ruby/2.1.0/net/http.rb:863:in `do_start'
/usr/lib/ruby/2.1.0/net/http.rb:852:in `start'
/usr/local/heroku/vendor/gems/rest-client-1.6.8/lib/restclient/request.rb:206:in
`transmit'
/usr/local/heroku/vendor/gems/rest-client-1.6.8/lib/restclient/request.rb:68:in
`execute'
/usr/local/heroku/vendor/gems/rest-client-1.6.8/lib/restclient/request.rb:35:in
`execute'
/usr/local/heroku/vendor/gems/rest-client-1.6.8/lib/restclient/resource.rb:51:in
`get'
/usr/local/heroku/lib/heroku/client/heroku_postgresql_backups.rb:55:in
`block (2 levels) in http_get'
/usr/local/heroku/lib/heroku/helpers.rb:126:in `retry_on_exception'
/usr/local/heroku/lib/heroku/client/heroku_postgresql_backups.rb:54:in
`block in http_get'
/usr/local/heroku/lib/heroku/client/heroku_postgresql_backups.rb:106:in
`checking_client_version'
/usr/local/heroku/lib/heroku/client/heroku_postgresql_backups.rb:53:in
`http_get'
/usr/local/heroku/lib/heroku/client/heroku_postgresql_backups.rb:20:in
`transfers_get'
/usr/local/heroku/lib/heroku/command/pg_backups.rb:455:in
`poll_transfer'
/usr/local/heroku/lib/heroku/command/pg_backups.rb:444:in
`restore_backup'
/usr/local/heroku/lib/heroku/command/pg_backups.rb:81:in `backups'
/usr/local/heroku/lib/heroku/command.rb:213:in `run'
/usr/local/heroku/lib/heroku/cli.rb:34:in `start'
/usr/local/heroku/bin/heroku:25:in `<main>'
```
* Update rest-client gem because security vulnerabilities

* add credentials to webmock urls

* Use url.parse & Addressable::Template

* Fix CI build breakage by mocking when no netrc
`pg:pull` should convert a connection string for a localhost target
(e.g. to force a port rather than socket connection) into (i.e. `-h` and
`-p`) arguments to postgres cli tools.

This was the case `pg_dump` and `pg_restore` but not for `createdb`.
This patch adjust the call of `createdb` to use the connection string
rather than just the database name.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet