On 2026-Oct-13, Richard Guo wrote: > On Tue, Oct 13, 2026 at 9:43 PM Álvaro Herrera <[email protected]> wrote: > > I find this very surprising. Are we sure that it makes sense for a > > partition to have a generating expression that differs from the one in > > the parent table? > > No, I don't think it makes sense for a partition to have a different > virtual generation expression than its parent. I raised this exact > same complaint in [1], the paragraph starting with "Regarding #4", > quoted below: > > Regarding #4, the fix is to not trust NOT NULL on a virtual generated > column of a partitioned table. But I don't like this fix at all. I > think the real problem is that a partition is allowed to have a > different virtual generation expression than its parent.
It looks like we reached the same conclusion. I propose we restrict this. Ideally we'd do that at least starting with 19. (I would in fact go even further and say that we should add restrictions to all affected stable branches, and provide SQL scripts that users can run to find and remove those that already exist there.) I don't have a patch though, but I imagine it should be easy. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Hay quien adquiere la mala costumbre de ser infeliz" (M. A. Evans)
