dokku-alt postgres superuser

213 views Asked by At

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?

2

There are 2 answers

0
Andy On

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.

0
xxx On

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