Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjTOi-0008BV-4l for pgsql-bugs@arkaria.postgresql.org; Tue, 15 Jan 2019 18:25:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gjTOg-0007Ol-JK for pgsql-bugs@arkaria.postgresql.org; Tue, 15 Jan 2019 18:25:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjTOg-0007J6-6E for pgsql-bugs@lists.postgresql.org; Tue, 15 Jan 2019 18:25:10 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjTOY-0002wZ-CC for pgsql-bugs@lists.postgresql.org; Tue, 15 Jan 2019 18:25:09 +0000 Received: by mail-qt1-x844.google.com with SMTP id e5so4044103qtr.12 for ; Tue, 15 Jan 2019 10:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=75LavSgIcj9KIW2YObu9tLc4gdTfP6/Yj9E1Oaj2hDY=; b=WAWShtIvdEROWbxb4A8r5HtOaaUVfSkWN4VKizwGfZh0QW3B64zhH709HLNsMseT6K XPyV4iw5GiIBxJkc3ORPBLjJHeZYE4oexz3OfVSw2iNjFAiCN2pKDj6lSyNfZZNHarEE aSgjBLWS30dLYQPcw39yS1pjQlLziuM6TbbKX6feu0vyZiVtqKCZNMP53uieVJbjemkN tKbX9E/1U/vOV2EBcHXS4M6DTO82f7/OEfAQEX2NffE6fz5p6Yw+93SIqsCd0Zwv91Zv /Yd0JAns21Z4M1PS9+3XlSl02inalakGed/UJA4tKgrpQo3e2zJKKtCD2BqkMX16/Sn1 ALXw== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=75LavSgIcj9KIW2YObu9tLc4gdTfP6/Yj9E1Oaj2hDY=; b=dNOvPtpI+IvOUgOC0d07SrYYw/vzKFNk1l1k/sspax/AdvRWerO7zU2wEMg7IaQ/aH 1lGoEmh8M0DdgwJdS/t7GtSp47LET+DNfztdMJ2oBjal2kibaIQTfYG0Zu1VF7Agb2Mr NGGfR1umLY68ukT2BMq/44ndM4Rm4N8hr28A7AEUrJzL69AQmYuQFQ8vBoGcg6zx2qDU 0P1K7yYdxkavJ/lfjodgqA/D5+WNchVDRV62zkdM/FUQMPt9nj9INxhcgLfXR3f4SkNF EgiU1EgQ65RhK38D980Vu8w/iUvLSbzxlU4hZhtvOTih/vhxs50R/PeO+oHUQWlq/X5G N67A== X-Gm-Message-State: AJcUukeyav676K9xChUq/VKvAx9DZSE701HIRbDvV34V6KTuzRsOmeIS AuhAXWWTXmTDmn2eDFdceayMi9vkQf9b7IyQK0d6M8LQViLerxca5lMz9KmTt2FO+a5TpbYUUKR 6GzMlgoys21Pl3NPehoLVRDUj+gxneikSVXn3entPl9NAO8ukC6QdeCvko/86heYmRxhUM0YBSB JBBpRzSg8udA== X-Google-Smtp-Source: ALg8bN4M08hDs+dUyUIjiOzeFp2dm0HRnlY0UUU1Pmd2Obm/zYybRnvImAxZHxX1jpC3JPChZgHBog== X-Received: by 2002:aed:314b:: with SMTP id 69mr4043659qtg.247.1547576700239; Tue, 15 Jan 2019 10:25:00 -0800 (PST) Received: from alvin.alvh.no-ip.org ([201.186.80.67]) by smtp.gmail.com with ESMTPSA id d78sm39293799qke.94.2019.01.15.10.24.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Jan 2019 10:24:59 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id CF01DC41; Tue, 15 Jan 2019 15:24:57 -0300 (-03) Date: Tue, 15 Jan 2019 15:24:57 -0300 From: Alvaro Herrera To: Jesper Pedersen Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT Message-ID: <201901151824.mxkelqcnfeq6@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3e406e7f-b3df-7f9d-fcf3-1201f3c87903@redhat.com> User-Agent: NeoMutt/20180716-1013-2c1e88 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jan-10, Jesper Pedersen wrote: > On 1/10/19 12:11 PM, Alvaro Herrera wrote: > > On 2019-Jan-10, PG Bug reporting form wrote: > > > Removing ONLY from the ALTER command makes the index correct. > > > > I'm not clear what problem you're reporting. If you use ONLY, then the > > command doesn't cascade to create the index on partitions, and the index > > is marked invalid. If you add the constraint to each partition and > > ALTER INDEX ATTACH PARTITION, the index on t1 should become valid when > > every partition of the table has its index. > > However, when you use ADD CONSTRAINT FOREIGN KEY you can't use ONLY, so > would it be a good idea to make ADD CONSTRAINT UNIQUE behave the same way, > i.e. error out ? I haven't investigated this angle. It seems more complex than just a simple bugfix, right? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services