Skip to content

Conversation

@xanather
Copy link

Without this the line errors out if not using default database, or database name the same as user name.

@andyundso
Copy link
Member

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.

@xanather
Copy link
Author

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

@andyundso
Copy link
Member

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;.

@xanather
Copy link
Author

Unless i'm mistaken isn't update_extensions auto generated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants