-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Fix broken function renames #87
Conversation
e726018
to
92e8f05
Compare
Due to mishandling of C-level renames in previous releases, this upgrade attempts to align user-installations as much as possible by copying the full-install script in its entirety (except casts/operators/etc)
@Komzpa + @mngr777: I went with a combination of your suggestions, which will be to stub out old C-functions and do an In order to align user-installations as much as possible I've copied almost the entire installation script into the next upgrade (except types/casts/operators/operator classes). This makes also the new test pass. How do you feel about this approach? |
Forgot to remove reference to PostGIS in the copied code - oops! Co-authored-by: Darafei Praliaskouski <me@komzpa.net>
Functions and casts that are supposed to be dropped by
Trying to drop a function manually:
The dependency has to be removed first:
Strangely,
@Komzpa your expertise is needed again. I only found an example in PostGIS auto-generated update file
|
Upgrade scripts running in ALTER EXTENSION contexts glue and unglue the functions to extensions automatically, you are not supposed to run the extensions upgrade scripts manually - in this case indeed you need to attach/detach functions manually. If you moved some functions between extensions, I don't know how to do that starting PG15 anymore - previously you could unpackage the functions and then CREATE EXTENSION FROM unpackaged; now it is forbidden for security reasons. So drop & create new. Probably some drops are just lost in the upgrade script? PostGIS has weird upgrade scripts that need to account for many kinds of broken installs fixed by drunk monkeys, so upgrading from the state where someone removed a function that was supposed to be there should be supported, that's why the weird construct. |
I just had some update files left in Postgres extension directory. |
Thanks for the input, I've released a new version that should fix the broken functions. |
Thanks to @Komzpa and @mngr777 I finally know how to properly handle C-level function renames.
Previously we went back and altered the upgrade-scripts (so the rest of the tests could pass), but in hindsight that was a bad idea.
This PR tries to restore the upgrade-scripts, and adds stub C functions (inspired by postgis) instead.
At this point, user installations could be in pretty different states, which should be taken into account.
I've started out with a simple commit with a failing test, exposing the issue. I'll need to create the proper upgrade script as well.
Closes #86.
Closes #47.