Dashboard Configuration

This extension requires activation via the PlanetScale Dashboard before it can be used. It must be enabled through shared libraries and requires a database restart. To enable pg_partman_bgw:
1

From the PlanetScale organization dashboard, select the desired database
2

Navigate to the Cluster configuration page from the menu on the left
3

Choose the branch whose extensions you’d like to configure in the “Branch” dropdown
4

Select the Extensions tab
5

Enable pg_partman_bgw and configure its parameters
6

Click Queue extension changes to apply the configuration
7

Once you’re ready to apply the changes, click “Apply changes

Parameters

pg_partman_bgw.interval

  • Type: Integer
  • Default: 3600
  • Description: Interval (in seconds) between partition maintenance runs.

pg_partman_bgw.dbname

  • Type: String
  • Default: postgres
  • Description: Database name where the background worker should connect.

pg_partman_bgw.role

  • Type: String
  • Default: postgres
  • Description: Role that the background worker should use when connecting.

pg_partman_bgw.analyze

  • Type: Boolean
  • Default: false
  • Description: Whether to run ANALYZE on newly created partitions.

pg_partman_bgw.jobmon

  • Type: Boolean
  • Default: true
  • Description: Enable job monitoring for partition maintenance activities.

Usage

After enabling the extension through the dashboard, the background worker will automatically run partition maintenance based on your pg_partman configuration. You’ll also need to install the pg_partman extension:
CREATE EXTENSION IF NOT EXISTS pg_partman;
The background worker works in conjunction with pg_partman to automatically maintain your partitioned tables.

External Documentation

For more detailed information about pg_partman and pg_partman_bgw usage, see the official pg_partman documentation.