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 1lO2iO-0002YA-DH for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Mar 2021 18:22:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lO2iM-0000K1-BC for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Mar 2021 18:22:14 +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 1lO2iM-0000Ju-4G for pgsql-hackers@lists.postgresql.org; Sun, 21 Mar 2021 18:22:14 +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 1lO2iF-0004LI-9A for pgsql-hackers@lists.postgresql.org; Sun, 21 Mar 2021 18:22:13 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 401FB12F9; Sun, 21 Mar 2021 14:22:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 21 Mar 2021 14:22:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=RgGlBgDkRqNKPvpEqHkmD2UI1OJaDsLYwg5bqQ8Il/M=; b=iMsMR4BK cAb9QL+Dt/LWEsD9jfUxi2Wh11fVgyHY5464nnWoB2ojBN7FWTADi3V/1Gr7np1N TXVzLHjJkoFjWhhwkzx9OOqJT6fHAqnBMStZaEX7m2dYLU0Rm0zp5MuyGU6qMHmZ I2d6KS/41MRRnCg0KZ+l5sotffXBDmzJ1H6qtWYDHl6JloT4s2TTHRut80VopkeO I//zFYJ70q0C1igdG4lIj1Nde5sc/GyUHhVY8pjZucRIApoP+66+PbYr7JWup3br IE0aPnTz0jsADPnKgc7olmLB/VihSITGI8EyBDorkCCzWTMWak6rMVQFJ+INq6ru wlTvYQjeXXoU4w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpeeufffhjeeiueeuffegvddukeegledtveeivdeiueef ieeivefgteehueefteehvdenucfkphepudeltddrleehrdduledrleehnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegr lhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id F27221080057; Sun, 21 Mar 2021 14:22:02 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 9BDA52A0FD5; Sun, 21 Mar 2021 15:22:00 -0300 (-03) Date: Sun, 21 Mar 2021 15:22:00 -0300 From: Alvaro Herrera To: Justin Pryzby Cc: Amit Langote , pgsql-hackers@lists.postgresql.org Subject: Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY Message-ID: <20210321182200.GA3837@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210321181420.GC11765@telsasoft.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Mar-21, Justin Pryzby wrote: > On Sun, Mar 21, 2021 at 03:01:15PM -0300, Alvaro Herrera wrote: > > > But note that it doesn't check if an existing constraint "implies" the new > > > constraint - maybe it should. > > > > Hm, I'm not sure I want to do that, because that means that if I later > > have to attach the partition again with the same partition bounds, then > > I might have to incur a scan to recheck the constraint. I think we want > > to make the new constraint be as tight as possible ... > > The ATTACH PARTITION checks if any existing constraint impilies the (proposed) > partition bounds, not just if constraints are equal. So I'm suggesting to do > the same here. So if we do that on DETACH, what would happen on ATTACH? -- Álvaro Herrera 39°49'30"S 73°17'W