pgpartix configuration schema

Type: object
Schema for partition lifecycle. No Additional Properties

Type: object
The partition lifecycle configuration. No Additional Properties

Type: string Default: "."
Directory where generated files are written. Must match regular expression: ^\S+$

Must be at least 1 characters long

Type: object
A description of the partition lifecycle, available for use as {description} in output.file.naming.template. No Additional Properties

Type: string Default: "Make partitions for {parent_table_schema}.{parent_table_name}"
A description for making of partitions. Must match regular expression: ^\S(?:.*\S)?$

Must be at least 1 characters long

Type: string Default: "Expire partitions for {parent_table_schema}.{parent_table_name}"
A description for expiration of partitions. Must match regular expression: ^\S(?:.*\S)?$

Must be at least 1 characters long

Type: string Default: "Etc/UTC"
IANA timezone identifier defining the logical time context for all time-based operations (generation, expiry), independent of the execution environment (e.g. Europe/Berlin, UTC). Must match regular expression: ^\S+$

Must be at least 1 characters long

Type: object
Output configuration. No Additional Properties

Type: object
Output file configuration. No Additional Properties

Type: object
Output file naming configuration. No Additional Properties

Type: string Default: "pgpartix_output.sql"
Template for generating the output file name. Must match regular expression: ^\S+$

Must be at least 1 characters long


Examples:

V{integer}__{description}.sql
V{integer:3}__{description}.sql
{timestamp}__{description}.sql
{epoch}_{description}.up.sql

Type: boolean Default: false
Whether to generate idempotent SQL.

Type: object
Partition configuration. No Additional Properties

Type: object
Partition naming configuration. No Additional Properties

Type: string
Template for naming objects. Must match regular expression: ^\S+$

Must be at least 1 characters long


Examples:

{parent_schema}__{parent_name}__YYYY_MM
{parent_schema}__{parent_name}__YYYY_MM_DD

Type: string Default: "parent's schema"
Schema name. Must match regular expression: ^\S+$

Must be at least 1 characters long

Type: string
Tablespace for partitions. Must match regular expression: ^\S+$

Must be at least 1 characters long

Type: object
Storage parameters for partitions. No Additional Properties

Type: enum (of string) Default: "override"
Mode for storage parameters.

Must be one of:

  • "inherit"
  • "override"
  • "merge"

Type: object
Storage parameters to apply to partitions.
Example:

fillfactor: true
autovacuum_enabled: false

Type: string
The partition interval. Must match regular expression: ^\S(?:.*\S)?$

Must be at least 1 characters long


Examples:

2 hours
7 days
5 weeks
3 months
2 years

Default: "NOW"
The start timestamp for partition generation. Can also be LATEST_PARTITION to use the most recent partition.

Type: stringFormat: date-time
A timestamp in RFC 3339 format (YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM)
Type: enum (of string)

Must be one of:

  • "LATEST_PARTITION"
  • "NOW"

Examples:

2024-01-01T00:00:00Z
LATEST_PARTITION
NOW

Type: integer Default: 0
The number of past partitions to make.

Value must be greater or equal to 0

Type: integer Default: 0
The number of future partitions to make.

Value must be greater or equal to 0

Type: object
Default partition configuration. No Additional Properties

Type: boolean Default: false
Whether to create a DEFAULT partition when one does not already exist.

Type: object
Default partition naming configuration. No Additional Properties

Type: string Default: "{parent_table_schema}__{parent_table_name}__default"
Template for naming default partition. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{parent_schema}__{parent_name}__default

Type: boolean Default: false
Whether to skip overlapping partitions. Useful when switching partition intervals. It allows resolving such overlaps manually

Type: object
Constraint configuration. No Additional Properties

Type: object
Naming configuration for constraints. No Additional Properties

Type: string Default: "{partition_name}_{constraint_keys}_{constraint_suffix}"
Fallback template for constraint types without a specific naming template. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_{constraint_keys}_{constraint_suffix}

Type: object
Naming configuration for primary keys. No Additional Properties

Type: string Default: "{partition_name}_pkey"
Template for naming primary keys. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_pkey

Type: object
Naming configuration for foreign keys. No Additional Properties

Type: string Default: "{partition_name}_{constraint_keys}_fkey"
Template for naming foreign keys. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_{constraint_keys}_fkey

