---
title: Charmhub | Deploy PgBouncer using Charmhub - The Open Operator Collection
description: Deploy the latest version of PgBouncer on any cloud.
url: https://charmhub.io/pgbouncer/docs/e-legacy-charm
---

# PgBouncer

[Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")

* [Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")
* [Databases](https://charmhub.io/?filter=databases)

Platform:

24.04

22.04

20.04

18.04

16.04

1/stable 1092

```
juju deploy pgbouncer --channel 1/stable
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

#### Relevant links

* [Homepage](https://ubuntu.com/data/postgresql)

---

#### Contacts

##### Maintainers

+ [Canonical Data Platform](mailto:data-platform@lists.launchpad.net)

* [Submit a bug](https://github.com/canonical/pgbouncer-operator/issues)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

# Legacy charms

This page contains explanations regarding the legacy version of this charm. This includes clarification about Charmhub tracks, supported endpoints and interfaces, config options, and other important information.

## [Summary](https://charmhub.io/pgbouncer/docs/e-legacy-charm#p-31184-summary)

* [Charm types: “legacy” vs. “modern”](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--charm-types)
* [Default track `latest/` vs. track `1/`](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--default-track)
* [How to migrate to the modern charm](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--how-to-migrate)
* [How to deploy the legacy charm](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--how-to-deploy-legacy)
* [Features supported by the modern charm](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--features-supported-by-modern)
  + [Config options](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--config-options)
  + [Extensions](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--extensions)
  + [Roles](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--roles)
  + [PostgreSQL versions](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--postgresql-versions)
  + [Architectures](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--architectures)
* [Contact us](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--contact-us)

---

## [Charm types: “legacy” vs. “modern”](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--charm-types)

There are [two types of charms](https://juju.is/docs/sdk/charm-taxonomy#heading--charm-types-by-generation) stored under the same charm name `pgbouncer`:

1. [Reactive](https://juju.is/docs/sdk/charm-taxonomy#heading--reactive) charm in the channel `latest/stable` (called `legacy`)
2. [Ops-based](https://juju.is/docs/sdk/ops) charm in the channel `1/stable` (called `modern`)

The legacy charm was a [**principal charm**](https://juju.is/docs/sdk/charm-taxonomy#heading--principal-charms), while the modern charm is [**subordinated**](https://juju.is/docs/sdk/charm-taxonomy#heading--subordinate-charms).

The legacy charm provided SQL endpoints `db` and `db-admin` (for the interface `pgsql`). The modern charm provides those old endpoints and a new endpoint `database` (for the interface `postgresql_client`). Read more details about the available endpoints and interfaces [here](https://charmhub.io/pgbouncer/docs/e-interfaces?channel=1/stable).

The interface `hacluster` [supported](https://charmhub.io/pgbouncer/docs/h-external-access) on both legacy and modern charms.

Non-SQL legacy charm interfaces (e.g. `pgbouncer-extra-config`, `nrpe-external-master`) are currently NOT supported by the modern charm. [Contact us](https://charmhub.io/pgbouncer/docs/r-requirements) with your use cases for those interfaces!

**Note**: Please choose one endpoint to use. No need to relate all of them simultaneously!

## [Default track `latest/` vs. track `1/`](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--default-track)

The [default track](https://docs.openstack.org/charm-guide/yoga/project/charm-delivery.html) will be switched from the `latest` to `1` soon. This is to ensure all new deployments use a modern codebase. We strongly advise against using the latest track, since a future charm upgrade may result in a PgBouncer version incompatible with an integrated application. Track `1/` guarantees a PgBouncer major version 1 deployment only. The track `latest/` will be closed after all applications migrated from reactive to the ops-based charm.

## [How to migrate to the modern charm](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--how-to-migrate)

The modern charm provides temporary support for the legacy interfaces:

**Quick try**: relate the current application with new charm using endpoint `db` (set the channel to `1/stable`). No extra changes necessary:

```
  pgbouncer:
    charm: pgbouncer
    channel: 1/stable
```

**Proper migration**: migrate the application to the new interface [`postgresql_client`](https://github.com/canonical/charm-relation-interfaces). The application will connect PgBouncer using the [data\_interfaces](https://charmhub.io/data-platform-libs/libraries/data_interfaces) library from [data-platform-libs](https://github.com/canonical/data-platform-libs/) via the endpoint `database`.

**Warning**: In-place upgrades are NOT possible! The reactive charm cannot be upgraded to the operator-framework-based one. The second/modern charm application must be launched nearby and relations should be switched from the legacy application to the modern one.

## [How to deploy the legacy charm](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--how-to-deploy-legacy)

Deploy the charm using the channel `latest/stable`:

```
  pgbouncer:
    charm: pgbouncer
    channel: latest/stable
```

**Note**: remove Charm store prefix `cs:` from the bundle. Otherwise the modern charm will be chosen by Juju (due to the default track will be pointing to `1/stable` and not `latest/stable`). The common error message is: `cannot deploy application "postgresql": unknown option "..."`.

## [Features supported by the modern charm](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--features-supported-by-modern)

This section goes over the key differences in feature support and functionality between the legacy and modern charm.

### [Config options](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--config-options)

The legacy charm config options were not moved to the modern charm, since the modern charm applies the best possible configuration automatically. Feel free to [contact us](https://charmhub.io/pgbouncer/docs/r-contacts) about the PgBouncer config options.

### [Extensions](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--extensions)

The legacy charm provided plugins/extensions through the relation (interface `pgsql`). This is NOT supported by the modern charm - neither through `pgsql` nor the `postgresql_client` interface.

To enable extensions on modern PgBouncer, enable them on PostgreSQL charm using the appropriate `plugin_*_enable` [config option](https://charmhub.io/postgresql/configure) of the modern charm. The modern charm will then provide plugins support for both `pgsql` and `postgresql_client` interfaces.

### [Roles](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--roles)

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 modern charm implementation of the legacy `pgsql` interface.

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

### [PostgreSQL versions](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--postgresql-versions)

At the moment, the modern PgBouncer charms support relation to the modern Charmed PostgreSQL 14 (based on Jammy/22.04 series) only.
Please [contact us](https://charmhub.io/pgbouncer/docs/r-contacts) if you need different versions/series.

### [Architectures](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--architectures)

Currently, the charm supports architecture `amd64` and `arm64` only. For more technical details, see the [Supported architectures](https://charmhub.io/pgbouncer/docs/r-requirements?channel=1/stable) reference.

### [Interfaces](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--architectures)

The modern charm also support the legacy interface `pgsql` (endpoints `db` and `db-admin`) ([see Integrations](https://charmhub.io/pgbouncer/integrations?channel=1/stable#db)) however migration to the modern interface `postgresql_client` is [trivial and highly recommended](https://charmhub.io/postgresql/docs/h-integrate-with-your-charm).

The legacy charm also supports interface `ha` which is not yet supported by modern charm. Feel free to contact us if you are interested in the `ha` interface support.

## [Report issues](https://charmhub.io/pgbouncer/docs/e-legacy-charm#heading--contact-us)

The “legacy charm” (from `latest/stable`) is stored on [Launchpad](https://git.launchpad.net/pgbouncer-charm/). Report legacy charm issues [here](https://bugs.launchpad.net/pgbouncer-charm).

The “modern charm” (from `1/stable`) is stored on [GitHub](https://github.com/canonical/pgbouncer-operator). Report modern charm issues [here](https://github.com/canonical/pgbouncer-operator/issues/new/choose).

Do you have questions? [Reach out](https://charmhub.io/pgbouncer/docs/r-requirements) to us!

---
