Re: cataloguing NOT NULL constraints

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Alexander Lakhin <exclusion(at)gmail(dot)com>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: cataloguing NOT NULL constraints
Date: 2024-04-15 13:20:55
Message-ID: 202404151320.uqfxlcnl4zrp@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2024-04-15 13:33:33 Re: allow changing autovacuum_max_workers without restarting
Previous Message Amit Kapila 2024-04-15 12:59:49 Re: promotion related handling in pg_sync_replication_slots()