Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
От | jian he |
---|---|
Тема | Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints |
Дата | |
Msg-id | CACJufxF3hJL+Lw5CLp56SLoigMwzfekDRQ5-_RJybMQaXRgT=w@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints (Rushabh Lathia <rushabh.lathia@gmail.com>) |
Ответы |
Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints |
Список | pgsql-hackers |
On Fri, Apr 4, 2025 at 7:54 PM Rushabh Lathia <rushabh.lathia@gmail.com> wrote: > > Hi Alvaro, > > I’ve consolidated all the changes and attached the latest version of the patch, which > includes the updates submitted by Jian for pg_dump as well. > > Patch 0001 contains changes to MergeWithExistingConstraint to fix the marking on local constraints. > Patch 0002 includes support for NOT NULL NOT VALID, corresponding pg_dump changes, test cases, > and documentation updates. > hi. + /* FIXME use CompactAttribute */ Form_pg_attribute att = TupleDescAttr(relation->rd_att, i - 1); if (att->attnotnull && att->attnotnullvalid && !att->attisdropped) { NullTest *ntest = makeNode(NullTest); ntest->arg = (Expr *) makeVar(varno, i, att->atttypid, att->atttypmod, att->attcollation, 0); ntest->nulltesttype = IS_NOT_NULL; CompactAttribute doesn't have {atttypmod, attcollation} information, now it is impossible to use CompactAttribute here, so I removed this FIXME in get_relation_constraints. i noticed that we have "mode change 100644 => 100755 src/bin/pg_dump/t/002_pg_dump.pl" in 0002-Support-NOT-VALID-and-VALIDATE-CONSTRAINT-for-named-.patch. i am uncomfortable with the change in 'CREATE TABLE dump_test.test_table_generated' so I only added 'CONSTRAINT NOT NULL / INVALID' tests in 002_pg_dump.pl. so I only added a test case 'CONSTRAINT NOT NULL / INVALID' to 002_pg_dump.pl. v7-0001 commit message explains what kind of problem MergeWithExistingConstraint is trying to fix. v7-0002 bullet points summary about NOT NULL NOT VALID added to the commit message. add a test for CREATE TABLE LIKE. CREATE TABLE LIKE will copy the invalid not-null constraint and will become valid, i think this is what we want. The added regress test is a little bit verbose, trying to make it less verbose. polish comments here and there.
Вложения
В списке pgsql-hackers по дате отправления: