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 1gwCBR-0007jr-KU for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Feb 2019 20:40:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gwCBQ-00032t-78 for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Feb 2019 20:40:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gwCBP-00032k-Sa for pgsql-hackers@lists.postgresql.org; Tue, 19 Feb 2019 20:40:04 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gwCBM-0000X8-E5 for pgsql-hackers@lists.postgresql.org; Tue, 19 Feb 2019 20:40:02 +0000 Received: by mail-qk1-x743.google.com with SMTP id h28so547613qkk.7 for ; Tue, 19 Feb 2019 12:40:00 -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=VwOPaBI4EEiABkfrSqcAh/2R5ct5ffVs0s2tMGZWI9M=; b=JVvviwVXGyO5xHLe9BucQE23Qj6+VPZBwo1fBV/NqXFXMSdBhA9+WEzHZetCGX2Z2t cOHCrRkDV7GuyusqHGeyqofPG/aU1UwoQ/Ub9PZkmz0JgUgmapjOXOveSkYpGvDdmlUg /ylpIdjPI9YfUP4i0TP1BTglAJT3ozpqvUwOt22REMTe/1rI7BD9KbfalS33b8cSq2q+ G3vFdVz9WHJxtB47fz2rfgu+dSASNgYSPJP0gMYwe41FJsvamNwKIVk8Go7VLzg0aKNZ 9GkMp3/qdQCylpp3byc4pQ5uk6HOR6MVzUtluQfsAXFRXsQUYjM4iN8Sc0ltgHUWoUNb F39w== 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=VwOPaBI4EEiABkfrSqcAh/2R5ct5ffVs0s2tMGZWI9M=; b=C2578dfajvpj6rMIlE5ohEsMOpKge+p2IYOsCaGLrarY5owb8h4tw0jiGaJQkcLpXG XNqsurwmZl6b7o/mfHVv+VO2h59pupWSVvFwQSbrZbi02WBRaaZk9orTE3y95P+ySkPm v4pKnb3HTym+uQwEpWc8S4pmVISrpAFPHbGRvvF1Niyj5UxgCp0DoQ88UsPMVzSZAJk6 EIyXZRm7iY7lUpB4VncaS/ihvHeE8+aTAB6BFCM34ix5lE+83o4Hdee9LEJ4DVJ3pRMD td4mUeTZcsyl9jRos1Miyk+ubkEaf0snO5zDaa+y1b7hJ+lTS11R1xOzMBRSHpSn2KBF 7nHA== X-Gm-Message-State: AHQUAubgIGdHss7KoqLBZL6OntUvnlTs0IfuYSoj/bjVySfIxQiKacxS lM8zYci7Y/DWHqcUVy2zwcUoiw== X-Google-Smtp-Source: AHgI3IZAqakdjYODba7hgUcFLE9QBWz3SMAMIIBjwmi7necuLysWBIoFQwSSG5humGQEYOWPoHRdCQ== X-Received: by 2002:a37:4651:: with SMTP id t78mr21972473qka.210.1550608799547; Tue, 19 Feb 2019 12:39:59 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([191.126.227.192]) by smtp.gmail.com with ESMTPSA id o65sm10929465qkl.11.2019.02.19.12.39.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Feb 2019 12:39:58 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 3343F1246F4; Tue, 19 Feb 2019 17:39:56 -0300 (-03) Date: Tue, 19 Feb 2019 17:39:56 -0300 From: Alvaro Herrera To: Robert Haas Cc: Pg Hackers Subject: Re: propagating replica identity to partitions Message-ID: <20190219203956.GA8799@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Feb-19, Robert Haas wrote: > It's not unreasonable to use the parent's REPLICA IDENTITY setting as > the default for new partitions, much as we now do for the TABLESPACE, > because the parent's replica identity is otherwise without meaning. > But I'm less convinced that it's reasonable to have changing the > parent's replica identity recurse to existing children, because: > > 1. That's different from the TABLESPACE case. We shouldn't just treat > each new instance of this problem as a green field where we can pick > any old behavior at random; it should be consistent as far as > reasonable, Maybe we should be using the inheritance marker in the command to note whether to recurse to partitions? That is, if you say ALTER TABLE ONLY parent SET REPLICA IDENTITY then we don't recurse and just change the parent table and future partitions, whereas if you leave out the ONLY then it does affect existing partitions. However, I think TABLESPACE and any other property that involves rewriting tables wholesale can reasonably be expected to behave differently (w.r.t. recursing) from commands that just modify the catalogs. I think we already have such a distinction somewhere. EXPLAIN ALTER TABLE would sure be handy :-) > 2. It confuses a change to the default for new partitions with a > change to the value for existing partitions. Say that you've got 5 > existing partitions that use one setting, but now you want new > partitions to use a different setting. You can't get that with your > proposed semantics, because trying to change the default will change > all the existing partitions to the new value also, even though that's > not what you wanted. If we make sure to heed ONLY (and I admit to not thinking about it in my original patch) then I think this angle is covered. > We should really, really try to figure out all of the things that are > like this -- a property that is meaningless for the partitioned table > itself but may serve as a useful default for its children -- and try > to make them all work the same, ideally in one release, rather than > changing them at different times, back-patching sometimes, and having > no consistency in the details. I have no argument against somebody doing that, but I don't think I have the resources to do in in time for 12; on the other hand, leaving a known misfeature unfixed because nobody has looked for hypothetical similar bugs would be bad. I'm not proposing to back-patch this, but I would love it if I can borrow somebody's time machine to retroactively fix it for 11.0. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services