Re: not null constraints, again
jian he <jian.universality@gmail.com>
From: jian he <jian.universality@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Tender Wang <tndrwang@gmail.com>,
Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-10-01T14:54:50Z
Lists: pgsql-hackers
Attachments
- MergeConstraintsIntoExisting.no-cfbot (application/octet-stream)
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
Commits
-
Suppress "may be used uninitialized" warnings from older compilers.
- fc5e966f73f0 18.0 landed
-
Elide not-null constraint checks on child tables during PK creation
- 11ff192b5bb7 18.0 landed
-
Remove unnecessary code to handle CONSTR_NOTNULL
- 5b291d1c9c09 18.0 landed
-
Silence compilers about extractNotNullColumn()
- ff239c3bf4e8 18.0 landed
-
Add pg_constraint rows for not-null constraints
- 14e87ffa5c54 18.0 landed