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 1gzUsN-00014y-JG for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Feb 2019 23:14:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gzUsM-00017t-3p for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Feb 2019 23:14:02 +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 1gzUsL-00011K-PE for pgsql-hackers@lists.postgresql.org; Thu, 28 Feb 2019 23:14:01 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzUsE-0007cD-I9 for pgsql-hackers@lists.postgresql.org; Thu, 28 Feb 2019 23:14:00 +0000 Received: by mail-qt1-x841.google.com with SMTP id y4so25647997qtc.10 for ; Thu, 28 Feb 2019 15:13:54 -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=fJQH+S4YIHJVBPeMlaNK0hHQ5VMZLZ/2uazNSJBoEhc=; b=ZXFfuX2uDKYJoKGZcAqZIK5EvB3USlQfuSXnNpD2TVKdti2G8BTphhXA1iF+hzcxMm Db/XSC5iW3ENMr7tri3Vk1ELfIIwvQ3In+3fIaMSPfa5OTs8uodL1VTOa9ewXtphprkG NeaL7NlduhQaVgihMikX8b2TYrVnZ4Rug8B0u0JKfsS/GyljkxmS814zPxr0gTitnCwc Dvqee8mqVbf/wzIw7XCmYyL3AFABzQ1EH7aeBkLiLoH9SVTbhfHneh1Pbz7xv7y10Lqy 0ALfz2UGkyZTEULU1cAOfI/srjPJXaPQN3yxBGvcOKlEN5de2V1z2gBuiwy5Ifcjhljb RJuA== 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=fJQH+S4YIHJVBPeMlaNK0hHQ5VMZLZ/2uazNSJBoEhc=; b=nMXEqJfLzbC1rTd/y03743djzlQGye+CXf2gg/yYIyLQsxqpTfFlWMpSQVnqGyTIWN QMsU/UTLMnZOmbJK5Xy2/xX41d1f2VAQ+3+5sWQfCVwOQ70YE9EL7AzcXj8bwaU3WcEk 48QwuY/J0Ll0g4pZbLNNeGmBath58zXhIb7Sq/c4HvpuFPk0a7ZLC7vmRZSgnYwc3e0Y 4l6C8qJS4U8G02H8HhsB1fzpyz8sDIFXvEC0jKHCuw9UH9RHoLP6gnOI8THE9W6XeBNT kJul52rHfVwoEbz1WUcY/Y0Q7ayrWbT9VcAvAy4Rsl6+6JRLqROzwMdQCPOfFMRRY6nV /3Mw== X-Gm-Message-State: APjAAAXhRtIkNJxsakAnlOCTw7+TfT3CLUAjM0w/zFrClYfqnSPKgkfd oDisLtdvR+9kgR54Qakl2bkDzw== X-Google-Smtp-Source: APXvYqy3l7oFoGVDsitt3O9wZCx4iAOpUdMMsXKWFZHgh8mhnu0VfQ96cFcNVKX58HnhVv7BgJWgIA== X-Received: by 2002:aed:23c6:: with SMTP id k6mr1556348qtc.244.1551395633505; Thu, 28 Feb 2019 15:13:53 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([191.126.227.76]) by smtp.gmail.com with ESMTPSA id 20sm13003034qts.82.2019.02.28.15.13.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 15:13:52 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 19E0C121419; Thu, 28 Feb 2019 19:41:11 -0300 (-03) Date: Thu, 28 Feb 2019 19:41:11 -0300 From: Alvaro Herrera To: Robert Haas Cc: Pg Hackers , Peter Eisentraut Subject: Re: propagating replica identity to partitions Message-ID: <20190228224111.GA24086@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 Added Peter E to CC; question at the very end. On 2019-Feb-20, Robert Haas wrote: > Yeah, we could. I wonder, though, whether we should just make > everything recurse. I think that's what people are commonly going to > want, at least for partitioned tables, and it doesn't seem to me that > it would hurt anything to make the inheritance case work that way, > too. Right now it looks like we have this list of exceptions: > > - actions for identity columns (ADD GENERATED, SET etc., DROP IDENTITY) > - TRIGGER > - CLUSTER > - OWNER > - TABLESPACE never recurse to descendant tables > - Adding a constraint recurses only for CHECK constraints that are not > marked NO INHERIT. > > I have a feeling we eventually want this list to be empty, right? We > want a partitioned table to work as much like a non-partitioned table > as possible, unless the user asks for some other behavior. Going from > six exceptions to four and maybe having some of them depend on whether > it's partitioning or inheritance doesn't seem like it's as good and > clear as trying to adopt a really uniform policy. > > I don't buy Simon's argument that we should treat TABLESPACE > differently because the tables might be really big and take a long > time to move. I agree that this could well be true, but nobody is > proposing to remove the ability to move tables individually or to use > ONLY here. Allowing TABLESPACE to recurse just gives people one > additional choice that they don't have today: to move everything at > once. We don't lose any functionality by enabling that. Tablespaces already behave a little bit especially in another sense: it doesn't recurse to indexes. I think it's not possible to implement a three-way flag, where you tell it to move only the table, or to recurse to child tables but leave local indexes alone, or just to move everything. If we don't move the child indexes, are we really recursing in that sense? I think changing the behavior of tablespaces is likely to cause pain for people with existing scripts that expect the command not to recurse. We would have to add a switch of some kind to provide the old behavior in order not to break those, and that doesn't seem so good either. I agree we definitely want to treat a partitioned table as similarly as possible to a non-partitioned table, but in the particular case of tablespace it seems to me better not to mess with the behavior. CLUSTER: I'm not sure about this one. For legacy inheritance there's no principled way to figure out the right index to recurse to. For partitioning that seems a very simple problem, but I do wonder if there's any use case at all for ALTER TABLE CLUSTER there. My inclination would be to reject ALTER TABLE CLUSTER on a partitioned table altogether, if it isn't already. OWNER: let's just change this one to recurse always. I think we have a consensus about this one. TRIGGER: I think it would be good to recurse, based on the trigger name. I'm not sure what to do about legacy inheritance; the trigger isn't likely to be there. An option is to silently ignore each inheritance child (not partition) if the trigger isn't present on it. We all seem to agree that REPLICA IDENTITY should recurse. Maybe ADD GENERATED AS IDENTITY / DROP IDENTITY should recurse; not really sure about this one. Peter? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services