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 1rUEfS-009hiL-GE for pgsql-bugs@arkaria.postgresql.org; Sun, 28 Jan 2024 23:34:27 +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 1rUEfR-00ALAw-7n for pgsql-bugs@arkaria.postgresql.org; Sun, 28 Jan 2024 23:34:25 +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.94.2) (envelope-from ) id 1rUEfQ-00ALAo-Vd for pgsql-bugs@lists.postgresql.org; Sun, 28 Jan 2024 23:34:24 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rUEfK-003s7j-A3 for pgsql-bugs@lists.postgresql.org; Sun, 28 Jan 2024 23:34:23 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B84C95C01C0; Sun, 28 Jan 2024 18:34:17 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 28 Jan 2024 18:34:17 -0500 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=fm3; t=1706484857; x=1706571257; bh=XzFnZ6l4js b7dRRKi4FNsNgg63BNrR2FHf47+cN0V2A=; b=MGcRWC7428uAKj0Qn/On1HgIVq NdWptxTSokK43qYw4W6I639RdpH5hhI6iWM9lGuBq/kRpuK1YQI3Zx6rROuDbR7P QthC+3F4K0fPKqRJ3oTfE2F7C0LfHFCc4GdLna6G4gvMjBeVfkTLCPxlAUtW5eXc OEEa/JewGLBzYethhbXJMeWZ7n72SBRIsvIGl13kksrg5j3gTmhHidKpkruMf50/ CKy4okvsMrc7HvNySlzkPsDHNNfnYi7M2S3ZswvHx7Ty9hRDDl8r5ck8MKafng3e WP3K58nLO9WsBHaBQ94FNbn9PjeGZxiXAS2deXALao8DK3KBvBPxzVeSV7fg== 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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1706484857; x=1706571257; bh=XzFnZ6l4jsb7dRRKi4FNsNgg63BN rR2FHf47+cN0V2A=; b=mtl8csNQ+HrEQy3kOW2L1TxcGyYfUpwpaVKcsumHvzLL HsRVfCPZdBIo1UYlKO5vYNswyC77kDx0zt0oJ9SZf4nwXU2hr5v/w9YY3yu4xPkm t5/9e0QySK4ndxMV19PG2YL107IDsVRi0+lqMWfUukbWXm7yxpGfXtnKelPt0zgq k25egnIUnqjfmWYkd2uh62HI8Ofji8IVJwC/vWVgGUVnEjb8/gejo5HhfK9mxmMI 3Uz7uZRDUEsL5LxDcXOiYw9YcPNwDgmWXCehX/Z+KiRV1iFxxxzlv9YSZRSihWeE 1aNQuseCcipHI97MiIxZoR/Uou8oXdqf0IUlM7F7Fg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedtfedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tdejnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepveetjefgjeevgedukeehieeu ieeuieevueeiudegheevuefggfduueelgeelieetnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 28 Jan 2024 18:34:14 -0500 (EST) Date: Mon, 29 Jan 2024 08:34:02 +0900 From: Michael Paquier To: Tender Wang Cc: Alexander Lakhin , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18310: Some SQL commands fail to process duplicate objects with error: tuple already updated by self Message-ID: References: <18310-1eb233c5908189c8@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jWF7OJj3fFrvaJIU" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --jWF7OJj3fFrvaJIU Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 26, 2024 at 11:23:08AM +0800, Tender Wang wrote: > Michael Paquier =E4=BA=8E2024=E5=B9=B41=E6=9C=8826= =E6=97=A5=E5=91=A8=E4=BA=94 10:51=E5=86=99=E9=81=93=EF=BC=9A >> For this job, I think user.c is just overengineered and could be >> simplified to use a list of OIDs. There is no need for ObjectAddress >> or even ObjectAddresses: all of them are created with >> AuthIdRelationId as class ID, and the second loop just fetches the >> role IDs retrieved from the ObjectAddresses created in the first loop. >> We don't use the individual ObjectAddress either. On top of all that, >> it makes the code a bit easier to follow. >=20 > Agreed. +1 Thanks, I've applied this one down v16 as of 50b797dc99ec. v15 and older do not use a two-pass logic in DropRole() so one would fail with a simpler "role does not exist", which is kind of correct in its own way because the second role cannot be scanned in pg_authid after the CCI of the first one, so I have let it be in older versions. It's not like somebody complained about that in the past, either, as far as I recall. -- Michael --jWF7OJj3fFrvaJIU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmW25GoACgkQnvQgOdby QH0hOQ/9GcrctAA7YYYYUwbqnpGuZBrCfpM79k3p3eVfCWNbD9DbTZopO6hTqxF4 ZL/P5Umbgv7sH2i7QjclpKBlejBaPigzSwVH/OyrvchEFLQ+6XwCcwmhkmkq3UvV Q3TSnQdqXDZdOZNBtQhtRymaquykh5cNDcvfyYzp9aRaOt9fqUoCl1j5cH4j+VvA 4jz/wttVjJrngYyOO8maI/zrKp9ffyjf033o74lUDreu6Q+Z14G0L/ioDiEs44AS UOaiP7DG5snFo+Mb8SAJZr2ycs+uDCFaB2OjeO6txCBbp12zfg80IEpzoXJhefLm YjY1SdRrQFi9WOMd+LvyaJMuagL1V2sf+/GpjMO4G7ijwP7vyo+FpC3YI6wbzKMI gy8nAHTnFbAd8FA3KxrYZTJ38eH3FlGCeQYb/SNL/d+eODHBbggS6Q4JSurR2GWx UdszKMUVyDMudvmZoaxXZg5O7txLHiFJyPlg1KrgHL0Bwt4lB3XwFpP8CWpEahig VxqWA9QxnPwZyvQk3AgQUyL6ocGvH/5WEG0Q515sm8a40i7AiRefmnLnmlIKTm35 SR+q63xqDMaJODcclIKt9fifhpL+umo9DErWhdLwf0pUEq1hkk867xSiS+BYZe/M i/qgMBFyKQlMnNS1XjyRzVTZLVE/sOSELo6WvVlKPhkMy0VS/VM= =lS/r -----END PGP SIGNATURE----- --jWF7OJj3fFrvaJIU--