0

I am trying to use dokku-alt (https://github.com/dokku-alt/dokku-alt) to provision a VPS for a Rails App (Ruby 2.1.3, Rails 4.1.2), but my app uses a Postgres extension (pg_trgm).

Unfortunately dokku-alt doesn't currently support the admin_console command, as opposed to here: https://github.com/jeffutter/dokku-postgresql-plugin

Does anyone know of a way to get into the postgres console using the root or postgres user given that Docker is being used?

David A
  • 567
  • 6
  • 16
  • We would appreciate it if you would accept the answer or else comment on how/why it failed? It helps others reading these questions to know if the answer worked or not. – iconoclast Dec 02 '14 at 02:13

2 Answers2

0

Yeah you can do it like so:

docker ps

That should give you a list of containers and their ID's, find the one that is running your postgres instance (could be one for all apps, might be one for each other app)

docker run <container_name> psql
Hairy Chris
  • 1,407
  • 14
  • 23
0

If you're using even close the latest version of dokku-alt, there is a admin console command.

I recently ran into a problem where I had to grant super user access to one of our apps.

What I did was

dokku postgresql:console:admin <<EOF ALTER USER dbusername WITH SUPERUSER; EOF

Running dokku postgresql:console:admin should give you direct access into the main psql console.

nmargaritis
  • 819
  • 7
  • 21
Andy
  • 31
  • 4