Re: cataloguing NOT NULL constraints

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: cataloguing NOT NULL constraints
Date: 2023-09-01 17:55:52
Message-ID: 20230901175552.y2aero24xztxc3h2@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2023-09-01 17:58:10 Re: should frontend tools use syncfs() ?
Previous Message Nathan Bossart 2023-09-01 17:55:37 Re: Adding a pg_get_owned_sequence function?