Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pUEyc-0007Iq-DH for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Feb 2023 22:49:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pUEyb-0008Pj-1N for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Feb 2023 22:49:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pUEya-0008Pa-P3 for pgsql-bugs@lists.postgresql.org; Mon, 20 Feb 2023 22:49:40 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pUEyT-0002b1-K7 for pgsql-bugs@lists.postgresql.org; Mon, 20 Feb 2023 22:49:37 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 2FF0732009E9; Mon, 20 Feb 2023 17:49:31 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 20 Feb 2023 17:49:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1676933370; x=1677019770; bh=KfEJVAGPDf ZyUviGkr40WdbScuZIg4inyR94ycoFy+A=; b=Xk+z0DdXcIugUtir5dgcaEy4Ru W9ctwpGqdyN2Jz8M8vRamhOlxy6qtPpelGEJWq8e/dXU/eFfGDg9VtE9B3DGukZI R2CzX8Zz+4ymtvBWyJbqDk9eFubwZrEBeQz2Sx9C7pPxTxUHU0s2Ef9H5C5ei/PZ ple0AGF3Dw5Ns8+5N228B5UC8pjPI3BCGxPgay/yHXEVveKzhvEYMs4BKooFi/mO psRT9v6MNjEpA7CYTeegnSFFg0oRjXQe/hxxPpyAWXhggthUodEhFXy4tg+H7ioQ pbu7gRNrH1Zreug+YztMl70zp9Xi4kl5NzMSY03zc6QoqkV/nKXrQjB+YT3A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1676933370; x=1677019770; bh=KfEJVAGPDfZyUviGkr40WdbScuZI g4inyR94ycoFy+A=; b=TxWdYP5+Fp/nubMGCl5J2u0qiFfGJLC9F9wAkwTv3k6j 72WEU/Ae+MZWcicF1M8uNzyXp2vZpomfnS+imy8cZ0LVgIE9vXJnatfKiDD6Eavp ELtU5m0guLPGL08MUKxlLuBNVQLNb5eKxI3vFMDtdmHdLCZpdTUegI67w+jIiG7+ ZWZcUggFEY+aBt4fFcCYG92LzOyw4+uUmxOVMkbegZgI4mZUdE9fsToIyGTm5Ota S0DNfllEnzDJ8NlUzAgBwgqYozBr2yPwWa6MvWmWXZ7RyBRVSUSgZeGf2vKlI55k 3icOw3UruI89cOzm8qhDFnO/Jyb8w2JyGEm8oM+ZVw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudejiedgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrh hnpedvgeduuefhtdeuleettdevjeehheeiveeuieegleetgeeljeelieeuieehgeevhfen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthh grvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Feb 2023 17:49:29 -0500 (EST) Date: Tue, 21 Feb 2023 07:49:25 +0900 From: Michael Paquier To: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17800: ON CONFLICT DO UPDATE fails to detect incompatible fields that leads to a server crash Message-ID: References: <17800-ff90866b3906c964@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Pc3kgDYDL/8AUcPa" Content-Disposition: inline In-Reply-To: <17800-ff90866b3906c964@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Pc3kgDYDL/8AUcPa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 18, 2023 at 08:00:00AM +0000, PG Bug reporting form wrote: > INSERT INTO t VALUES (1), (2) ON CONFLICT(a) > DO UPDATE SET (a, b) =3D (SELECT t.a, t.b || '+'); >=20 > But when executing: > UPDATE t SET (a, b) =3D (SELECT t.a, t.b || '+'); > I get: > ERROR: attribute 1 of type tp1 has wrong type > DETAIL: Table has type text, but query expects integer. Reproduced here. > By comparing two callstacks I can see that in the second case > ExecInterpExprStillValid() is executed after the latest > ExecEvalExprSwitchContext(). > The ExecInterpExprStillValid() function contains: > /* skip the check during further executions */ > state->evalfunc =3D (ExprStateEvalFunc) state->evalfunc_private; >=20 > If just call evalfunc_private() here, the first case ends with the error = as > expected. Yeah, it would sound logic to me to have consistency with the ExecEvalExprSwitchContext() checks here, so it seems like the executor has missed the call for a long time. Would you like to write a patch, perhaps? Did you bisect the origin of that? -- Michael --Pc3kgDYDL/8AUcPa Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmPz+PUACgkQnvQgOdby QH0SQQ/+MLvlqK/JsCEltDWE2LE881HrEQI8hy2o0MEaPiAabNRBdzNeyPHnNu6X mw0EjrSAIZm011EeMQKC45OXkttOzNIxg5ReLij5SELmh89edXRCDSaY7o2ujsxN bT3e9Y/4XO1nCxs7/RxX+Ik4GDYw8UALjYCwyx1j0njjf1tShlgZswOEM6eU1A8s rWHIFynGNDQ17tVt/Q22IQKu7RhkhZpJhN6/yTNv+U8tRYmQT7HdxCFrX4fz46i2 Y/2LGahPFoZAQYAIU5WiLxe7xx7g2CDG2YhHg07/MOVMQ8fGCy2254wK8vrWLmg8 /itJLGcUd1belNTTdFv2mo3DBJNjjNarfd9hYxGv5woa5JkBQAXRpkXB9MdNhd9D +kHoV+VomjoRLs2TJtEPTtXkoh7gNVkGov3O69YBKANaQv35nB7IUWTpQ/R7qJHS mG+pzmpAiJ7C2TTXnEfzxIp1ZiF+G38VjKW3bpu6VLKkI19RX5mKLOqefbvgagAZ isAB3bfG4N3G2urgdFr32eVaucBTYxy8nK2j7pNk9xy/bGB3oFOHOVtpbuY+8mEZ jkPpMYlzAxGsHz0QwArOFNlP/lVGwfZSI8LHSq+SV8yUJq0//s/d2qhr5GZt6IXH X2bZGt5/Rz/m1U/q4jn1K4kEW7DxIPwxUGF72rGCd7btPFgjg5c= =0Hfe -----END PGP SIGNATURE----- --Pc3kgDYDL/8AUcPa--