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-30T01:47:31Z
Lists: pgsql-bugs
On Mon, Jun 30, 2025 at 1:32 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > I wrote: > > jian he <jian.universality@gmail.com> writes: > >> we can change to > >> if (relid != tab->relid) > >> LockRelationOid(relid, AccessExclusiveLock); > >> obviously, the comments need to be updated. > > > Yeah, I came to the same conclusion after studying it for awhile. > This issue also applies to tab->changedStatisticsOids and tab->changedIndexOids in ATPostAlterTypeCleanup. drop table if exists t1,t2; CREATE TABLE t1(a int); CREATE TABLE t2(b t1); CREATE STATISTICS XXX ON ((b).a is not null) FROM t2; ALTER TABLE t1 ALTER COLUMN a TYPE numeric; drop table if exists t1,t2; CREATE TABLE t1(a int); CREATE TABLE t2(b t1); CREATE INDEX XXX ON t2(((b).a)); ALTER TABLE t1 ALTER COLUMN a TYPE numeric; We likely need to do the same as well.
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