pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Anton A. Melnikov <aamelnikov@inbox.ru>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: [BUG] pg_upgrade test fails from older versions.
Date: Fri, 23 Dec 2022 10:39:25 -0600
Message-ID: <20221223163925.GR1153@telsasoft.com> (raw)
In-Reply-To: <Y6VsEJBiELr3LbNK@paquier.xyz>
References: <49f389ba-95ce-8a9b-09ae-f60650c0e7c7@inbox.ru>
	<819272.1671415008@sss.pgh.pa.us>
	<Y5/XgkzX2LVe7PvZ@paquier.xyz>
	<f9d65c82-ebef-4ff8-1055-b1b704a19995@inbox.ru>
	<Y6UVn1xZ5fx00qeP@paquier.xyz>
	<20221223032724.GQ1153@telsasoft.com>
	<Y6VsEJBiELr3LbNK@paquier.xyz>

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





view thread (19+ messages)  latest in thread

Message-ID: <20221223163925.GR1153@telsasoft.com>
Permalink:  ../20221223163925.GR1153@telsasoft.com/
Also on:    postgresql.org/message-id/20221223163925.GR1153@telsasoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: pryzby@telsasoft.com, michael@paquier.xyz, aamelnikov@inbox.ru, tgl@sss.pgh.pa.us
  Subject: Re: [BUG] pg_upgrade test fails from older versions.
  In-Reply-To: <20221223163925.GR1153@telsasoft.com>
  References: <49f389ba-95ce-8a9b-09ae-f60650c0e7c7@inbox.ru> <819272.1671415008@sss.pgh.pa.us> <Y5/XgkzX2LVe7PvZ@paquier.xyz> <f9d65c82-ebef-4ff8-1055-b1b704a19995@inbox.ru> <Y6UVn1xZ5fx00qeP@paquier.xyz> <20221223032724.GQ1153@telsasoft.com> <Y6VsEJBiELr3LbNK@paquier.xyz> <20221223163925.GR1153@telsasoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox