Re: [BUG] pg_upgrade test fails from older versions.

2022-12-27 Thread Anton A. Melnikov
On 27.12.2022 16:50, Michael Paquier wrote: If there are no other considerations could you close the corresponding record on the January CF, please? Indeed, now marked as committed. - Thanks a lot! Merry Christmas! -- Anton A. Melnikov Postgres Professional: http://www.postgrespro.com The

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-27 Thread Michael Paquier
On Tue, Dec 27, 2022 at 03:26:10PM +0300, Anton A. Melnikov wrote: > I would like to try realize this, better in a separate thread. I don't think that this should be added into the tree, but if you have per-version filtering rules, of course feel free to publish that to the lists. I am sure that

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-27 Thread Anton A. Melnikov
Hello! On 27.12.2022 08:44, Michael Paquier wrote: It is worth noting that perlcritic was complaining here, as eval is getting used with a string. I have spent a few days looking at that, and I really want a maximum of flexibility in the rules that can be applied so I have put a "no critic"

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-26 Thread Michael Paquier
On Mon, Dec 26, 2022 at 09:22:08AM +0300, Anton A. Melnikov wrote: > Made a separate patch for it: v3-0001-Fix-dumps-filtering.patch Well, the thing about this part is that is it is not needed: the same can be achieved with 0002 in place. > Yes, indeed. It will be really simpler. > Made it in

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-25 Thread Anton A. Melnikov
Hello! On 23.12.2022 05:42, Michael Paquier wrote: On Thu, Dec 22, 2022 at 09:59:18AM +0300, Anton A. Melnikov wrote: 2) v2-0002-Additional-dumps-filtering.patch + # Replace specific privilegies with ALL + $dump_contents =~ s/^(GRANT\s|REVOKE\s)(\S*)\s/$1ALL /mgx; This should not

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-25 Thread Michael Paquier
On Fri, Dec 23, 2022 at 12:43:00PM +0300, Anton A. Melnikov wrote: > Sorry, didn't get to see the last letter! No worries, the result is the same :) I was looking at 0002 to add a callback to provide custom filtering rules. + my @ext_filter = split('\/', $_); Are you sure that

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-25 Thread Michael Paquier
On Fri, Dec 23, 2022 at 10:39:25AM -0600, Justin Pryzby wrote: > LGTM. Thanks. Done as of d3c0cc4. -- Michael signature.asc Description: PGP signature

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-23 Thread Michael Paquier
On Fri, Dec 23, 2022 at 10:39:25AM -0600, Justin Pryzby wrote: > On Fri, Dec 23, 2022 at 05:51:28PM +0900, Michael Paquier wrote: >> 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

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-23 Thread Justin Pryzby
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 > >

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-23 Thread Anton A. Melnikov
Sorry, didn't get to see the last letter! On 23.12.2022 11:51, Michael Paquier wrote: 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

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-23 Thread Anton A. Melnikov
Hello! On 23.12.2022 06:27, 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 Touched a bit on how long it takes to execute

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-23 Thread Michael Paquier
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

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-22 Thread Justin Pryzby
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 +

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-22 Thread Michael Paquier
On Thu, Dec 22, 2022 at 09:59:18AM +0300, Anton A. Melnikov wrote: > 2) v2-0002-Additional-dumps-filtering.patch + # Replace specific privilegies with ALL + $dump_contents =~ s/^(GRANT\s|REVOKE\s)(\S*)\s/$1ALL /mgx; This should not be in 0002, I guess.. > Yes. Made a hook that allows

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-21 Thread Anton A. Melnikov
Hello! Divided patch into two parts: first part refers to the modification of the old dump while the second one relates to dump filtering. 1) v2-0001-Remove-aclitem-from-old-dump.patch On 19.12.2022 06:10, Michael Paquier wrote: This is forgetting about materialized views, which is something

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-18 Thread Michael Paquier
On Sun, Dec 18, 2022 at 08:56:48PM -0500, Tom Lane wrote: > "Anton A. Melnikov" writes: >> 2) In 60684dd83 and b5d63824 there are two changes in the set of specific >> privileges. >> The thing is that in the privileges.sql test there is REVOKE DELETE command >> which becomes pair of REVOKE ALL

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-18 Thread Michael Paquier
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 >

Re: [BUG] pg_upgrade test fails from older versions.

2022-12-18 Thread Tom Lane
"Anton A. Melnikov" writes: > 2) In 60684dd83 and b5d63824 there are two changes in the set of specific > privileges. > The thing is that in the privileges.sql test there is REVOKE DELETE command > which becomes pair of REVOKE ALL and GRANT all specific privileges except > DELETE > in the

[BUG] pg_upgrade test fails from older versions.

2022-12-18 Thread Anton A. Melnikov
Hello! Found that pg_upgrade test has broken for upgrades from older versions. This happened for two reasons. 1) In 7b378237a the format of "aclitem" changed so upgrade from <=15 fails with error: "Your installation contains the "aclitem" data type in user tables. The internal format of