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

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: yanliang lei <msdnchina(at)163(dot)com>
Cc: Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Re: Re: BUG #19351: in pg18.1,when not null exists in the table , and add constraint problem.
Date: 2025-12-13 12:44:38
Message-ID: 202512130812.375tew7hjksb@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
fix.patch text/x-diff 9.3 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2025-12-13 18:52:36 BUG #19354: JOHAB rejects valid byte sequences
Previous Message Thomas Rosenstein 2025-12-13 12:18:59 recovery_target discrepancy?