Re: [BUG] pg_upgrade test fails from older versions.
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: "Anton A. Melnikov" <aamelnikov@inbox.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-12-19T03:10:30Z
Lists: pgsql-hackers
On Mon, Dec 19, 2022 at 03:50:19AM +0300, Anton A. Melnikov wrote: > +-- The internal format of "aclitem" changed in PostgreSQL version 16 > +-- so replace it with text type > +\if :oldpgversion_le15 > +DO $$ > +DECLARE > + change_aclitem_type TEXT; > +BEGIN > + FOR change_aclitem_type IN > + SELECT 'ALTER TABLE ' || table_schema || '.' || > + table_name || ' ALTER COLUMN ' || > + column_name || ' SET DATA TYPE text;' > + AS change_aclitem_type > + FROM information_schema.columns > + WHERE data_type = 'aclitem' and table_schema != 'pg_catalog' > + LOOP > + EXECUTE change_aclitem_type; > + END LOOP; > +END; > +$$; > +\endif This is forgetting about materialized views, which is something that pg_upgrade would also complain about when checking for relations with aclitems. As far as I can see, the only place in the main regression test suite where we have an aclitem attribute is tab_core_types for HEAD and the stable branches, so it would be enough to do this change. Anyway, wouldn't it be better to use the same conditions as the WITH OIDS queries a few lines above, at least for consistency? Note that check_for_data_types_usage() checks for tables, matviews and indexes. -- Michael
Commits
-
Add custom filtering rules to the TAP tests of pg_upgrade
- 9814ff550046 16.0 landed
-
Switch query fixing aclitems in ~15 from O(N^2) to O(N) in upgrade_adapt.sql
- d3c0cc444730 16.0 landed
-
Update upgrade_adapt.sql to handle tables using aclitem as data type
- f4f2f2b84a0b 16.0 landed
-
Fix some incorrectness in upgrade_adapt.sql on query for WITH OIDS
- a2688c4e0329 12.14 landed
- d4fea2e89d44 13.10 landed
- fd36b82c5d74 14.7 landed
- 9c48a0f00011 15.2 landed
- 3022cb143396 16.0 landed