pg.ddx.io  pgpartman/pg_partman GitHub issues and pull requests  
help / color / mirror / Atom feed
From: dylanpulver (@dylanpulver) <noreply+dylanpulver@github.com>
To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>
Subject: Re: [pgpartman/pg_partman] discussion #890: Do we need to rename daily/monthly partitions when upgrading from 4.7 to 5+?
Date: Mon, 16 Nov 2026 19:52:32 +0000
Message-ID: <gh-pgpartman-pg_partman-890-dc19662213@github.com> (raw)
In-Reply-To: <gh-pgpartman-pg_partman-890@github.com>
References: <gh-pgpartman-pg_partman-890@github.com>

You read the upgrade doc right. Only the old ISO weekly (`IYYY"w"IW`) and quarterly (`YYYY"q"Q`) suffixes have to be migrated. Daily and monthly sets with `YYYY_MM_DD` / `YYYY_MM` keep working as they are.

The `datetime_string` is stored per partition set in `part_config`, and maintenance builds new child names from that stored value, not from the new default. You can see it in `sql/functions/create_partition_time.sql`, which reads `datetime_string` from `part_config` and then does `to_char(v_time, v_datetime_string)`. The upgrade script (`updates/pg_partman--4.8.0--5.0.0.sql`) leaves the column alone and only raises a WARNING if it finds the weekly or quarterly formats.

The new `YYYYMMDD` / `YYYYMMDD_HH24MISS` suffixes only apply to sets you create with `create_parent()` on 5.x. The 5.0.0 & 5.0.1 CHANGELOG entry says it directly: "Existing partition suffixes will still be supported, but newly created partition sets will use the new naming patterns by default. It is recommended that migration to the new suffixes is done when possible to ensure future support of possible pg_partman changes."

So for your `7 days` set: it's a plain interval, not the ISO weekly format, so its `YYYY_MM_DD` children are fine.

Renaming is optional. If you want consistent names later, the weekly migration steps in `doc/pg_partman_5.0.1_upgrade.md` work for daily/monthly too: rename the children and update `datetime_string` in `part_config` to `YYYYMMDD`. Monthly children would get a `01` day, so `_p2026_11` becomes `_p20261101`.

One thing from the same CHANGELOG section that does bite on a 4.7 to 5.x jump: many function parameters were renamed or removed, and privileges on extension objects are not preserved across the update. Worth checking any `create_parent()` / `run_maintenance()` calls in your scripts and recording grants before you upgrade.

view thread (4+ messages)  latest in thread

Message-ID: <gh-pgpartman-pg_partman-890-dc19662213@github.com>
Permalink:  ../gh-pgpartman-pg_partman-890-dc19662213@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox