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.98.2) (envelope-from ) id 1xBIa2-000000037ob-1m1n for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Sep 2026 21:08:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xBIZ1-0000000BSwD-0oYm for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Sep 2026 21:07:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xBIZ0-0000000BSw4-3kN6 for pgsql-hackers@lists.postgresql.org; Mon, 28 Sep 2026 21:07:06 +0000 Received: from mail-dl2-x0f.google.com ([2607:f8b0:4864:38::f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xBIYz-00000001kj7-1CUp for pgsql-hackers@postgresql.org; Mon, 28 Sep 2026 21:07:06 +0000 Received: by mail-dl2-x0f.google.com with SMTP id a92af1059eb24-1460bcc512eso1893571c88.1 for ; Mon, 28 Sep 2026 14:07:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790629623; x=1791234423; darn=postgresql.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1wO32QvLJDX1UprSxy3ZLEknf02iKzXB+lpAOee3YCM=; b=JIdSn/tS8bk7rrnaR+VdYqFbsZvTY2UnCodkQ1mFvCx3bwtLL6RYZKV19ETeZIB9me ags1K4cd5tH9ApZhxLoMKgThP+PyE3uEWECoQxbOfuvN7+0QbjEllQ5S5mDrOvpPa/L3 FE3Y2mIqAzadExJA5cF8kLNG5IeU/zm/kBvy/nf6wda7OpdLnIiUziNkl+IMsycxx4/3 ffrF3Z88aKARxAj+VDidr1Ctjc7751GMfkghnvlJFNpnsNL4NIQdOVJoUqqNpu/GEPYV qWrbzK3NmNNoGjLF5WYfbr5qLA2XoveH+y6NRsoscLLKXChf6GhRB9DOgIJ8dpRAdMaP 4LWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790629623; x=1791234423; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1wO32QvLJDX1UprSxy3ZLEknf02iKzXB+lpAOee3YCM=; b=P1+iM/iVP5Dmc7CPUDOCOmrXBtGAFp6DnTzJw2X612Kz40jCx2Q4WQHW1OSCAbaQIt fbkJoLNhYfu3l2cYnypx3RWKM1tK4jIHri10MRNr65ahvrYR9KO3mvjxoRKjqvhP68XJ oAJ5bGaO/+gcUxu98xJxmxQeKE47onL53I21RVoopVnd8Vw327Nw/omhrSCJeX4ruWFE rD0tkmtLMuXa9KQzm047XqXyjEsw9S/mTT1exajlWF9xfe+iA960lrnSno6KOaE+akX0 k8AiqdfVpWb5CnnvB1zgOc/8WjchoOxWGCMb8LOfsyvqnr5QAbzmS3eQ2i1tj5SosUcE L62Q== X-Forwarded-Encrypted: i=1; AKwUvBwdUpimE/Ie4bvQ/SYYSSABacOnuxjXfXI59yxKmlw8KAS9yo6PJLX4WDXinbfNkjZTrGoSEPktxdPUeKDY@postgresql.org X-Gm-Message-State: AFuF++nQ88f6wemSHWlljrf2ftbaaNT4UCfcFG8EVQGTnObwlDMTIHOe 98CdwaPKQn1eiaV83DIYizEawcB4TGmpA9lbxKOA4tEg2PMxDG+pInLQ X-Gm-Gg: AYBFou0xY6bI3Jt9iybkFhyu+6PzHFKZngaA0sAUERMwnXy27DNi9wl7BG7YoB5fBMg /loNDE29XqLy4PySpxMEaV0FkdMEwwMs8te15ph1HgozWs8O6Jsl3uYxKOJI9GFnM4dcBc8cZzh Qy2kGtgA0gC3POUnt+6on67mD4jtJwPMV4zuLVV/XyvETFVuuIhr39TNz0p3e03hVFjmWVN3pck CJgN5OAu37E95fzEaCVhl0Tg6WcuC4NRATcEcEY/ZPY6fLwcsjOI6j6wsSR8Ee3gxNM1hYdRSjy Nqk4z1Yvqi324Eecd0nizhOx5AbxyT0fc0mKt68b7WGYlzLVwm0k/pX2elkO+YejcWWzMBpj+R2 bN6BWu97IWu52ud2/kUiRfq0jNl+ABQqDtB30SC4P3k/Oxwu4BuGLx6pYnOD4fn1ZbRzwRFZPf/ hNsBZyWl+P6k5XFkAqo4ZFo8Kff1F372ULawlzAlb95baKuwwPKMqAI+hw/+YDy0Y7UfzB9XSme pJLv7r1SmKIkyT35e0LfVVDOcANRZJCRE4dk5xgnBbvr0C16tbf1A5Oc0zPXI97uAKz X-Received: by 2002:a05:701b:2087:20b0:143:271a:308 with SMTP id a92af1059eb24-146d0872e00mr11265180c88.46.1790629622588; Mon, 28 Sep 2026 14:07:02 -0700 (PDT) Received: from ?IPV6:2804:14d:32a7:4273:ac6b:aaa4:756e:c2eb? ([2804:14d:32a7:4273:ac6b:aaa4:756e:c2eb]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-14a7c03ece2sm4716890c88.16.2026.09.28.14.07.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Sep 2026 14:07:02 -0700 (PDT) Message-ID: Date: Mon, 28 Sep 2026 18:06:59 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] Fix for Bug#19724 - ALTER TYPE ... ALTER ATTRIBUTE triggers internal error for base type of domain with check To: Ayush Tiwari Cc: Nitin Motiani , pgsql-hackers@postgresql.org References: Content-Language: en-US From: Matheus Alcantara In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 28/09/26 17:40, Ayush Tiwari wrote: >> Attached are: >> >> - v2-0001: Nitin's v1, unchanged. >> >> - v2-0002: validate re-added domain constraints after the rewrites >> (issue 1). > > Thanks, the split looks right to me. > > On 0002, remembering the new constraint OID and calling > validateDomainCheckConstraint() directly is better than what I suggested. > Using the OID avoids resolving the domain and constraint by name again in > phase 3, and the standalone-composite case needs the new loop not to skip > relations without storage. One small thing: the new loop doesn't > CommandCounterIncrement() between constraints. Probably fine today, but > the FK loop and afterStmts do. And I think 0001 and 0002 can be clubbed > together (though that can be done whilst committing) > Thank you for checking the patches. I don't think that the FK loop call CommandCounterIncrement() or I'm missing something? Also I think that afterStmts call it because it use ProcessUtilityForAlterTable, so I don't think that it is required for the new domain constraints loop, but I might be wrong. I'm not sure if these two patches should be squashed into a single one. I see these both issues as separated issues, although the fix on 0001 enable the second issue to happen more easily. > I've only looked closely at 0001 and 0002 so far, which fix the reported > case for me across branches. I'll come back on 0003. > Thank you! -- Matheus Alcantara EDB: https://www.enterprisedb.com