Re: not null constraints, again

Tender Wang <tndrwang@gmail.com>

From: Tender Wang <tndrwang@gmail.com>
To: jian he <jian.universality@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-09-20T04:14:12Z
Lists: pgsql-hackers
jian he <jian.universality@gmail.com> 于2024年9月20日周五 11:34写道:

> another bug.
> I will dig later, just want to share it first.
>
> minimum producer:
> drop table if exists pp1,cc1, cc2,cc3;
> create table pp1 (f1 int );
> create table cc1 () inherits (pp1);
> create table cc2() inherits(pp1,cc1);
> create table cc3() inherits(pp1,cc1,cc2);
>
> alter table pp1 alter f1 set not null;
> ERROR:  tuple already updated by self
>

I guess some place needs call CommandCounterIncrement().

-- 
Thanks,
Tender Wang

Commits

  1. Suppress "may be used uninitialized" warnings from older compilers.

  2. Elide not-null constraint checks on child tables during PK creation

  3. Remove unnecessary code to handle CONSTR_NOTNULL

  4. Silence compilers about extractNotNullColumn()

  5. Add pg_constraint rows for not-null constraints