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 1lO2ap-0002IK-Cn for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Mar 2021 18:14:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lO2ao-0002Un-4N for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Mar 2021 18:14:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lO2an-0002TL-Sz for pgsql-hackers@lists.postgresql.org; Sun, 21 Mar 2021 18:14:25 +0000 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lO2al-0007fP-UX for pgsql-hackers@lists.postgresql.org; Sun, 21 Mar 2021 18:14:24 +0000 Received: by mail-io1-xd35.google.com with SMTP id b10so11591529iot.4 for ; Sun, 21 Mar 2021 11:14:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8fzeMN/b73oZG4VCLkPxE+GvHYAgZ/HtSjjZrv6uU54=; b=s4CyjxV02Rb+mewlYhdgAQWs3AkWMik4PtKhhZtYLCb7QTTSEiAF9fVgm1KFwAeOq7 Teddmsu+/XL56RHmGpEFwGFzxCoKhuBZK59lPnGRDvQhYKEOssJA6I0PcLdta9RQGVPV UO9SWSDTEIlBeU757AcSL8D/ZU8PeUMoBhmmsTq+ymfvnFb+l47gD0mGeqLdZ1wSVMo8 N2eA7vnzZbYbmFoIqk5vJJh4QwUtXw6Om5ZLNIPYT0tHzgQ+n6wezn4NvgjY96LmKESv 2TcC4MR+ZwH3a6M9rWcohzVJsYDQ7ru+8TuKQjOqMR1iaKuO2UR6HWn1Nn1gbEYHjAL5 sEGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=8fzeMN/b73oZG4VCLkPxE+GvHYAgZ/HtSjjZrv6uU54=; b=J5UCtZuFxqI/hlpPiB2Bw/4O8qBG+6RW0k0+E/D9fLFwJsvODyxR+1d+7DcZufpWe0 7l3bI3aTUencc4RY3p+av2VIRC0CwxM/Xc4EPN207A0KxhZSEj+XAoEm2v/lUpxUk0mw tKyOhCG9UnA4HVqB4WkRLlc0Grd9yrnzYwbr388aWYLyxOwuQvWiRYwUIA8jjS7/xWVm 1E1gPO6hXxX8dEiz3PCpf+oENbjz710C+FuNMAHAV7D45UZGHn61ijWZrHttFiNMemZH z6vGwrAylYW42A2Hlk0ccQiiEzTT/dma1wzd23y2SgznxrCjsftl9WPmDOW5eI1m9Kwi cXOg== X-Gm-Message-State: AOAM531WK5g6JEzqCq45uUgMrj+c1OSZ9ATO5e1EUXduflgTHrW43bSE vBc5/MN39HoczFHzORL6+MlVFA== X-Google-Smtp-Source: ABdhPJz6sSA8d4oT/uGjalFxVbn0xnWOMA7KFKM7Shwlozijj1aZH44Uv/nlLJvMPjftvzIRRwz/6A== X-Received: by 2002:a02:8801:: with SMTP id r1mr8515346jai.51.1616350462374; Sun, 21 Mar 2021 11:14:22 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id g16sm6432248iln.29.2021.03.21.11.14.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Mar 2021 11:14:22 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 18F7E801A44; Sun, 21 Mar 2021 13:14:21 -0500 (CDT) Date: Sun, 21 Mar 2021 13:14:20 -0500 From: Justin Pryzby To: Alvaro Herrera Cc: Amit Langote , pgsql-hackers@lists.postgresql.org Subject: Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY Message-ID: <20210321181420.GC11765@telsasoft.com> References: <20210321175453.GB11765@telsasoft.com> <20210321180115.GA2101@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210321180115.GA2101@alvherre.pgsql> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. -- Justin