Re: cataloguing NOT NULL constraints - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: cataloguing NOT NULL constraints
Date
Msg-id 202404151320.uqfxlcnl4zrp@alvherre.pgsql
Whole thread Raw
In response to Re: cataloguing NOT NULL constraints  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
(I think I had already argued this point, but I don't see it in the
archives, so here it is again).

On 2024-Feb-07, jian he wrote:

> if you place CommandCounterIncrement inside the `if (recurse)` branch,
> then the regression test will be ok.

Yeah, but don't you think this is too magical?  I mean, randomly added
CCIs in the execution path for other reasons would break this.  Worse --
how can we _ensure_ that no CCIs occur at all?  I mean, it's possible
that an especially crafted multi-subcommand ALTER TABLE could contain
just the right CCI to break things in the opposite way.  The difference
in behavior would be difficult to justify.  (For good or ill, ALTER
TABLE ATTACH PARTITION cannot run in a multi-subcommand ALTER TABLE, so
this concern might be misplaced.  Still, more certainty seems better
than less.)

I've pushed both these patches now, adding what seemed a reasonable set
of test cases.  If there still are cases behaving in unexpected ways,
please let me know.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"La espina, desde que nace, ya pincha" (Proverbio africano)



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: promotion related handling in pg_sync_replication_slots()
Next
From: Justin Pryzby
Date:
Subject: Re: allow changing autovacuum_max_workers without restarting