Legacy PostgreSQL charm

The legacy PostgreSQL charm is a Reactive charm in the Charmhub channel latest/stable.

It provided db and db-admin endpoints for the pgsql interface.

We strongly advise against using the now deprecated latest/ track. It will be removed from Charmhub in the near future.

The default Charmhub track

The default track was switched from the latest/ to 14/ to ensure all new deployments use a modern codebase. See this Discourse post for more information about the switch.

How to migrate from legacy to modern

To migrate from the legacy PostgreSQL charm to the modern PostgreSQL 14 charm, you can use two approaches:

Quick method: Since PostgreSQL 14 provides the legacy databases, you can simply relate your application with the new charm with the same db endpoint without any extra changes:

  postgresql:
    charm: postgresql
    channel: 14/stable

However, keep in mind that PostgreSQL 16 no longer supports legacy interfaces, so if you plan on moving to 16 in the future, you will need to use the method below eventually.

Recommended method: Migrate your application to the new postgresql_client interface.

The application will connect to PostgreSQL using the data_interfaces library from data-platform-libs via the database endpoint.

See: How to integrate PostgreSQL with your charm

How to deploy the legacy PostgreSQL charm

Deploy the charm using the channel latest/stable:

  postgresql:
    charm: postgresql
    channel: latest/stable

Caution

Remove the charm store prefix cs: from the bundle. Otherwise, the modern charm will be chosen by Juju (due to the default track pointing to 14/stable and not latest/stable).

A common error message is: cannot deploy application "postgresql": unknown option "...".

Configuration options

The legacy charm config options were not moved to the modern charms. Modern charms apply the best possible configuration automatically.

Feel free to contact us about the database tuning and configuration options.

Extensions supported by modern charm

The legacy charm provided plugins/extensions enabling through the relation (interface pgsql).This is NOT supported by modern charms (neither pgsql nor postgresql_client interfaces). Please enable the necessary extensions using appropriate plugin_*_enable config option of the modern charm. After enabling the modern charm, it will provide plugins support for both pgsql (only if it’s PostgreSQL 14) and postgresql_client interfaces.

See: Supported plugins/extensions

Feel free to contact us if there is a particular extension you are interested in.

Roles supported by modern charm

In the legacy charm, the user could request roles by setting the roles field to a comma separated list of desired roles. This is NOT supported by the 14/ modern charm implementation of the legacy pgsql interface.

The same functionality is provided via the modern postgresql_client using extra-user-roles.

For more information about migrating the new interface on PostgreSQL 14, see How to integrate PostgreSQL with your charm.

Workload artifacts

The legacy charm used to deploy PostgreSQL from APT/Debian packages, while the modern charm installs and operates PostgreSQL snap charmed-postgresql.

See: Architecture.

How to report issues and contact authors

The legacy charm (from latest/stable) is stored on Launchpad. Report legacy charm issues here.

The modern charms are stored on GitHub: PostgreSQL 14 branch and PostgreSQL 16 branch . Report modern charm issues here.

Do you have questions? Contact us!