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 1mzPjT-0002OX-LT for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Dec 2021 20:58:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mzPjR-0005AV-GM for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Dec 2021 20:58:05 +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 1mzPjQ-0005AL-4b for pgsql-bugs@lists.postgresql.org; Mon, 20 Dec 2021 20:58:05 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzPjK-0007Lu-1S for pgsql-bugs@lists.postgresql.org; Mon, 20 Dec 2021 20:58:02 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id DD33D320112B; Mon, 20 Dec 2021 15:57:51 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 20 Dec 2021 15:57:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding: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=eTUPormKg8k254BNGSioW9qdsFsEZp5dtTu1SOpnq i4=; b=HcdE53JMCcOTDkxiDtETl0k4rXcB+xwTbW4/HgTXl5XF6a7tw04ihjRBC XlMV5XH5PLTwp79KH06jLCbSw7UE0D+zZlTtJVIcw/QzbYPKPWpCxqloggH6nBIL sG56ckXnz5xi8ivJ/mrDeOGj3OV5/tRl5RMjUPe/R+kU1we+Q6890iUiNAa31lK/ 0GsWbmBgf9DZPYRjyYVbOqxa+Fxuo+rFheYbBAL+ji2LXBYpL7DHXOlZSUtPAShJ s/oA0/5ZiJYpuOctUaB7pA2fQCSNnYOzgk6Rbg6PbL+VBkxcO840HUOaYPI2gbf2 CqslFAXrNg8pQkz1Y+Rd9bwPTXHCQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddtvddgudeggecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnth gvrhhprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeefjeegheetuefhveev udelueeftdejteeiffetvdduhfdtieefgfeutedtveeggfenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghu thesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Dec 2021 15:57:49 -0500 (EST) Message-ID: Date: Mon, 20 Dec 2021 21:57:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: BUG #17339: Assert failed on attempt to detach a sequence concurrently Content-Language: en-US To: Michael Paquier , exclusion@gmail.com, pgsql-bugs@lists.postgresql.org References: <17339-a9e09aaf38a3457a@postgresql.org> From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 20.12.21 13:38, Michael Paquier wrote: > On Sun, Dec 19, 2021 at 06:00:02AM +0000, PG Bug reporting form wrote: >> CREATE SEQUENCE seq; >> CREATE TABLE range_parted(a int) PARTITION BY RANGE(a); >> ALTER TABLE range_parted DETACH PARTITION seq CONCURRENTLY; > > The same error happens additionally for views or materialized views. > Looking at the code, I think that we should just apply > ATSimplePermissions() on (ATT_TABLE | ATT_FOREIGN_TABLE) when > executing the detach command to check for the supported relkinds. > That would make the logic consistent with the attach code path that > does the same check on the partition attached, while generating an > error message already generic enough for this purpose. > > Attached is a patch, with some regression tests. Is it possible for child tables in partitioned tables to have different ownerships? Then this change would introduce a new failure mode.