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 1glcSV-0002xf-AI for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Jan 2019 16:29:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1glcST-0007P4-DF for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Jan 2019 16:29:57 +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 1glcST-0007Ox-3W for pgsql-bugs@lists.postgresql.org; Mon, 21 Jan 2019 16:29:57 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glcSL-0005JB-8b for pgsql-bugs@lists.postgresql.org; Mon, 21 Jan 2019 16:29:56 +0000 Received: by mail-qt1-x841.google.com with SMTP id p17so24192052qtl.5 for ; Mon, 21 Jan 2019 08:29:48 -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=IRWNdI5S+1eYR/uh4KlYUpbGzoxpd8f9VGW4dH2FPZc=; b=gmVr2cQ5ItDflzK2qYA4CCmJxfBzCkSjBGFhr1dpeI/rM6S1JM9afrY3VhuFcawHFO nMitfWqz3Vub3lZRfquPRprR7LLIW6+kzGsLO79KMqNvshmQ8ZwlYAXWBAvJMUeBqMur /wcLXKYOVW1lKowHYiXyrAxW394HT9Kt0KtcasHH11C9VOkwqYisODTGrVcrlBYBIbL6 vVrXT7BXCK/SY/EGTtIzcZzNwpU3pEe9kluv8nvwvOi0m5aqwY7K5MOjWgXjPWYt1BMf b4g0BQpBh7Oc0tYLs/g2VMbbzwjx845Mhd0IRPPSuzFFiJUcM1K5WUjNS1IVIsKdKBPn 8Yig== 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=IRWNdI5S+1eYR/uh4KlYUpbGzoxpd8f9VGW4dH2FPZc=; b=WOc78W+4WHQPhbHGdkQ0Pjgeigze+OqXdWVK9ey5+hAS5hgMt3RtVqYOgwEeZduu4U 817yXYU9wXa7JIMRBhsCBsbCKp4qZ4YTr1u+avi/pqgExZwBCW+I4zF76rKH0MFIegnl Lgjcr19RDkrWu9zIqU+eLD7J57/zCvnJChgUEHFOavyJOV6bTbZbqBZUx7LYs7obxe6p o7RiGjC8g9oZMZxuxu/DIH+8iPpFZIov8PCxfvYLdRvy2nWVVT6DQPw0MCuyuvAMeOye uPTRYnenNq0EkCjO9TuaOK+YMQu1mSOsKSTW3NI6+6hf2GrPU3x5LAvHZI1KRHncY/2V IxsQ== X-Gm-Message-State: AJcUukcN9I10oRtzg/7j2CdIAB6BZWRs5ARd+yvzTokG0npqSZj/69w5 fD6gSCNbAFcgMjsvLOtxVeyLBQ== X-Google-Smtp-Source: ALg8bN4M6F23wAjI0OBiVm1XlF9ajIx8sGA5878v0huh7bVR4Ptn18O3fEEWHF5/oPaQC7ojnRTTrg== X-Received: by 2002:a0c:f403:: with SMTP id h3mr26363284qvl.137.1548088187031; Mon, 21 Jan 2019 08:29:47 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id q63sm51069129qke.44.2019.01.21.08.29.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jan 2019 08:29:46 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 5AFBDA74; Mon, 21 Jan 2019 13:29:44 -0300 (-03) Date: Mon, 21 Jan 2019 13:29:44 -0300 From: Alvaro Herrera To: Amit Langote Cc: Tom Lane , Jesper Pedersen , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT Message-ID: <201901211629.gu3plkjjqefw@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <24217a8f-5f9b-8bcc-1698-ff38921addee@lab.ntt.co.jp> User-Agent: NeoMutt/20180716-1013-2c1e88 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jan-21, Amit Langote wrote: > Sorry about the noise. I agree with the committed approach. Great, thanks for checking. > With this, > ALTER TABLE ADD FOREIGN KEY's inheritance recursion path now looks > completely different from ALTER TABLE ADD CHECK's, but that's fine. > Actually, if we had the same "clone" approach for check constraints, which > both checks if a child already has the constraint being cloned and creates > one if not, we could do away with errors like the following: > > create table p (a int, constraint check_a check (a > 0)) partition by list > create table p1 (a int); > alter table p attach partition p1 for values in (1); > ERROR: child table is missing constraint "check_a" > > But of course that would be a different feature. Heh, I wasn't aware that this failed in this silly way. But yeah, that's a different feature and we would certainly not backpatch a fix for it. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services