Charmed PostgreSQL
- By Canonical Data Platform
- Databases
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 290 | 19 Apr 2023 | |
14/stable | 288 | 18 Apr 2023 | |
14/candidate | 288 | 18 Apr 2023 | |
14/beta | 288 | 18 Apr 2023 | |
14/edge | 297 | 19 May 2023 |
juju deploy postgresql --channel 14/stable
You will need Juju 2.9 to be able to run this command. Learn how to upgrade to Juju 2.9.
Deploy universal operators easily with Juju, the Universal Operator Lifecycle Manager.
Platform:
Interfaces/endpoints
The charm supports modern postgresql_client
and legacy pgsql
interfaces (in a backward compatible mode).
Note: do NOT relate both modern and legacy interfaces simultaneously!
Modern interfaces
This charm provides modern ‘postgresql_client’ interface. Applications can easily connect PostgreSQL using ‘data_interfaces’ library from ‘data-platform-libs’.
Modern postgresql_client
interface (database
endpoint):
Adding a relation is accomplished with juju relate
(or juju integrate
for Juju 3.x) via endpoint database
. Example:
# Deploy Charmed PostgreSQL cluster with 3 nodes
juju deploy postgresql -n 3 --channel 14
# Deploy the relevant application charms
juju deploy mycharm
# Relate PostgreSQL with your application
juju relate postgresql-k8s:database mycharm:database
# Check established relation (using postgresql_client interface):
juju status --relations
# Example of the properly established relation:
# > Relation provider Requirer Interface Type
# > postgresql:database mycharm:database postgresql_client regular
Legacy interfaces
Note: Legacy relations are deprecated and will be discontinued on future releases. Usage should be avoided.
Legacy pgsql
interface (db
and db-admin
endpoints):
This charm supports legacy interface pgsql
from the previous PostgreSQL charm:
juju relate postgresql:db mailman3-core
juju relate postgresql:db-admin landscape-server
Note: The endpoint db-admin
provides the same legacy interface pgsql
with PostgreSQL admin-level privileges. It is NOT recommended to use it from security point of view.
Help us improve this documentation
Most of this documentation can be collaboratively discussed and changed on the respective topic in the doc category of the Charmhub forum. See the documentation guidelines if you’d like to contribute.