tianon / docker-postgres-upgrade

a PoC for using "pg_upgrade" inside Docker -- learn from it, adapt it for your needs; don't expect it to work as-is!
https://hub.docker.com/r/tianon/postgres-upgrade/
MIT License
1.09k stars 116 forks source link

Docker image should run pg_upgrade's generated update_extension.sql file when present #69

Closed davidandreoletti closed 1 year ago

davidandreoletti commented 2 years ago

Issue: When update_extension.sql is generated, docker-postures-upgrade's script does not run the file automatically, while I was expecting to since built-in Postgres extensions are easy to upgrade with the generated sql file.

If this is beyond the intended scope of the project, let me know.

Command:

docker run --rm \
    -v ....
        -v ....
    tianon/postgres-upgrade:12-to-15

Output

....
Performing Upgrade
------------------
...
Creating script to delete old cluster                       ok
Checking for extension updates                              notice

Your installation contains extensions that should be updated
with the ALTER EXTENSION command.  The file
    update_extensions.sql.                             <<<<<<<<<<< HERE
when executed by psql by the database superuser will update
these extensions.
...
yosifkit commented 1 year ago

"a PoC for using "pg_upgrade" inside Docker -- learn from it, adapt it for your needs; don't expect it to work as-is!"

I'm sure a PR to help others wouldn't be turned away though.

tianon commented 1 year ago

Yeah, I intentionally haven't touched extensions here because my understanding is that many/most of them will require additional "care and feeding" to handle correctly (not the least of which is going to be installing them on both versions of PostgreSQL correctly, I think :see_no_evil:).