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 1mzT3Y-0001u7-R2 for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Dec 2021 00:31:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mzT3W-0007Bt-Im for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Dec 2021 00:31:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzT3U-0007Bi-IL for pgsql-bugs@lists.postgresql.org; Tue, 21 Dec 2021 00:31:02 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzT3M-0000WT-C7 for pgsql-bugs@lists.postgresql.org; Tue, 21 Dec 2021 00:31:00 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 868FB3200F88; Mon, 20 Dec 2021 19:30:48 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 20 Dec 2021 19:30:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=8cnHtEhAuMyPDSZyFtF6gulo4AF Sm5lBkcbfQBg398E=; b=rNhELwNdyVEMBHLKlYNd4YUUbKSG6AFuqZHoT5LfJkb fgIWc9RKdPyxl2SjbeEtlEU2kFHI8g2xUl7HN58ciJY5FeUMUie/5aGbH+RaXaV2 e5tgv8ojD0yw8fop2mTHRUobzOf4YJEK9E8tf0aoh5dEoP+yT7wtIgC4YhIiI24T rE1YIKjVJkzhg9rO9R6dkfTLZdt9HRMJq/YxeUyQlyrQcfimThcgTR7acu3h+Uw+ dbnZEUFdEZTJ6CA+Zxu2+khbvLskle7KZorqWa5SvNNPhuCFqTo/FkqjqgzyAyP5 mcaNeRPBBPlHHvMtVfiOBdFNTAx+eJb8OXAzbMnZLPg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=8cnHtE hAuMyPDSZyFtF6gulo4AFSm5lBkcbfQBg398E=; b=WiNdEyDL+FqQdRLT9WBQxn L9SRhbuB3djxGiCL/SWztP0Qcb96/4QrIu7RN/YV3z1oebfI9waoTr4JL77L+qDY 6m2iC6NSt8SBY60Fvu4GWs+ZGssrHVxSwbsNgrnkKtr2a/DMh9cH+982ULpUwEm5 ahkGjbuZXdyK+Qh27EOrjQRKHjwkFVLmlRwg8AgKl1FTg2WUiNi2f7ofpgIJqOgj F/IcCSIopXfIrOF1pxeEr0seEMDUIPWs/TiHbo6AThOvsXquV+2fe1N9WVrPuBrd 1CzJBc5wlz2G8vV6g2/5u6AszGvUOr4uK3hK7rgle2ZaNQBwV5a+iqEHBDdFgXqA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddtfedgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Dec 2021 19:30:46 -0500 (EST) Date: Tue, 21 Dec 2021 09:30:42 +0900 From: Michael Paquier To: Peter Eisentraut Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17339: Assert failed on attempt to detach a sequence concurrently Message-ID: References: <17339-a9e09aaf38a3457a@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="C4hUCv8Uish8W3Ru" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --C4hUCv8Uish8W3Ru Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 20, 2021 at 09:57:47PM +0100, Peter Eisentraut wrote: > On 20.12.21 13:38, Michael Paquier wrote: >> Attached is a patch, with some regression tests. >=20 > Is it possible for child tables in partitioned tables to have different > ownerships? Then this change would introduce a new failure mode. Hmm. Yes, you are right here. It is possible to change the ownership of a partition after it gets attached, so this could cause a regression. I recalled that this was not possible, so my memories were wrong. At the end, perhaps we should just remove the assertion that assumes which relkind is right for the partition, as of: --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -15013,8 +15013,6 @@ MarkInheritDetached(Relation child_rel, Relation parent_rel) HeapTuple inheritsTuple; bool found =3D false; - Assert(child_rel->rd_rel->relkind =3D=3D RELKIND_RELATION || - child_rel->rd_rel->relkind =3D=3D RELKIND_PARTITIONED_TABLE); Assert(parent_rel->rd_rel->relkind =3D=3D RELKIND_PARTITIONED_TABLE); This would also fail when attempting to detach a foreign table, as well, and these are legal relkinds in a partition tree. Once we do that, we fall down into the same failure as for the non-concurrent mode in RemoveInheritance(), telling that the relation is not a member of the partition tree. -- Michael --C4hUCv8Uish8W3Ru Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmHBIDIACgkQnvQgOdby QH3eGg//beBC2hQCXmuwiR5PEVlYaIWSWCvc4bsLqDcImfS7TWNsHmWTN9gkadzO XdDQ8fR81POGhEZMm2q6HxaBCF+ak287RS1ydig1SLssWfR1Q2CuIrnbVUAhZ/gR D7jqG9TPq69XItEFQ41ekPBbwUzgPaJpRcLVjOT0r/ogq+8YsPb/D/XPXtIDt0E3 zHXfW8Xbp4FSefIYike5g1Ucyhrr0N/+/fjO4moOtJQrxrlG+RMOUxQM6TqpX6TV Cu2BcYoMIjGfzrAvjiU2nsnDfQI5BYT1VcjALAZ/zgEw8GWasKUnxdADVECyejzL I74DJReQq5asA7E5A39Go218ZPF6r/aZtr+vAqq+2o28tW40VV6K9AzNA5Mxt80C T1Q0MKiDovJG6Dk8lbYWfUzhAwuEdoQFpuXN1xn5oA5NzEUQIWJPW1NBhJbAw5vC X08u/S0hyrxWE87aDTvEhnxggWCZfSP570JF5XFNLrgHiSGQ1T8E9u9REa12+IYb EwfcqUcFmSTpYFQNn8NrTGNukgLiBcldb5Ct/MH2YYdl766UkjM9tMy8FIVL+EEW NoqppZsaq70CcSxZp+RrF1oD17ISQhdwGw7Zd3Um6YWVetD1hs8DRJGHBzq5q5/g Z4KRI93Ym+8D9KnF8jN87xQKtwIHXVeQpekK+Cw6XvHN/aXLkDU= =yKtV -----END PGP SIGNATURE----- --C4hUCv8Uish8W3Ru--