• Michael Paquier's avatar
    Move into separate file all the SQL queries used in pg_upgrade tests · b6dac98b
    Michael Paquier authored
    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
    b6dac98b
upgrade_adapt.sql 2.81 KB