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 1x9sPc-00000002HcB-3GUw for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Sep 2026 22:59:33 +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 1x9sPb-0000000FFLr-3svk for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Sep 2026 22:59: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.98.2) (envelope-from ) id 1x9sPb-0000000FFLj-2dvl for pgsql-hackers@lists.postgresql.org; Thu, 24 Sep 2026 22:59:31 +0000 Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x9sPY-000000018jq-3r8O for pgsql-hackers@lists.postgresql.org; Thu, 24 Sep 2026 22:59:31 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4DF5414000E5; Thu, 24 Sep 2026 18:59:26 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Thu, 24 Sep 2026 18:59:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1790290766; x=1790377166; bh=IU+pgz9D6H obDRIH8lzCCPzE82gHsOo00648xGJKD6I=; b=x6KxPxmKAyn2NDfXjAYBR55t/J y4fcRKIk4iwE405mOIZl6GlCfi8+vajECdS3sUxfZZJpVxOG0BjVbpZ11F/6Bz8m 2Y1exyWUv1HD/BOZJJRfZE8YgVV9kJMaSk/xc53r2nrbY0ozO56TupsKOaSPUgZd rSt3x8gR6rmSjachEsbw6X2kkHY4WIIVMtyi+1mCu66Zo9Uel6ZQpXAfnXCoKNyc Ax6J7tXv033nZX+5dcTZrFrl17rbNmcWE07/XpvbagdydMVzUbLzyhkfFcw9EqKa 3xs3rdSTk6ZJXsxojwp2/3rUntqqOuMcRyvwDHlNpF+Uu7TbQuKQgfW9GP/A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1790290766; x=1790377166; bh=IU+pgz9D6HobDRIH8lzCCPzE82gHsOo0064 8xGJKD6I=; b=NM8MM6owZg8JWrAjbC9tnFjRe0GnoatXNjCIp0Jth6z/pRiEpDm OuNpXitFQk/VBCMPHTKibOD9LfSoOTY/mRot0yp1oqY+Lp5kwp5sFHTW6Bi4Kkl2 08H0F661z0WMj5V4M6oMTIDcQNv4YDsMc2BTmzyLKPhyyhcGp8YGcZLsaR3CluJ5 3vPHR1/FNwcaiT0mkfBMaHpfrPhgu0SSsRfqSmEPzFoMlHyc8Ot+89jmPcmIO8dK GbxzFyuVgQZJLBProp456wnck5n7zWc7OXg728rs1smdU23knSgeaOJ5ktymjbfK /ZJp78ZF4r+SbRKAX4r3joxXu2H0GD8BjeQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTETRcwcvunnvDmXbYvv31JqI6NvEYDwYC04ibw1eVrAxLTh2IINM2rEnVXgn7l+8g D4wbEgU4vXJZi3pelwYxpVLtjt8qSxcAvxrQ6PoGtCuS+E/1mxeBgp7GtOawweCRNBlR8Y U3bfDmcD9VqQMy38iLS+obpocSfk5/hyFkBlVjyQ8qT0tMZrJYm857khvlcKwx7r4TCzf1 uA2b5tSf/gc6xpicjTzZhp/R/lggSByzxk+xkBCnoUkT3l8jhAnNkqPFrrnlyDV+xxVFpy 7Zz3qwtvOr+erRIvBYb+W3/AZdoQASYPNQDFJKOgovKnXA6cYa5eraS4wMaW59V7P1qRdU AuG9tQIJDLgaRp0vnIVOU/icMyoFiHcuXFX1AgQCpJuge0qStXFWQjDOU+2evweqPIoNQF 45pK4YCx/P0cDppXrBFPd7zr6VDx11RccqYvhWJDBogrZpcXnnUjjXBVzI55jJ8EfxwCnU 99ALjRV0gS7siED/sycOF5AcqrFQT1yxMzgDBNir/622tCF+PXap42SHbMdNimo0YN25KV QsOwnqkNErjx/h8uyrHt6X7+4v1SRJsahGqNwm8B9Xxl93ZNKX87UjLyfi9+ZNa5aAvi7o Ep/cvnqrOVoEFqxehUURKt9ZPoyRHaw5MfhSC3Fz6+87tweRTEVBFe0BnWmA X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 24 Sep 2026 18:59:25 -0400 (EDT) Date: Fri, 25 Sep 2026 07:59:22 +0900 From: Michael Paquier To: Matthias van de Meent Cc: PostgreSQL Hackers Subject: Re: BUG: pg_class.relchecks overflow, making table undroppable Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6e7XuSQ4q46P9cpS" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --6e7XuSQ4q46P9cpS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 24, 2026 at 07:03:45PM +0200, Matthias van de Meent wrote: > This causes various issues, such as possible WARNING spam to users > that need to load that relation into relcache, and an inability to > drop the relation because dropping the table requires the constraints > to be dropped first, and dropping a constraint decrements the counter > that has a check is in place to avoid the counter ever dropping below > zero (with an error if you try to decrement non-positive counter > values). >=20 > I think we should forbid creating such large amounts of CHECK > constraints (as attached, backpatch-safe), or drop the "relchecks" > field wholesale/replace it with a 'haschecks' field. >=20 > Also attached is an SQL script that shows the issue, and which doesn't > fail in the unsafe manner once PG is patched with the attached patch. Ahah, fun one! That's in the same line as the recent trigger fix in b99b74144f9f where catalogs could overflow. Even if it's something that people would not do in practice, this deserves a backpatch. Will look at that later..=20 -- Michael --6e7XuSQ4q46P9cpS Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmq1q0oACgkQnvQgOdby QH3QoBAAlIJRI5x6AaI3acF1ZRAmaLCl9JGQwwTjpRnKkjhoNOI+bEqbtNJqqBt6 lyX8eLPRtfigLR0mmDP8EVeIZlKb6PD2QltJ2fSkWJ5zUN2aO1Ks/EplBe8WCHzQ lPv9bLtDHAKub1KYZvn0D3jAgREa3xmUoGZ0t0qH4ICXInJW+ko0WqAk9jGGdaqe OHh2hjU4VOAFQ9h4lyt0HXAshAlCuIcVydCftwTLAQYdzIvlRGHhpaekfRIWwSUh Ct/cid07iCRVlmLbSD83+H8L0M7VoR3ITR52dtUbga3B0bORn9uY7MO4OkYn+sdP 6KTNCw47BR1W9904BaCJ8WblAxmGm2MJzwabI5QAIu3svGx3IXulAbKsPNgRyJQS nCexTBjZNML1K05qhN3THsDXGxBCXS5vhoYBXSi13RzSpusK+nXxJHls2ApaRQOS xUFa5t3joGF8SwfGJor+dlNU2fTCVsgnh1XJWg4YiZet3OBYUQG1hb4Cd4CSmZiK 6xphBCYCf5hQm/A0+dVRbT2kDaq3mdZ0Ok4ds0N7k7RA1ZzqRCQqn8Suke9vVDkN 4o+OfasQRQ6XLY8Vxaky+AowWn8w6GarA7/iACHP8t6DCENwp95KF1O1JBFS+MnF RzGf7UEU85xUrRCTKX9boSLujb8MwID+EXtGJrI/yDmUQWVpUCA= =YnEo -----END PGP SIGNATURE----- --6e7XuSQ4q46P9cpS--