Re: [BUG] pg_upgrade test fails from older versions. - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [BUG] pg_upgrade test fails from older versions.
Date
Msg-id Y6VsEJBiELr3LbNK@paquier.xyz
Whole thread Raw
In response to Re: [BUG] pg_upgrade test fails from older versions.  (Justin Pryzby <pryzby@telsasoft.com>)
Responses Re: [BUG] pg_upgrade test fails from older versions.  ("Anton A. Melnikov" <aamelnikov@inbox.ru>)
Re: [BUG] pg_upgrade test fails from older versions.  (Justin Pryzby <pryzby@telsasoft.com>)
List pgsql-hackers
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?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: ARRNELEMS Out-of-bounds possible errors
Next
From: Peter Eisentraut
Date:
Subject: Re: appendBinaryStringInfo stuff