Implement extension requirements support. (#400)
This option allows specifying which version of an extension to install on
the target database. The version might be different from the version on the
source, and in some cases installing the default version of an extension is
not desired. Examples are PostGIS v2 and v3 series, for instance.
A requirement file in JSON can be given to pgcopydb commands. The JSON file
should be an array of objects with the "name" and "version" keys, and can be
given to either of these commands:
pgcopydb copy extensions --requirements requirements.json
pgcopydb clone ... --requirements requirements.json
To list the available extension versions on the target database use the
following commands:
pgcopydb list extension --available-versions
pgcopydb list extension --available-versions --json
pgcopydb list extension --requirements
pgcopydb list extension --requirements --json
The last command will output all the extensions available on the target
database with their default version. It's then possible to edit the output
file and change the version numbers before giving it back to the copy and
clone commands.
parent
433d4cfe
Please register or sign in to comment