Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wDLOa-002s4Y-0u for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Apr 2026 12:00:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wDLOZ-005SNz-0k for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Apr 2026 12:00:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wDLOY-005SNr-2i for pgsql-bugs@lists.postgresql.org; Thu, 16 Apr 2026 12:00:30 +0000 Received: from forwardcorp1a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:df01]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wDLOW-00000001OmT-1PBe for pgsql-bugs@lists.postgresql.org; Thu, 16 Apr 2026 12:00:30 +0000 Received: from mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net [IPv6:2a02:6b8:c2d:3530:0:640:eca4:0]) by forwardcorp1a.mail.yandex.net (Yandex) with ESMTPS id 80CDEC0205; Thu, 16 Apr 2026 15:00:26 +0300 (MSK) Received: from smtpclient.apple (unknown [2a02:6bf:8080:28::1:34]) by mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id P0MgUf0LuW20-rqtTXeJ6; Thu, 16 Apr 2026 15:00:26 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1776340826; bh=dn+x0B/iyJEyHMpctjk1eHXE2B4ZioC9xV870QmsjVQ=; h=Message-Id:To:Date:References:Cc:In-Reply-To:From:Subject; b=w1oh5eylLXZmLlhDTx5nN3LyjW950K92a95577uPluBGkxbjc9RQ/fonbiibJVm4Q OmqrCGrpWfD+/nVbD+P4mjFmUW0nauX4YX8t7QT5zjjP5pEguRLjzySHYQYkwv9SQS g9UkKVOjE26NaGqgFeGL92cAUrLQ1JrBIU9abDwY= Authentication-Results: mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.500.181\)) Subject: Re: BUG #19382: Server crash at __nss_database_lookup From: Andrey Borodin In-Reply-To: Date: Thu, 16 Apr 2026 17:00:14 +0500 Cc: songjinzhou , dllggyx , pgsql-bugs Content-Transfer-Encoding: quoted-printable Message-Id: References: <19382-4c2060ffee72759b@postgresql.org> To: surya poondla X-Mailer: Apple Mail (2.3864.500.181) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 9 Apr 2026, at 09:24, surya poondla = wrote: >=20 > <0005-Fix-bug-19382-server-crash-when-ALTER-TYPE-is-used-m.patch> I=E2=80=99ve took a look into the patch and here are some thoughts: 1. collect_composite_type_versions() does this /* Resolve domain types to their base type */ if (typtype =3D=3D TYPTYPE_DOMAIN) { attrtypid =3D getBaseType(attrtypid); typtype =3D get_typtype(attrtypid); } Only for nested types. Do we need this for root? 2. When we do this /* Clear composite type snapshot */ rec->nCompTypes =3D 0; rec->compTypeOids =3D NULL; rec->compTypeVersions =3D NULL; We also might need two pfree()s. 3. Here are few other test cases that crash with the patch. -- Case 5: Dot assignment create type bug19382_foo3 as (a int, b int); create function bug19382_test_field_assign() returns record as $$ declare r bug19382_foo3; begin r.a :=3D 123; r.b :=3D power(2, 30)::int4; alter type bug19382_foo3 alter attribute b type text; return r; end; $$ language plpgsql; select bug19382_test_field_assign(); drop function bug19382_test_field_assign(); drop type bug19382_foo3 cascade; -- Case 6: SELECT INTO field also bypasses snapshot. create type bug19382_foo4 as (a int, b int); create table bug19382_tbl (a int, b int); insert into bug19382_tbl values (123, power(2, 30)::int4); create function bug19382_test_select_into_field() returns record as $$ declare r bug19382_foo4; begin select a, b into r.a, r.b from bug19382_tbl; alter type bug19382_foo4 alter attribute b type text; return r; end; $$ language plpgsql; select bug19382_test_select_into_field(); drop function bug19382_test_select_into_field(); drop table bug19382_tbl; drop type bug19382_foo4 cascade; Thanks! Best regards, Andrey Borodin.=