PostgreSQL major versions

vmk8s

There are two generations of charms stored under the same charm name: postgresql. In these docs, we refer to them as “legacy” and “modern”.

There are two generations of charms stored under the same charm name: postgresql-k8s. In these docs, we refer to them as “legacy” and “modern”.

They are shipped in the following Charmhub tracks :

Charm name

Charmhub channel

Type

Status

PostgreSQL 16

16/stable

modern

check Latest version - new features are released here. See: PostgreSQL 16 documentation

PostgreSQL 14

14/stable

modern

check In maintenance mode - bug fixes and security updates only.

Legacy PostgreSQL charm

latest/stable

legacy

cross Deprecated. Migrate to 14 as soon as possible.

Legacy charm (deprecated)

Also known as a Reactive charm . Found in the Charmhub channel latest/stable.

Provided db and db-admin endpoints for the pgsql interface.

Modern charm

Also known as an Ops charm . Found in the Charmhub channels 14/stable and 16/stable.

14/stable provides legacy endpoints and new database endpoint for the postgresql_client interface.

16/stable does not provide legacy endpoints - only the new database database endpoint for the postgresql_client interface.

See also: Interfaces and endpoints

Choosing a version

  • For new deployments: Use PostgreSQL 16 for the latest features and long-term support

  • For existing PostgreSQL 14 deployments: Continue using PostgreSQL 14 or plan migration to 16

  • For legacy charm users: Migrate to PostgreSQL 14 as soon as possible

PostgreSQL 16

Latest stable version with active feature development.

  • Base: Ubuntu 24.04 LTS (Noble)

  • Supported architectures: amd64, arm64

  • Channel: 16/stable (latest development available for testing in 16/edge)

  • Juju version: Requires Juju 3.6+ LTS

  • Support status: check Active development and full support

New features

  • Juju spaces - Enhanced networking capabilities for complex deployment scenarios

  • Juju user secrets - Secure management of the charm’s internal passwords

  • Improved security hardening - Enhanced security posture and best practices

  • TLS v4 library migration

    • New endpoints client-certificates and peer-certificates

    • Endpoint peer-interfaces uses TLS by default

    • See all endpoints on Charmhub

  • Timescale Community Edition replaces Timescale Apache 2

  • Improved built-in roles - Enhanced role-based access control system

  • New refresh process for in-place upgrades

Deprecated or removed

Important changes to keep in mind when migrating from 14 to 16:

  • Legacy interface psql - Endpoints db and db-admin are no longer supported

  • Support for Juju < v3.6 removed

    • Charmed PostgreSQL 16 requires Juju 3.6+ LTS due to Juju secrets support

  • Juju actions get-password and set-password removed

  • Timescale Apache 2 edition replaced

  • Charm action set-tls-private-key removed

    • Will be re-introduced as Juju User Secrets in future releases

  • Charm actions renamed for consistency:

    • pre-upgrade-checkpre-refresh-check

    • resume-upgraderesume-refresh

    • Changes align with juju refresh terminology

  • Charm endpoint certificates split into separate endpoints:

    • client-certificates - For client certificate management

    • peer-certificates - For peer-to-peer certificate management

For detailed information about all PostgreSQL 16 releases, see Release notes.

PostgreSQL 14

Maintenance mode with bug fixes and security updates only.

  • Base: Ubuntu 22.04 LTS (Jammy)

  • Supported architectures: amd64, arm64

  • Channel: 14/stable

  • Juju version: Partially compatible with older Juju versions down to 2.9

  • Support status: 🔧 Bug fixes and security updates only

Features

For detailed information about all PostgreSQL 14 releases, see the PostgreSQL 14 Releases page .

Legacy 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 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
postgresql:
	charm: postgresql-k8s
	channel: 14/stable
	trust: true

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 also: Integrate with your charm.

How to deploy the legacy PostgreSQL charm

Deploy the charm using the channel latest/stable:

postgresql:
	charm: postgresql
	channel: latest/stable
postgresql:
	charm: postgresql-k8s
	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 also: Supported 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 Integrate 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 also: 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 .

The “legacy charm” (from latest/stable) is stored on Launchpad , here is the link to report all legacy charm issues .

The “modern charm” (from 14/stable) is stored on GitHub , here is the link to report modern charm issues .

Do you have questions? Contact us!