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.96) (envelope-from ) id 1woJH8-000xyw-0c for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Jul 2026 11:13:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1woJH7-00CepU-04 for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Jul 2026 11:13:37 +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.96) (envelope-from ) id 1woJH6-00CepM-2T for pgsql-bugs@lists.postgresql.org; Mon, 27 Jul 2026 11:13:36 +0000 Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1woJH4-00000000ZUR-2r7M for pgsql-bugs@lists.postgresql.org; Mon, 27 Jul 2026 11:13:35 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id 94F921D00338; Mon, 27 Jul 2026 07:13:33 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Mon, 27 Jul 2026 07:13:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm1; t=1785150813; x= 1785237213; bh=BrRTYf6kiU/u+HJgxD64dGBN0+caU/vUyQLeRUgsI+s=; b=G 0zZtQ7f1XP3izTAzx1K/evxYU/3CVUWtBrkVEuw1r4V5SLTRnhiNbnAvf3h7HL57 7Y5RIU7o9pW/kLy6AN4BgXSXZsRM49sqkSDuTqdGDlmwr0pb8yuDx66/S3nKiZ// yR7COlcJ8BKH/hP8r3VdA8GYtHEwZjPAJpDHfJndHSLbAn76wGidFeO/k2Cfw018 9t3LysFzxLxDHGoKNVvX9KR0i2LrGTopU9NwIfzlWaeru8Dwjmt2jUvdqYU6XbUh gOiu9c5Pqry4COf/qNo0VpHy19vbuX0pj9TygJ0oT91FnsSPHShOnm77H2XTy5f4 BxKFAtwPvRMAgkorpDDQg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1785150813; x=1785237213; bh=BrRTYf6kiU/u+ HJgxD64dGBN0+caU/vUyQLeRUgsI+s=; b=TWnhZ0KRtowSKL6FfXM1oqrWVox8K On6r8J0u1H83ZDIeMJZ8QfyUPbyqEC2U049f7UUxPT9FE1VDzpomW6tQMpgxpQ6N edXKIlQzKSer8Y/JQh3QwKWYM16BuvNl4yIKJTajOoR/pfLaknd6dpiP2l4Wx1Vl AvQTcyb+LJsSw4rl+9PZAioAaJobvL8xsN+OWP1SrPJdrkKDSokMcFnFaiGPTCCm i1m9srxhrPAg8z+fvnUhg1G7EHRIvPrfK71EIZKlV87ZS/v6hgB7fIgrpUIPcwR0 /QH8Ddwx9JQ0FaLMAUg960fONqSPTtiLpPoJtDFByH3AAeVtjoVQEba+A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFVH+C3AJOFe7VqggZ5DMBTttPQFlEVMAasq5WFgZJKsQGSA//wKYbanDIA3ViWmT WA1QCTzKC/LQELxqjfxrSeSYeuG+P3si7ygYeI+ZX+SwtX946RxBc70ldT7s+evk8qqJC/ gwz+euCBs5mMh9PtBJfr0ZeSZ48Dr9Tz+uKk+ikQbAwc+CtNUmceRU15TiSbpJDKSOGxmB Digqpil28ucWBvsciRelFS7dRnTqhXjbM1mUnbQMPvzRuG5oNtRLXvtwlVa3fQjj+Iwqlg mCitgsThlZw7V3E/DN/8INRJOyzT2M2h8Tgheu/gn1QjCfiBVbjZWumWKs/bdtpWLlByJ3 L1RygK+1Fyf+YDvAcKJPWKyMOkEz29SpwAsE5c5kIW+MTOasm8pd/RPkQMcj6ONUhnAbuH M2G5NtzGvSshOS5GH/+LsxC1hQc7/LVIbarwPoTtiwDQkItQKtMGO2iytH8IIgK9AqMuUe Ry8BXRzkMSTqYGrYtuqQi4UNQbuhg7k27/0Ff/T6CpwkQyIEZiIZXWVhlkGuhiBV20Pmri iezmYXP0WAveeCYUm0mkix47J0x7shpso/1fouapigdku2gej/7xBf4FhOaHYaoIzH5Pd7 lzCWytudDWXr4Cq7rbbL1NxosEvynCzZkYgk+BaNvuKN8IeZjevNCK+AEfaA X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Jul 2026 07:13:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1785150810; bh=mCeWvFt25c0WYpbvm8z1la1nsu0k8Rm2cLYYteLjmdk=; h=Date:From:To:Subject:In-Reply-To:From; b=hssL7/EqjCAAsULB15fRsCksDi7G9vtkS9Og+MEB0MSNLCiIzwfS6H/iSDxC9G3ta q78wQLyprJRm20FDFbGo1dN4B98lDp8TzXKCRP0OJf9tDBd533XwnVcxVks2U3xAXZ yPg52DP+EVDyZaLoSMTGyT++8FSCc0ybMHXXSSiUyG3JbxdfpDxCHvNtSypRW/luJu BUhjGHdwKZtmS3HOKaS0/B59P7bEKVUQ3ynTEwCIYAEXeRjdGRpma1K1CmzlmE1YUG kAcMk4LLOA4ZNirz0ADzEAWHHkU/ISGvFY6CbaItVKXVcNB7bmsP0b40FanlFcVLNj TMSThCVROAp8A== Received: by ida.kurilemu.internal (Postfix, from userid 1000) id 1DB06B00076; Mon, 27 Jul 2026 13:13:30 +0200 (CEST) Date: Mon, 27 Jul 2026 13:13:30 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: o15611@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19580: Can not FINALIZE detach partition. Table in stuck Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <19580-4baeeaaf5407a60d@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-Jul-25, PG Bug reporting form wrote: > drop table if exists t; > CREATE TABLE t (id bigint GENERATED BY DEFAULT AS IDENTITY, reg int, primary > key (id, reg)) PARTITION BY RANGE (id); > CREATE TABLE t1 PARTITION OF t FOR VALUES FROM (1) TO (20) PARTITION BY > RANGE(reg); > CREATE TABLE t11 PARTITION OF t1 FOR VALUES FROM (1) TO (10); > ALTER TABLE t DETACH PARTITION t1; > ALTER TABLE t ATTACH PARTITION t1 FOR VALUES FROM (1) TO (20); > > "generated by default as identity" was added only to t1 and not in t11. Hmm, I think the bug here is that ATTACH PARTITION seems to have neglected to add the GENERATED BY expression to that column of t11. When the table was initially created in line 4, the generation expression was there, but DETACH removes it, and then ATTACH doesn't put it back. (If you start this sequence from scratch and try the DETACH CONCURRENTLY at after creating t11 but before doing the DETACH/ATTACH dance, it seems to work properly.) > But, the problem is: > ALTER TABLE t DETACH PARTITION t1 CONCURRENTLY; > ERROR: column "id" of relation "t11" is not an identity column Even if the above is fixed, maybe this should somehow be made a WARNING instead of a hard error, to avoid brittleness in DETACH in cases of bogus catalog contents. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "XML!" Exclaimed C++. "What are you doing here? You're not a programming language." "Tell that to the people who use me," said XML. https://burningbird.net/the-parable-of-the-languages/