pgsql: Move into separate file all the SQL queries used in pg_upgrade t - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Move into separate file all the SQL queries used in pg_upgrade t
Date
Msg-id E1msayZ-0001fW-2y@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Move into separate file all the SQL queries used in pg_upgrade tests

The existing pg_upgrade/test.sh and the buildfarm code have been holding
the same set of SQL queries when doing cross-version upgrade tests to
adapt the objects created by the regression tests before the upgrade
(mostly, incompatible or non-existing objects need to be dropped from
the origin, perhaps re-created).

This moves all those SQL queries into a new, separate, file with a set
of \if clauses to handle the version checks depending on the old version
of the cluster to-be-upgraded.

The long-term plan is to make the buildfarm code re-use this new SQL
file, so as committers are able to fix any compatibility issues in the
tests of pg_upgrade with a refresh of the core code, without having to
poke at the buildfarm client.  Note that this is only able to handle the
main regression test suite, and that nothing is done yet for contrib
modules yet (these have more issues like their database names).

A backpatch down to 10 is done, adapting the version checks as this
script needs to be only backward-compatible, so as it becomes possible
to clean up a maximum amount of code within the buildfarm client.

Author: Justin Pryzby, Michael Paquier
Discussion: https://postgr.es/m/20201206180248.GI24052@telsasoft.com
Backpatch-through: 10

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0df9641d39057f431655b92b8a490b89c508a0b3

Modified Files
--------------
src/bin/pg_upgrade/test.sh           | 52 ++-------------------
src/bin/pg_upgrade/upgrade_adapt.sql | 91 ++++++++++++++++++++++++++++++++++++
2 files changed, 96 insertions(+), 47 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Add TAP tests for contrib/sslinfo
Next
From: Michael Paquier
Date:
Subject: pgsql: pg_waldump: Emit stats summary when interrupted by SIGINT