Postgresql Psql

juju deploy postgresql-psql
Show information
You will need Juju 2.9 to be able to run this command. Learn how to upgrade to Juju 2.9.
Channel Version Revision Published Runs on
latest/stable 8 8 16 Feb 2021
Ubuntu 12.04
latest/edge 8 8 16 Feb 2021
Ubuntu 12.04

Platform:

Ubuntu
12.04

About

psql command line access to PostgreSQL services. Read more


Discuss this charm

Share your thoughts on this charm with the community on discourse.

Join the discussion

Overview

This charm provides access to related PostgreSQL services via the standard psql command line utility. It is useful as a development and database administration tool.

Usage

To setup a test environment::

juju bootstrap
juju deploy postgresql
juju deploy postgresql-psql psql
juju add-relationship postgresql:db psql:db
juju add-relationship postgresql:db-admin psql:db-admin

On the psql unit, wrappers to psql have been installed to provide easy access:

juju ssh 2

Standard 'db' relations have a wrapper installed connecting to the defined database on each individual PostgreSQL unit::

% psql-db-postgresql-0
psql (9.1.9)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.

psql=> \q

Administrative 'db-admin' relations have a wrapper installed that can be used to connect to any database on each individual PostgreSQL unit::

% psql-db-admin-postgresql-0 postgres
psql (9.1.9)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.

postgres=# \q

The default database name for 'db' relations may be overridden::

juju set psql database=foo2
juju ssh 2

% psql-db-postgresql-0
psql (9.1.9)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.

foo2=> \q