Type: object
Naming configuration for unique constraints. No Additional Properties

Type: string Default: "{partition_name}_{constraint_keys}_key"
Template for naming unique constraints. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_{constraint_keys}_key

Type: object
Naming configuration for check constraints. No Additional Properties

Type: string Default: "{partition_name}_{constraint_keys}_check"
Template for naming check constraints. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_{constraint_keys}_check

Type: object
Naming configuration for exclusion constraints. No Additional Properties

Type: string Default: "{partition_name}_{constraint_keys}_excl"
Template for naming exclusion constraints. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_excl

Type: object
Index configuration. No Additional Properties

Type: object
Index naming configuration. No Additional Properties

Type: string Default: "{partition_name}_{index_keys}_idx{ordinal}"
Template for naming indexes. Must match regular expression: ^\S+$

Must be at least 1 characters long


Examples:

{partition_name}_{index_keys}_idx
{partition_name}_{index_keys}_{index_type}_idx{ordinal}

Type: string
Tablespace for indexes. Must match regular expression: ^\S+$

Must be at least 1 characters long

Type: object
Trigger configuration.

Type: object
Trigger naming configuration. No Additional Properties

Type: string Default: "{partition_name}_{event_timing}_{trigger_event}_{trigger_function_name}{ordinal}"
Template for naming triggers. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_{event_timing}_{trigger_event}_{trigger_function_name}{ordinal}

Type: object
Configuration for expiring partitions. No Additional Properties

Type: string
Expire partitions older than this interval. Must match regular expression: ^\S(?:.*\S)?$

Must be at least 1 characters long


Examples:

2 hours
7 days
5 weeks
3 months
2 years

Type: boolean Default: false
Whether to detach expired partitions before dropping them.

Type: boolean Default: false
Whether to detach expired partitions without dropping them.

Type: boolean Default: false
Whether to detach expired partitions concurrently.

Type: array of object
List of tables to run partition lifecycle for.

Must contain a minimum of 1 items

No Additional Items

Each item of this array must be:

Type: object
The table to run partition lifecycle for. No Additional Properties

Type: string
The schema of the table. Must match regular expression: ^\S+$

Must be at least 1 characters long

Type: string
The name of the table. Must match regular expression: ^\S+$

Must be at least 1 characters long

Type: object
A description of the partition lifecycle, available for use as {description} in output.file.naming.template. No Additional Properties

Type: string Default: "Make partitions for {parent_table_schema}.{parent_table_name}"
A description for making of partitions. Must match regular expression: ^\S(?:.*\S)?$

Must be at least 1 characters long

Type: string Default: "Expire partitions for {parent_table_schema}.{parent_table_name}"
A description for expiration of partitions. Must match regular expression: ^\S(?:.*\S)?$

Must be at least 1 characters long

Type: object
Output configuration. No Additional Properties

Type: object
Output file configuration. No Additional Properties

Type: object
Output file naming configuration. No Additional Properties

Type: string Default: "pgpartix_output.sql"
Template for generating the output file name. Must match regular expression: ^\S+$

Must be at least 1 characters long


Examples:

V{integer}__{description}.sql
V{integer:3}__{description}.sql
{timestamp}__{description}.sql
{epoch}_{description}.up.sql

Type: boolean Default: false
Whether to generate idempotent SQL.

Type: object
The partition configuration for the table. No Additional Properties

Type: object
Partition naming configuration. No Additional Properties

Type: string
Template for naming objects. Must match regular expression: ^\S+$

Must be at least 1 characters long


Examples:

{parent_schema}__{parent_name}__YYYY_MM
{parent_schema}__{parent_name}__YYYY_MM_DD

Type: string Default: "parent's schema"
Schema name. Must match regular expression: ^\S+$

Must be at least 1 characters long

Type: string
Tablespace for partitions. Must match regular expression: ^\S+$

Must be at least 1 characters long

Type: object
Storage parameters for partitions. No Additional Properties

Type: enum (of string) Default: "override"
Mode for storage parameters.

Must be one of:

  • "inherit"
  • "override"
  • "merge"

Type: object
Storage parameters to apply to partitions.
Example:

fillfactor: true
autovacuum_enabled: false

Type: string
The partition interval. Must match regular expression: ^\S(?:.*\S)?$

