Flink / dokku-psql-single-container

Plugin for dokku that provides a Postgresql server in a single container
MIT License
51 stars 9 forks source link

How can I pass --data-only --table when doing a dump? #21

Open sglebs opened 8 years ago

sglebs commented 8 years ago

How can I perform a dump as described in https://feeding.cloud.geek.nz/posts/restoring-single-table-from-postgres/ , passing --data-only and --table ?

I would like to pass these parameters on dump and, in some cases, on restore as well (when restoring from full dumps).

If you can provide an example, that would be great. Thanks!

sglebs commented 8 years ago

FOr the record, this did not work for me:

dokku psql:dump softdispdjango-dev --data-only --table=dashboard_system --table=dashboard_systemdependency  > softdispdjango-dev.dump
Flink commented 8 years ago

Well you can’t, the dump and restore commands are done like it works on heroku. What you can do is to use directly pg_dump and pg_restore in the container via docker exec. You could do something like docker exec -i psql-single-container pg_dump --data-only … > database.dump I think

sglebs commented 8 years ago

dokku 0.4.5 via vagrant installs in such a way that docker commends are failing.

vagrant@dokku-vagrant:~$ docker ps
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

Doing some RTFM to figure things out.

Flink commented 8 years ago

You have to use sudo to use docker :)

sglebs commented 8 years ago

d'oh of course!

sglebs commented 8 years ago

For the record, I am only trying to do this because of the problems I had in ticket #22 with a regular, full dump&restore.