Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLE7E-002cRN-Q6 for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jul 2023 02:37:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qLE7D-003Xkh-9o for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jul 2023 02:37:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLE7C-003Xji-TV for pgsql-hackers@lists.postgresql.org; Mon, 17 Jul 2023 02:37:35 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qLE7A-000yUJ-5X for pgsql-hackers@postgresql.org; Mon, 17 Jul 2023 02:37:33 +0000 Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-7872d448c5aso223441339f.0 for ; Sun, 16 Jul 2023 19:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20221208.gappssmtp.com; s=20221208; t=1689561450; x=1692153450; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dPx9BbMaH0FNOWaHiTWao4yySjtV0PT/WSZEtiuCMsg=; b=a83ks5YrlhesRn64FWjqhTAfgS+uUzaUP2VCRRrDGGx8gqmOJcDfEvKzijztRkL9dk vWppX0rCh1gjyxCbFdBvMxxkz1hyO71a8hFvqrkuob6ailAaQBh1C76xz8X+CHcrTteb a4BHdPotHUYLU2FWk6OIej4kHFqdHynoG9LsCJfSRDr0sZ5VTfaFpFdwO2lKkeCOy80N 4UfVewGYJsN/QdItbIuEDek5jkpjcTiXMaiw9l5h3EcSUCIY8/itLLx1+wTlhoKAl847 F7MeG9gBPzsA5q0gP3wr3UGw5I091V9uvhZc5jffNLi7CgphXfzcKlxBjqWAMxvENTvE ajqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689561450; x=1692153450; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dPx9BbMaH0FNOWaHiTWao4yySjtV0PT/WSZEtiuCMsg=; b=PTYaKrkFyZcCVgrL4X+lYiRbIC71ooYHjQzXcqX5dVplJOXEnRUeSI4amS4wTpv4a1 vj7c6fGDzpldUCubyRLSWo5rXxazyVuONB3us3opyyqrRm9pIhMYk91ohip80c/7Z5cO xohaWpa/2g8vXX5Lpf3393aDy96pcPQ7RhCBumTqpZ1bGxPPV7lhpcWEjAS4nSab+u0m V6Vo7nLo7dAnLZbIvqBxmtIHF33N30+wpF2iNdXPbcBJJD8Z/+8E9cz9ViiIgawMD0An yI9rMnhnMKFH+44toojd+IKj8q7YL7nkSIFyV6wFM5aivgWgtrxSVF79KJUGZV/SC3Xl Aj0g== X-Gm-Message-State: ABy/qLaWEo6JW01CUoYkHs0WCf5R0AXOvR3A35MQMksYMsLJMYYkq2ID YmNb9dDRe3JidX/YTLFdQ4yRkw== X-Google-Smtp-Source: APBJJlEoMuINHuHbxrTKnLrnlmwvbkYFOpgg+QeVemiZ5JA5vexjp0C3FVIHya1QzAAh0bZZrH3/eA== X-Received: by 2002:a6b:6816:0:b0:786:25cf:421f with SMTP id d22-20020a6b6816000000b0078625cf421fmr11969920ioc.19.1689561450097; Sun, 16 Jul 2023 19:37:30 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id e7-20020a056638020700b0042b03d40279sm4372740jaq.80.2023.07.16.19.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jul 2023 19:37:29 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 606F4800425; Sun, 16 Jul 2023 21:37:28 -0500 (CDT) Date: Sun, 16 Jul 2023 21:37:28 -0500 From: Justin Pryzby To: Michael Paquier Cc: Soumyadeep Chakraborty , Zhihong Yu , pgsql-hackers@postgresql.org, Ashwin Agrawal , vanjared@vmware.com Subject: Re: ALTER TABLE SET ACCESS METHOD on partitioned tables Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jun 01, 2023 at 08:50:50AM -0400, Michael Paquier wrote: > >> Speaking of which, ATExecSetAccessMethodNoStorage() does a catalog > >> update even if ALTER TABLE is defined to use the same table AM as what > >> is currently set. There is no need to update the relation's pg_class > >> entry in this case. Be careful that InvokeObjectPostAlterHook() still > >> needs to be checked in this case. Perhaps some tests should be added > >> in test_oat_hooks.sql? It would be tempted to add a new SQL file for > >> that. > > > > Are you suggesting to put this in a conditional: if oldrelam!=newAccessMethod ? > > Yes, that's what I would add with a few lines close to the beginning > of ATExecSetTableSpaceNoStorage() to save from catalog updates if > these are not needed. I understand that it's possible for it to be conditional, but I don't undertand why it's desirable/important ? It still seems preferable to be unconditional. On Wed, May 31, 2023 at 06:35:34PM -0500, Justin Pryzby wrote: >> Why is that desirable ? I'd prefer to see it written with fewer >> conditionals, not more; then, it hits the same path every time. It's not conditional in the tablespace code that this follows, nor others like ATExecSetStatistics(), ATExecForceNoForceRowSecurity(), ATExecSetCompression(), etc, some of which are recently-added. If it's important to do here, isn't it also important to do everywhere else ? -- Justin