-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uninstall and reinstall for upgrades #397
Comments
@dvarrazzo @Melkij @za-arthur Do you have any insight into why this statement is in the documentation, or if it can be removed? |
Since we don't support scripts for |
Looked through the changes. Are there any fundamental incompatible changes which prevent an upgrade? |
What would be use case for an update script? It could be necessary in case if pg_repack would create types or functions, on which other DB objects could depend on, or if pg_repack would create relations with data, which need to be preserved. |
The update script doesn't have to do anything, if there is no changes in the data types or views or tables. |
Only upgrade scripts? (some releases will be no-op because the sql interface rarely changed) I don't mind making support for alter extension .. update if we continue to require repack.version() check. Otherwise, support and somehow test with another version of the extension (SQL representation) or another version of the loadable module (with SQL representation from another version)... Many surprises without obvious benefit. |
No, that's a lot of work, and not necessary at all. Just enabling upgrades, and not forcing a reinstall. |
Ok, soons good. I just realized that we won’t have empty scripts: we need to update |
There were reasons, which now I don't remember, for which it was advisable to get the version from a version in the schema rather than from the extension metadata. Making the extension upgradeable requires work because you need to provide an upgrade path, even if the diff is nil. If there is no change between 1.0.0 and 1.0.1 and a change in 1.0.2, you still need to provide a 1.0.0--1.0.1 file otherwise you can't go from 1.0.0 to 1.0.2. pg_repack is a stateless extension and no object will depend on it. Dropping and re-creating it is the easiest way to upgrade it. |
Well, one obvious-ish consideration is that we want to check if the sql is consistent with the c, and the extension version is neither of the two... |
The main reason for version_sql(), I think, was that pg_extension and repack.version() is indeed needed to check the actual version of the library. |
We can provide these version upgrades for compatible upgrades, going forward. As long as the functions don't change, it's a relatively small file anyway. And we can integrate upgrade tests, I think I have some code for that somewhere. |
What would be the advantage of providing an upgrade feature for this extension? |
Not forcing users to uninstall and reinstall the extension. |
In my opinion it is a viable upgrade path: it has the advantage that it can't go wrong, whereas allowing upgrade can make the installed resources diverge in many ways. It is easier to maintain, and it causes no problem for end users. |
Except that users need to uninstall and reinstall it. And that is not how other extensions work in PostgreSQL. This is not easy to maintain. |
Currently the documentation states:
Figure out if that is necessary, or still necessary. Or if it can be removed.
The text was updated successfully, but these errors were encountered: