Skip to content
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

Uninstalling old pgsphere to install new pgsphere #7

Open
esabol opened this issue Jan 11, 2018 · 1 comment
Open

Uninstalling old pgsphere to install new pgsphere #7

esabol opened this issue Jan 11, 2018 · 1 comment

Comments

@esabol
Copy link

esabol commented Jan 11, 2018

I recently upgraded our PostgreSQL database from 9.2 to 10.1, and I experienced various issues as a result of having installed the old (pre-extension) version of pgsphere. CREATE EXTENSION pg_sphere; failed because the datatypes and functions already existed. The only solution I could find was to DROP all the pgsphere datatypes/functions/etc. with CASCADE first, then pg_upgrade, and then CREATE EXTENSION pg_sphere; would work.

I don't know if that's an issue for anyone else. If it is, maybe this SQL file will save someone some time:

pgsphere_uninstall.txt

@ghost ghost self-assigned this Jan 11, 2018
@ghost
Copy link

ghost commented Jan 11, 2018

Well, it is certainly an issue for quite a few people. Thanks to help from @akorotkov, I have working scripts for an adapted version of PgSphere that runs behind http://dc.g-vo.org -- they allow a proper upgrade via
CREATE EXTENSION pg_sphere FROM unpackaged;
In this way, all data types, tables, and indexes will be preserved. Only a couple of somehow buggy operator definitions (they have been fixed a long time ago by @pdowler) will be dropped with CASCADE (ALTER OPERATOR lacks the ability to change certain things) and recreated via FROM unpackaged.

Expect a respective commit here sometime soon™.

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

No branches or pull requests

1 participant