Charmed PostgreSQL

Channel Revision Published Runs on
latest/stable 316 11 Aug 2023
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04
14/stable 288 18 Apr 2023
Ubuntu 22.04
14/candidate 326 19 Sep 2023
14/beta 330 27 Sep 2023
14/edge 330 26 Sep 2023
juju deploy postgresql --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 (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 16 days ago. Help improve this document in the forum.