RE: Reject negative max_retention_duration values

Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>

From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Chao Li' <li.evan.chao@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@lists.postgresql.org>, Amit Kapila <amit.kapila16@gmail.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>
Date: 2026-06-10T05:12:26Z
Lists: pgsql-hackers
Dear Chao,

> Yes, this patch rejects negative values at CREATE/ALTER SUBSCRIPTION time,
> so in theory the if (MySubscription->maxretention <= 0) change is not strictly
> necessary. I made that change for a few reasons (from strong do weak):

I personal preference is to use Assert() for detecting cannot-happen case,
but it's not very strong opinion. Let's see how others say.

Best regards,
Hayato Kuroda
FUJITSU LIMITED




Commits

  1. Disallow negative values for max_retention_duration.