postgresql psql #1
Description
Access to related PostgreSQL services via the standard psql command line utility.
- Tags:
- databases ›
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