MP108WARNINGFreeNeeds --database-url

warn-partman-managed-parent

What It Detects

Manual partition DDL on a parent table managed by pg_partman.

Why It's Dangerous

pg_partman decides which children exist, from what part_config says: run_maintenance pre-creates the next few partitions according to premake and drops old ones according to retention, on its own schedule. A partition created, attached, or detached by hand is not recorded there, so the next maintenance run can try to create a partition whose range you have already covered — which fails — or drop one it believes it owns. Nothing goes wrong at migration time; it surfaces later on a scheduled run nobody is watching.

Bad Example

-- events is managed by pg_partman (interval 1 day, premake 4, retention 90 days)
CREATE TABLE events_p2024_01 PARTITION OF events
  FOR VALUES FROM ('2024-01-01') TO ('2024-02-01');

Good Example

-- Check what partman thinks it owns, then let it make the partitions
-- by widening how far ahead it pre-creates.
SELECT parent_table, control, partition_interval, premake, retention
FROM part_config WHERE parent_table LIKE '%events';

Configuration

Disable this rule:

# .migrationpilotrc.yml
rules:
  MP108: false

Or change its severity:

# .migrationpilotrc.yml
rules:
  MP108:
    severity: warning