postgresql/src/bin/pg_upgrade
Michael Paquier afa09e4a9a Fix tests of pg_upgrade across different major versions
This fixes a set of issues that cause different breakages or annoyances
when using pg_upgrade's test.sh to do upgrades across different major
versions:
- test.sh is completely broken when using v14 as new version because of
the removal of testtablespace/ as Makefile rule.  Older versions of
pg_regress don't support --make-tablespacedir, blocking the creation of
the tablespace.  In order to fix that, it is simple enough to create
those directories in the script itself, but only do that when an old
version is involved.  This fix is needed on HEAD and REL_14_STABLE.
- The script would fail when using PG <= v11 as old version because of
WITH OIDS relations not supported in v12.  In order to fix this, this
steals a method from the buildfarm that uses a DO block to change all
the relations marked as WITH OIDS, allowing pg_upgrade to pass.  This is
more portable than using ALTER TABLE queries on the relations causing
issues.  This is fixed down to v12, and authored originally by Andrew
Dunstan.
- Not using --extra-float-digits=0 with v11 as old version causes
a lot of diffs in the dumps, making the whole unreadable.  This gets
only done when using v11 as old version.  This is fixed down to v12.
The buildfarm code uses that already.

Note that the addition of --wal-segsize and --allow-group-access breaks
the script when using v10 or older at initdb time as these got added in
11.  10 would be EOL'd next year and nobody has complained about those
problems yet, so nothing is done about that.  This means that this
commit fixes upgrade tests using test.sh with v11 as minimum older
version, up to HEAD, and that it is enough to apply this change down to
12.  The old and new dumps still generate diffs, still require manual
checks, and more could be done to reduce the noise, but this allows the
tests to run with a rather minimal amount of them.

I have tested this commit and test.sh with v11 as minimum across all the
branches where this is applied.  Note that this commit has no impact on
the normal pg_upgrade test run with a simple "make check".

Author:  Justin Pryzby, Andrew Dunstan, Michael Paquier
Discussion: https://postgr.es/m/20201206180248.GI24052@telsasoft.com
Backpatch-through: 12
2021-10-13 09:22:49 +09:00
..
po Translation updates 2021-08-09 12:36:42 +02:00
.gitignore Ignore file generated during pg_upgrade testing 2018-04-30 12:39:29 -04:00
check.c pg_upgrade: warn about extensions that need updating 2021-08-03 11:58:15 -04:00
controldata.c pg_resetxlog: add option to set oldest xid & use by pg_upgrade 2021-07-26 22:38:14 -04:00
dump.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
exec.c pg_upgrade; change major version comparisons to use <=, not < 2020-10-06 12:12:09 -04:00
file.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
function.c pg_upgrade; change major version comparisons to use <=, not < 2020-10-06 12:12:09 -04:00
IMPLEMENTATION Fix wording in pg_upgrade docs 2017-05-05 12:42:21 +02:00
info.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
Makefile Un-break pg_upgrade regression test. 2019-05-21 23:51:19 -04:00
nls.mk Translation updates 2020-11-09 12:36:44 +01:00
option.c Document the pg_upgrade -j/--jobs option as taking an argument 2020-02-11 23:53:40 +01:00
parallel.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_upgrade.c pg_resetxlog: add option to set oldest xid & use by pg_upgrade 2021-07-26 22:38:14 -04:00
pg_upgrade.h pg_upgrade: warn about extensions that need updating 2021-08-03 11:58:15 -04:00
relfilenode.c pg_upgrade: remove pre-8.4 code and >= 8.4 check 2020-10-06 14:31:21 -04:00
server.c pg_upgrade; change major version comparisons to use <=, not < 2020-10-06 12:12:09 -04:00
tablespace.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
test.sh Fix tests of pg_upgrade across different major versions 2021-10-13 09:22:49 +09:00
TESTING Update stale comments, and fix comment typos. 2019-06-08 10:12:26 -07:00
util.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
version.c C comment: correct heading of extension query 2021-08-03 12:26:08 -04:00