Install Admin GUI for Dingo PostgreSQL™

There are many web-based admin GUIs for PostgreSQL and in this section we document how to install a few of them.

phpPgAdmin

phpPgAdmin has a phppgadmin-cf fork maintained by @ArthurHlt from Orange that makes it easy to run on Pivotal Cloud Foundry® and bind to one or more Dingo PostgreSQL™ in the same space.

Deploy

phppgadmin-cf is ready to be deployed to your Pivotal Cloud Foundry®.

First, target the org/space where your application and Dingo PostgreSQL™ database are running. This is required so that phppgadmin can bind to the same service instance.

cf target -o org -s prod

Download and deploy the application:

wget https://github.com/cloudfoundry-community/phppgadmin-cf/archive/cf-ready.zip
unzip cf-ready.zip
cd phppgadmin-cf-cf-ready
cf push

The running application does not yet have access to your Dingo PostgreSQL™ service instance.

Bind each service instance and restart:

cf bind-service phppgadmin-cfready <dingo-pg-db>
cf restart phppgadmin-cfready

Loosen security

If you temporarily need to login to your database using superuser/root privileges then you’ll need to reconfigure and redeploy the app.

Edit conf/config.inc.php and change the line:

$conf['extra_login_security'] = true;

to

$conf['extra_login_security'] = false;

Save and re-deploy the application again:

cf push

Login

When you access phpPgAdmin you will see each of the databases (bound service instances) on the left hand tree view.

phppgadmin-start

Click on the service instance of interest and you will be prompted to login. Use normal credentials or root/superuser credentials if required (see Loosen security section above to allow root/superuser access).

phppgadmin-login

Your Dingo PostgreSQL™ service instance contains a single database (called postgres in example below). Click the database name (postgres).

phppgadmin-select-db-postgres

Import SQL

After logging in and navigating to the postgres database you can now import SQL files (such as backups from previous PostgreSQL databases).

Click on “SQL” menu item (found between “Schemas” and “Find” options).

phppgadmin-select-menu-sql

Either paste in your SQL query/import, or choose a local .sql file to upload and process.

phppgadmin-choose-sql-file

The SQL query results, or the results of importing SQL data, will be displayed.

phppgadmin-query-results

As shown above, newly imported tables and other schema changes are now navigatable on the left hand side.