简体   繁体   中英

dokku-alt postgres superuser

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?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM