pg.ddx.io  pgpartman/pg_partman GitHub issues and pull requests  
help / color / mirror / Atom feed
[pgpartman/pg_partman] discussion #890: Do we need to rename daily/monthly partitions when upgrading from 4.7 to 5+?
4+ messages / 3 participants
[nested] [flat]

* [pgpartman/pg_partman] discussion #890: Do we need to rename daily/monthly partitions when upgrading from 4.7 to 5+?
@ 2026-11-16 17:56  "dtseiler (@dtseiler)" <noreply+dtseiler@github.com>
  0 siblings, 0 replies; 4+ messages in thread

From: dtseiler (@dtseiler) @ 2026-11-16 17:56 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

I'm (finally) looking to upgrade from 4.7.4 to the current version. My instances are partitioned daily or monthly. One case has a `partition_interval` of `7 days` but it is NOT `1 week`. The partitions all have a `datetime_string` format of `YYYY_MM_DD` (or `YYYY_MM` for monthly).

I re-read [the upgrade doc](https://github.com/pgpartman/pg_partman/blob/development/doc/pg_partman_5.0.1_upgrade.md) and it reads to me like the concern is only for weekly/quarterly partitioned tables. When v5.0.0 was first released, I was under the impression that I would have to rename all of my partitions to from `YYYY_MM_DD` to `YYYYMMDD` (presumably `YYYY_MM` becomes `YYYYMM01`?). Is this not the case or am I really misinterpreting the upgrade docs?

^ permalink  raw  [nested|flat] 4+ messages in thread

* Re: [pgpartman/pg_partman] discussion #890: Do we need to rename daily/monthly partitions when upgrading from 4.7 to 5+?
@ 2026-11-16 19:52  "dylanpulver (@dylanpulver)" <noreply+dylanpulver@github.com>
  2 siblings, 0 replies; 4+ messages in thread

From: dylanpulver (@dylanpulver) @ 2026-11-16 19:52 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@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.

^ permalink  raw  [nested|flat] 4+ messages in thread

* Re: [pgpartman/pg_partman] discussion #890: Do we need to rename daily/monthly partitions when upgrading from 4.7 to 5+?
@ 2026-11-19 15:33  "keithf4 (@keithf4)" <noreply+keithf4@github.com>
  2 siblings, 0 replies; 4+ messages in thread

From: keithf4 (@keithf4) @ 2026-11-19 15:33 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

Thank you for the answer, @dylanpulver 

^ permalink  raw  [nested|flat] 4+ messages in thread

* Re: [pgpartman/pg_partman] discussion #890: Do we need to rename daily/monthly partitions when upgrading from 4.7 to 5+?
@ 2026-11-19 18:41  "dtseiler (@dtseiler)" <noreply+dtseiler@github.com>
  2 siblings, 0 replies; 4+ messages in thread

From: dtseiler (@dtseiler) @ 2026-11-19 18:41 UTC (permalink / raw)
  To: pgpartman/pg_partman <noreply+pgpartman-pg_partman@github.com>

Great to hear, thanks!

^ permalink  raw  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2026-11-19 18:41 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 17:56 [pgpartman/pg_partman] discussion #890: Do we need to rename daily/monthly partitions when upgrading from 4.7 to 5+? "dtseiler (@dtseiler)" <noreply+dtseiler@github.com>
2026-11-16 19:52 ` "dylanpulver (@dylanpulver)" <noreply+dylanpulver@github.com>
2026-11-19 15:33 ` "keithf4 (@keithf4)" <noreply+keithf4@github.com>
2026-11-19 18:41 ` "dtseiler (@dtseiler)" <noreply+dtseiler@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