Specify database as part of extensions upgrade
Without this the line errors out if not using default database, or database name the same as user name.
I am pretty sure this is wrong. if you have multiple databases with different extensions, they would not be correctly updated with your patch as it would only target one of them.
can you show the generated update_extensions.sql on your side and maybe explain more about the error? compose file is also hopeful and some information about the databases in your instance.
The issue is that psql tries to connect to the default database and then the database with the name of the specified user. If neither exist it just errors out.
In my case, my generated update_extensions.sql only contains:
ALTER EXTENSION pgcrypto UPDATE
ok, but I think then we should rather adjust our strategy to upgrade extensions by finding outdated ones in each database using SELECT * FROM pg_available_extensions WHERE default_version <> installed_version;.
Unless i'm mistaken isn't update_extensions auto generated?