Re: BUG #18970: Atempt to alter type of table column used in row type with check leads to assertion failure
jian he <jian.universality@gmail.com>
From: jian he <jian.universality@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2025-06-30T06:04:25Z
Lists: pgsql-bugs
Attachments
- v2-0001-fix-bug-18970.patch (text/x-patch) patch v2-0001
On Mon, Jun 30, 2025 at 10:23 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > jian he <jian.universality@gmail.com> writes: > > This issue also applies to tab->changedStatisticsOids > > and tab->changedIndexOids in ATPostAlterTypeCleanup. > > Oh, indeed :-( > > > We likely need to do the same as well. > > I'm about done for the day --- you want to prepare the patch? > hi. I added 2 more error case tests in alter_table.sql SET EXPRESSION both can have this issue. so i also add more test cases for stored/virtual generated columns. ALTER TYPE | SET EXPRESSION trigger related related index build, we use AccessExclusiveLock to lock the related relation trigger related related statistic build, we use ShareUpdateExclusiveLock to lock the related relation -----------------the following are attached patch commit messages ALTER TYPE or SET EXPRESSION may necessitate rebuilding constraints, indexes, or statistics for related tables. As we may not acquire locks on these related relations before ATPostAlterTypeCleanup, we obtain appropriate locks here. This also means that for virtual generated columns, we still need to call RememberAllDependentForRebuilding, even though indexes and statistics cannot currently be created on them. When ALTER TYPE or SET EXPRESSION triggers a statistics rebuild for another table, we use ShareUpdateExclusiveLock to lock the related table, consistent with the locking approach in RemoveStatisticsById, AT_SetStatistics, and CreateStatistics. ----------------
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Obtain required table lock during cross-table constraint updates.
- c15798cf94c4 16.10 landed
- bbfcbc4cde4a 17.6 landed
- 8319e5cb5493 18.0 landed
- 614ffb26d1cd 15.14 landed
- 25cab4473525 14.19 landed
- 13f1e9f26a11 13.22 landed
-
Add assertions that we hold some relevant lock during relation open.
- b04aeb0a053e 12.0 cited