Re: not null constraints, again

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Tender Wang <tndrwang(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: not null constraints, again
Date: 2024-10-01 14:54:50
Message-ID: CACJufxHP6Cpyes-2aJN=zr-s_zSJRtPVfZ9kFDWgQ6STLTTM8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

ATExecDropInherit
/*
* If the parent has a primary key, then we decrement counts for all NOT
* NULL constraints
*/
ObjectAddressSet(address, RelationRelationId,
RelationGetRelid(parent_rel));

only not-null constraint,
with ALTER TABLE NO INHERIT we still decrement counts for not-null constraints.
I feel the comment is in the wrong place?

please check the attached function MergeConstraintsIntoExisting refactoring
1. make it error check more confined within CONSTRAINT_CHECK and
CONSTRAINT_NOTNULL.
2. since get_attname will do system cache search, we can just use
Relation->rd_att and TupleDescAttr

Attachment Content-Type Size
MergeConstraintsIntoExisting.no-cfbot application/octet-stream 5.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Pyhalov 2024-10-01 15:12:40 Re: SQLFunctionCache and generic plans
Previous Message Jelte Fennema-Nio 2024-10-01 14:53:03 Re: Converting README documentation to Markdown