Re: [BUG] pg_upgrade test fails from older versions.
От | Justin Pryzby |
---|---|
Тема | Re: [BUG] pg_upgrade test fails from older versions. |
Дата | |
Msg-id | 20221223032724.GQ1153@telsasoft.com обсуждение исходный текст |
Ответ на | Re: [BUG] pg_upgrade test fails from older versions. (Michael Paquier <michael@paquier.xyz>) |
Ответы |
Re: [BUG] pg_upgrade test fails from older versions.
Re: [BUG] pg_upgrade test fails from older versions. |
Список | pgsql-hackers |
On Fri, Dec 23, 2022 at 11:42:39AM +0900, Michael Paquier wrote: > Hmm. 0001 does a direct check on aclitem as data type used in an > attribute, > For now, I have fixed the most pressing part for tables to match with > the buildfarm +DO $$ + DECLARE + rec text; + col text; + BEGIN + FOR rec in + SELECT oid::regclass::text + FROM pg_class + WHERE relname !~ '^pg_' + AND relkind IN ('r') + ORDER BY 1 + LOOP + FOR col in SELECT attname FROM pg_attribute + WHERE attrelid::regclass::text = rec + AND atttypid = 'aclitem'::regtype + LOOP + EXECUTE 'ALTER TABLE ' || quote_ident(rec) || ' ALTER COLUMN ' || + quote_ident(col) || ' SET DATA TYPE text'; + END LOOP; + END LOOP; + END; $$; This will do a seq scan around pg_attribute for each relation (currently ~600)... Here, that takes a few seconds in a debug build, and I guess it'll be more painful when running under valgrind/discard_caches/antiquated hardware/etc. 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 -- Justin
В списке pgsql-hackers по дате отправления: