public inbox for [email protected]
help / color / mirror / Atom feedFrom: surya poondla <[email protected]>
To: Andrey Borodin <[email protected]>
Cc: PostgreSQL mailing lists <[email protected]>
Subject: Re: Two bugs around ALTER TYPE
Date: Wed, 24 Jun 2026 16:56:10 -0700
Message-ID: <CAOVWO5r3Zv-3ThZpXdqa66uMCLP__gj6BaiiFRPXJ1t8t6bzoA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
Hi Andrey,
Thanks for the patch series. I was able to reproduce both bugs on master at
HEAD and verified each fix end-to-end:
A couple of points:
Bug 1: "Number of returned columns (2) does not match expected column count
(3) on the second call.
With 0002 patch, it returns the new 3-column shape as expected.
Bug 2 (with only 0004 patch): Session A returns (1,2), DDL commits after,
next call returns (1,2,99). Mechanism works as designed.
I also confirmed why glob->relationOids is the right channel rather than
glob->invalItems via record_plan_type_dependency(): ALTER TYPE ADD
ATTRIBUTE
on a composite goes through ALTER TABLE on typrelid and modifies
pg_class/pg_attribute but not the composite's pg_type row, so no TYPEOID
syscache invalidation fires
(CacheInvalidateHeapTuple in AlterDomainAddConstraint).
relcache-on-typrelid is the only channel that actually delivers, which is
what the patch hooks into.
A few comments:
1. 0003 patch alone leaves a permanently-failing TAP test (its expected
1|2|99 is only producible by 0004's lock forcing the DDL to
wait). Maybe equash 0003 patch into 0004 patch.
2. alter_table.sql comment says the fix records typrelid in "the plan's
invalItems"; it actually goes into glob->relationOids
different list, different callback (PlanCacheRelCallback vs
PlanCacheObjectCallback).
3. TAP test in 0004 captures $ddl_pid via pg_backend_pid() (lines 68-69)
but never uses it.
Either we can drop, or use it to assert the DDL session is genuinely
waiting on the typrelid in pg_locks
(granted=false on AccessExclusiveLock). The latter would directly verify
the lock instead of just observing the symptom.
Regards,
Surya Poondla
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Two bugs around ALTER TYPE
In-Reply-To: <CAOVWO5r3Zv-3ThZpXdqa66uMCLP__gj6BaiiFRPXJ1t8t6bzoA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox