Re: Re: Re: BUG #19351: in pg18.1,when not null exists in the table , and add constraint problem. - Mailing list pgsql-bugs

From Álvaro Herrera
Subject Re: Re: Re: BUG #19351: in pg18.1,when not null exists in the table , and add constraint problem.
Date
Msg-id 202512130812.375tew7hjksb@alvherre.pgsql
Whole thread Raw
In response to Re:Re: Re: BUG #19351: in pg18.1,when not null exists in the table , and add constraint problem.  ("yanliang lei" <msdnchina@163.com>)
Responses Re: Re: Re: BUG #19351: in pg18.1,when not null exists in the table , and add constraint problem.
List pgsql-bugs
On 2025-Dec-13, yanliang lei wrote:

> Step 2: The execution of 'alter table test_null_20251210 add constraint xyzxyz not null c1' did not return any
errors.
> 
> after the execution of Step 2 , the executing user of the SQL
> statement "alter table test_null_20251210 add constraint xyzxyz not
> null c1" in the Step 2 will assume (because there was no error prompt
> in the  Step 2   ) that the not null constraint has been successfully
> added to column c1, and the name of the constraint is xyzxyz.

>  ----However, in reality, based on the execution results of the SQL
>  database, the Step 2 did not actually succeed.

Yeah, that's fair -- we discussed this kind of behavior during
development and I was unsure about being strict about it, so avoided it.

This is mostly straightforward to fix, as attached (though the error
message needs work), but I hit a snag with multiple inheritance -- if
you apply this patch, you'll see failures in the pg_dump and pg_upgrade
tests.  I don't have any ideas to fix this right now, but I'll keep
thinking about it.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"La experiencia nos dice que el hombre peló millones de veces las patatas,
pero era forzoso admitir la posibilidad de que en un caso entre millones,
las patatas pelarían al hombre" (Ijon Tichy)

Attachment

pgsql-bugs by date:

Previous
From: Thomas Rosenstein
Date:
Subject: recovery_target discrepancy?
Next
From: PG Bug reporting form
Date:
Subject: BUG #19354: JOHAB rejects valid byte sequences