On 2023-Aug-31, Alvaro Herrera wrote:
> Hmm, that's some weird code I left there all right. Can you please try
> this patch? (Not final; I'll review it more completely later,
> particularly to add this test case.)
The change in MergeAttributesIntoExisting turned out to be close but not
quite there, so I pushed another version of the fix.
In case you're wondering, the change in MergeConstraintsIntoExisting is
a related but different case, for which I added the other test case you
see there.
I also noticed, while looking at this, that there's another problem when
a child has a NO INHERIT not-null constraint and the parent has a
primary key in the same column. It should refuse, or take over by
marking it no longer NO INHERIT. But it just accepts silently and all
appears to be good. The problems appear when you add a child to that
child. I'll look into this later; it's not exactly the same code. At
least it's not a crasher.
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/