pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Compare only major versions in AdjustUpgrade.pm 2+ messages / 1 participants [nested] [flat]
* pgsql: Compare only major versions in AdjustUpgrade.pm @ 2023-07-24 15:23 Alvaro Herrera <alvherre@alvh.no-ip.org> 0 siblings, 0 replies; 2+ messages in thread From: Alvaro Herrera @ 2023-07-24 15:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Compare only major versions in AdjustUpgrade.pm Because PostgreSQL::Version is very nuanced about development version numbers, the comparison to 16beta2 makes it think that that release is older than 16, therefore applying a database tweak that doesn't work there (the comparison is only supposed to match when run on version 15). As suggested by Andrew Dunstan, fix by having AdjustUpgrade.pm public methods create a separate PostgreSQL::Version object to use for these comparisons, that only carries the major version number. While at it, have the same methods ensure that the objects given are of the expected type. Backpatch to 16. This module goes all the way back to 9.2, but there's probably no need for this fix except where betas still live. Co-authored-by: Andrew Dunstan <andrew@dunslane.net> Discussion: https://postgr.es/m/20230719110504.zbu74o54bqqlsufb@alvherre.pgsql Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/6061adedf53cbe0f94a52dd02465abf8c7c9fb43 Modified Files -------------- src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Compare only major versions in AdjustUpgrade.pm @ 2023-07-24 15:23 Alvaro Herrera <alvherre@alvh.no-ip.org> 0 siblings, 0 replies; 2+ messages in thread From: Alvaro Herrera @ 2023-07-24 15:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Compare only major versions in AdjustUpgrade.pm Because PostgreSQL::Version is very nuanced about development version numbers, the comparison to 16beta2 makes it think that that release is older than 16, therefore applying a database tweak that doesn't work there (the comparison is only supposed to match when run on version 15). As suggested by Andrew Dunstan, fix by having AdjustUpgrade.pm public methods create a separate PostgreSQL::Version object to use for these comparisons, that only carries the major version number. While at it, have the same methods ensure that the objects given are of the expected type. Backpatch to 16. This module goes all the way back to 9.2, but there's probably no need for this fix except where betas still live. Co-authored-by: Andrew Dunstan <andrew@dunslane.net> Discussion: https://postgr.es/m/20230719110504.zbu74o54bqqlsufb@alvherre.pgsql Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/28ce9d51f9082318e84f2a84385871394dcf2130 Modified Files -------------- src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2023-07-24 15:23 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-07-24 15:23 pgsql: Compare only major versions in AdjustUpgrade.pm Alvaro Herrera <alvherre@alvh.no-ip.org> 2023-07-24 15:23 pgsql: Compare only major versions in AdjustUpgrade.pm Alvaro Herrera <alvherre@alvh.no-ip.org>
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