Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p8l55-0002en-Rs for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Dec 2022 16:39:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p8l54-0004WX-JQ for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Dec 2022 16:39:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p8l54-0004WO-55 for pgsql-hackers@lists.postgresql.org; Fri, 23 Dec 2022 16:39:34 +0000 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p8l4z-0003j3-VD for pgsql-hackers@lists.postgresql.org; Fri, 23 Dec 2022 16:39:33 +0000 Received: by mail-il1-x12f.google.com with SMTP id o13so2680473ilc.7 for ; Fri, 23 Dec 2022 08:39:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent: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=d0M4javMBWmStvhGxGkwAaR/Ki6bdNtsb5rACmVVlno=; b=T7pXo2/3ggPmVfE+uOQ5dSg8PrN2f8yHzP5aJ+YYwQEr/BC/AffNJSsWRBxbWyn0tQ uo7WM5pgGHtvtZYWcrBGMAHpVwfLEsTrJMer+oIAAW4Wu/L6y15WLI+zwWxnf3sFZ36U EF8BsG4AFMiCNq/bSPvnY4TMexMN5Vmp2BheKRHKvAQpca3oYTSA+ZFbJbNf5/FF9hYv TuRa6yJyOQ/51ex3bW28/lRr+3GASLuKCIZ3F6BevnhYo3Z2ih/91xeW12zws64H+Bb4 Lrxuaxt3YkzsTs6JUTc/UaCuZUpmxYqFHYNiXrpVPaHlpZhylFLQi1ShEHh710G40lex Glqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent: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=d0M4javMBWmStvhGxGkwAaR/Ki6bdNtsb5rACmVVlno=; b=zpNp6ntV/V+6U2hODeWtkQV8yADO9Zcr6ZKZi0bfoOFANGN3QbCczKd08TU0IBMUVh 6MZaR8d7nkXWJT9IxyUVhpr5D0cnVIQDpu7cHJ7KjwFW9evhcsJFC2m3k/5eizqU2l8/ iVv7erbmt+Avw82xCIMmjceO9hE8fpx01ZShpui1Mji6Hg3jYiLpLo6jEVtcCyVzcDsg YIHENI6Dm/8EAcQ6IvZMrZ1VYEd3Y2+VkEiqOzmqRHvqu9WncttnGg74KdoOeNpSDcic o/bJLgkBZHIq3t4zmrl3RAFKIGzGRO2QAK2cY7Ob01X0mKxJF7VJnsBbAZ7/xc/8maU5 7faA== X-Gm-Message-State: AFqh2krKqWb+c7e9K6HAxYxpzQsQW8vQYzUeFoY2fM2PTesBatbcvc2f ZXtKPU0e4ehGGl9kvEpKGOkv5T5SXZP1bIAO X-Google-Smtp-Source: AMrXdXvdsfqa4WjY1txwtaCFaiPx3GFf4tft540hv/NPh0ummvqUjHOSSIe2Kaqtgxpm/kbPYvgHng== X-Received: by 2002:a92:c6cb:0:b0:304:a619:c3f2 with SMTP id v11-20020a92c6cb000000b00304a619c3f2mr6924548ilm.9.1671813567945; Fri, 23 Dec 2022 08:39:27 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id o28-20020a02cc3c000000b0038a525cb97esm1074398jap.87.2022.12.23.08.39.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Dec 2022 08:39:27 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 0DD7780080A; Fri, 23 Dec 2022 10:39:26 -0600 (CST) Date: Fri, 23 Dec 2022 10:39:25 -0600 From: Justin Pryzby To: Michael Paquier Cc: "Anton A. Melnikov" , Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: [BUG] pg_upgrade test fails from older versions. Message-ID: <20221223163925.GR1153@telsasoft.com> References: <49f389ba-95ce-8a9b-09ae-f60650c0e7c7@inbox.ru> <819272.1671415008@sss.pgh.pa.us> <20221223032724.GQ1153@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Dec 23, 2022 at 05:51:28PM +0900, Michael Paquier wrote: > On Thu, Dec 22, 2022 at 09:27:24PM -0600, Justin Pryzby wrote: > > This would do a single seqscan: > > SELECT format('ALTER TABLE %I ALTER COLUMN %I TYPE TEXT', > > attrelid::regclass, attname) FROM pg_attribute WHERE > > atttypid='aclitem'::regtype; -- AND ... > > \gexec > > FWIW, I find the use of a FOR loop with a DO block much cleaner to > follow in this context, so something like the attached would be able > to group the two queries and address your point on O(N^2). Do you > like that? LGTM. Thanks. -- Justin