Charmed PostgreSQL K8s

Channel Revision Published Runs on
latest/stable 20 20 Sep 2022
Ubuntu 20.04
14/stable 73 18 Apr 2023
Ubuntu 22.04
14/candidate 139 19 Sep 2023
14/beta 145 26 Sep 2023
14/edge 148 Yesterday
juju deploy postgresql-k8s --channel 14/stable
Show information


How to integrate DB with my charm

Please check the supported interfaces of the current charm first. You have options to use modern (preferred) or legacy interfaces. Make sure you are familiar with Juju integration concepts.

The most existing charms currently use ops-lib-pgsql interface (legacy). Canonical recommends for new charms to use data-platform-libs instead. You can take a look at postgresql-test-app and juju-sdk-tutorial-k8s for more practical examples (the branch 04_integrate_with_psql describes integration with Charmed PostgreSQL K8s (read the great manual first). The legacy charm details are well described here.

Success stories:


  • Q: Does the requirer need to set anything in relation data?
    A: it depends on the interface. Check the postgresql_client interface requirements.
  • Q: Is there a charm library available, or does my charm need to compile the postgresql relation data on its own?
    A: Yes, the library is available: data-platform-libs. The integration is trivial: example.
  • Q: How do I obtain the database url/uri?
    A: it is planned, but currently missing. Meanwhile use this example, or follow:


Contact us if you have any questions, issues and/or ideas!

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.

Last updated 14 days ago. Help improve this document in the forum.