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.94.2) (envelope-from ) id 1qhf3X-003ojQ-Up for pgsql-bugs@arkaria.postgresql.org; Sat, 16 Sep 2023 23:50:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qhf3V-001i2o-BN for pgsql-bugs@arkaria.postgresql.org; Sat, 16 Sep 2023 23:50:29 +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.94.2) (envelope-from ) id 1qhf3T-001i2V-Qt for pgsql-bugs@lists.postgresql.org; Sat, 16 Sep 2023 23:50:29 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhf3P-005Y4w-Gz for pgsql-bugs@lists.postgresql.org; Sat, 16 Sep 2023 23:50:27 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B20825C004B; Sat, 16 Sep 2023 19:50:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 16 Sep 2023 19:50:20 -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:sender :subject:subject:to:to; s=fm2; t=1694908220; x=1694994620; bh=YI kq1x/ufXJzlX/Lgzw0cHS7QjogrHPM654QYg9H4W0=; b=NXnHpRJoS2ZKzB8WVe 6XWhdmQ6QXwk1Oj4FLa/JtIPbxsgzUuSmZCqYD4hBiJ1k1CY0ZePmTYlbjL/YKJG 4xriKY7xEQd4C0vMZ5eZkaw208vOJayI5qLiGsHpNoXNMaGFP71LnGfn3I4Ovjj7 pDNU4980KJOuLY0Md8//Y+gEtiUQKDG2lDZrgKpSIMiUt5GHHpcWWVV307dsrlmp w5dSidCrVW66qVZLi33MI+Ui0DXIwoLYNQcd539Ru6yiXx2KSs+lMIHnAb2asm3W B8wzxgRGLdqEQzwQR01EYoynA1MzVrsuzwP1iyB0UqDSMVlXweje+nY7SpOeZWqy XB/g== 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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1694908220; x=1694994620; bh=YIkq1x/ufXJzl X/Lgzw0cHS7QjogrHPM654QYg9H4W0=; b=ArIYQ4hL6NX+JVKsnplXbd5DZgooI Mu5oa6pUc6I2Fwrz4De7AhN5gxZGftrnL6e2R+if6FT2pwWg07hqL508N7kfMvhe FViodlFq9YaBD59Yhw2kukFgJqsxPsY7ZT/ateqDeDBbhQIfyvGPRa0mzAk9F7Ex uEYGhexCYuTom9hAbdg5oFLq+xv6sQBWVmKib4oWRrzhs8P9owfcvqgmjvS5pKyr Whjrurk+bsSwGtrJhZoWsX+jjhJYIPq//J6Jxqo34bJdThHHDykF/9/G6002M3jb J/zDdemxNG5khLEvtxPE7kbkLLs3Q9hobO2Q+Z5h6v3PxoRKsJb13nbGg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejhedgvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghq uhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvg hrnhepteelieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdej necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitg hhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 16 Sep 2023 19:50:18 -0400 (EDT) Date: Sun, 17 Sep 2023 08:50:13 +0900 From: Michael Paquier To: Alexander Lakhin Cc: Tom Lane , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18070: Assertion failed when processing error from plpy's iterator Message-ID: References: <18070-ab9c171cbf4ebb0f@postgresql.org> <9fa9c154-d084-07de-8224-aab7fc8a119e@gmail.com> <3920993.1694874885@sss.pgh.pa.us> <5eba3ea5-ae13-aab2-35d6-cd3e58dab08b@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lDNuXnKAEOdG6OxK" Content-Disposition: inline In-Reply-To: <5eba3ea5-ae13-aab2-35d6-cd3e58dab08b@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --lDNuXnKAEOdG6OxK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 16, 2023 at 08:00:00PM +0300, Alexander Lakhin wrote: > This lengthy output is similar to what we get with a recursion in plperl, > so I don't consider this as an issue, but may be we could just check > the length of an error message before concatenation... >=20 > Please look at the v2 patch, which contains an addition to regression tes= ts for the master. > If you agree with this approach, I'll make patches for back branches as w= ell... +DETAIL: spiexceptions.InvalidDatetimeFormat: invalid value "DD" for "DD" +Value must be an integer. That's the kind of things we've been doing for years in libpq. So even if there are no proper sentence terminations, that may be enough for the user. + if (detail =3D=3D NULL) detail =3D xmsg; + else if (xmsg !=3D NULL) { + initStringInfo(&detailstr); + appendStringInfoString(&detailstr, xmsg); + appendStringInfoChar(&detailstr, '\n'); + appendStringInfoString(&detailstr, detail); + detail =3D detailstr.data; + } Perhaps it would be slightly cleaner to use a StringInfoData all the time and rely on the presence of fmt to free the detail string? Btw, backpatching a change in the error infrastructure does not seem a good idea to me, as there could be applications that depend on the existing behaviors? It looks like we'd better just remove the assertion in back-branches. -- Michael --lDNuXnKAEOdG6OxK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmUGPzUACgkQnvQgOdby QH1l+w//czNrl+ZF/eLNTv/bwPZoohm1RtlCPHj4PCxs+OILQzgbWQy/zqfeyyZO MFi+Qn4ZqbMUClXfFv43/0rNFLyNJbN4Y+cTGCpDG5SJHm+2mNnno6CGMjgB8PCp qi4viDZa8bUl/jV1Hpp5JipKIulFHhX/RILZbjx7AQ4CRtEULwcPxCUpJeNNzBot Kt2Jn92WlLHD5nv3xqDzUdBsTxcsfWFAwoxRTgwxN/Zq13p4c2hQdh+XZVDniBMw tAbn31JdTbGldYoYbE0P4vOI84NgyVLCSMRXn6DnkeAh0txMEr1dLBACW/S6IWTf tQkM4SEg/m7uyegwF5AydRJBSKjQ5oAp2Kpi/buwclrOyuAV+aoGemrM9on1dXSC liYj98tMhmzyLT/cYi00FZIB+boxvhAQBwBcZymXYxLCNjyontkbM7GzfoCs4vjW 8jvjuRayUoeZ+syX/LV9sYkPNVtCP5r5YiAzi3mk5tzWuLRlb83Cv+2jvmWNfa3S BPPcZW3xNL/4TTLdQgIONU3tlHWsGqESv9Ajkr/0is1YaBPVM+SdDS9yOOvB+gGZ +hCgviDtCF/9BbcIpAW5GOPnkgD/QzgZAO+xJombvk3YWD6177OKrBj0VKlz9oid OpLlXBtY3bjNCbaJ86CsoEYGUY/24afVO2TFnxKtndgXekFzLZs= =5GfV -----END PGP SIGNATURE----- --lDNuXnKAEOdG6OxK--