Must be at least 1 characters long


Examples:

2 hours
7 days
5 weeks
3 months
2 years

Default: "NOW"
The start timestamp for partition generation. Can also be LATEST_PARTITION to use the most recent partition.

Type: stringFormat: date-time
A timestamp in RFC 3339 format (YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM)
Type: enum (of string)

Must be one of:

  • "LATEST_PARTITION"
  • "NOW"

Examples:

2024-01-01T00:00:00Z
LATEST_PARTITION
NOW

Type: integer Default: 0
The number of past partitions to make.

Value must be greater or equal to 0

Type: integer Default: 0
The number of future partitions to make.

Value must be greater or equal to 0

Type: object
Default partition configuration. No Additional Properties

Type: boolean Default: false
Whether to create a DEFAULT partition when one does not already exist.

Type: object
Default partition naming configuration. No Additional Properties

Type: string Default: "{parent_table_schema}__{parent_table_name}__default"
Template for naming default partition. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{parent_schema}__{parent_name}__default

Type: boolean Default: false
Whether to skip overlapping partitions. Useful when switching partition intervals. It allows resolving such overlaps manually

Type: object
Constraint configuration. No Additional Properties

Type: object
Naming configuration for constraints. No Additional Properties

Type: string Default: "{partition_name}_{constraint_keys}_{constraint_suffix}"
Fallback template for constraint types without a specific naming template. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_{constraint_keys}_{constraint_suffix}

Type: object
Naming configuration for primary keys. No Additional Properties

Type: string Default: "{partition_name}_pkey"
Template for naming primary keys. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_pkey

Type: object
Naming configuration for foreign keys. No Additional Properties

Type: string Default: "{partition_name}_{constraint_keys}_fkey"
Template for naming foreign keys. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_{constraint_keys}_fkey

Type: object
Naming configuration for unique constraints. No Additional Properties

Type: string Default: "{partition_name}_{constraint_keys}_key"
Template for naming unique constraints. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_{constraint_keys}_key

Type: object
Naming configuration for check constraints. No Additional Properties

Type: string Default: "{partition_name}_{constraint_keys}_check"
Template for naming check constraints. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_{constraint_keys}_check

Type: object
Naming configuration for exclusion constraints. No Additional Properties

Type: string Default: "{partition_name}_{constraint_keys}_excl"
Template for naming exclusion constraints. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_excl

Type: object
Index configuration. No Additional Properties

Type: object
Index naming configuration. No Additional Properties

Type: string Default: "{partition_name}_{index_keys}_idx{ordinal}"
Template for naming indexes. Must match regular expression: ^\S+$

Must be at least 1 characters long


Examples:

{partition_name}_{index_keys}_idx
{partition_name}_{index_keys}_{index_type}_idx{ordinal}

Type: string
Tablespace for indexes. Must match regular expression: ^\S+$

Must be at least 1 characters long

Type: object
Trigger configuration.

Type: object
Trigger naming configuration. No Additional Properties

Type: string Default: "{partition_name}_{event_timing}_{trigger_event}_{trigger_function_name}{ordinal}"
Template for naming triggers. Must match regular expression: ^\S+$

Must be at least 1 characters long


Example:

{partition_name}_{event_timing}_{trigger_event}_{trigger_function_name}{ordinal}

Type: object
Configuration for expiring partitions. No Additional Properties

Type: string
Expire partitions older than this interval. Must match regular expression: ^\S(?:.*\S)?$

Must be at least 1 characters long


Examples:

2 hours
7 days
5 weeks
3 months
2 years

Type: boolean Default: false
Whether to detach expired partitions before dropping them.

Type: boolean Default: false
Whether to detach expired partitions without dropping them.

Type: boolean Default: false
Whether to detach expired partitions concurrently.


The template table to replicate objects such as constraints, indexes, triggers from.

Type: enum (of string)
Must be one of the predefined options.

Must be one of:

  • "DEFAULT_PARTITION"
  • "LATEST_PARTITION"
  • "CURRENT_PARTITION"
Type: object
No Additional Properties

Type: string
Name of a thing. Must match regular expression: ^\S+$

Must be at least 1 characters long

Type: string
Name of a thing. Must match regular expression: ^\S+$

Must be at least 1 characters long