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

Upgrading Timescale extension from 2.8.1 to version 2.11.1 fails when the scripts are installed. #34

Open
expaso opened this issue Jul 13, 2023 · 2 comments

Comments

@expaso
Copy link

expaso commented Jul 13, 2023

When these scripts are installed, the upgrade of the timescale extension fails with:

cannot drop _timescaledb_catalog.dimension_slice because it depends on function public.get_dimension_details(regclass)
Same error for the views: public.chunks_tstz and public.chunks_ts

This is rather nasty for me, since I don't know if users have timescaledb-extra's installed or not, and I do unsupervised upgrade.

For now, I drop these function if they exist before upgrade, but I found it worth mentioning because there may be more elegant solutions.

@xbarra
Copy link

xbarra commented Nov 28, 2024

since the PR was merged, can this issue be closed?

@expaso
Copy link
Author

expaso commented Dec 2, 2024

No unfortunately not.

I worked around the issue in a nasty way by dropping the objects prematurely before upgrading, which forces my user te reinstall the scripts afterwards.

But the rootcause still remains: Installing TimescaleDb-Extra's breaks the normal update procedure of TimescaleDb,
because your scripts depend on timesacle-db tables/views that could be dropped and recreated by the timescaledb updater.

Perhaps you could use something like Query-Language functions? (https://www.postgresql.org/docs/current/xfunc-sql.html)
That will prevent Postgres from tracking hard dependencies..
It won't work for your views, unless you base those views on Query Language functions...

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

No branches or pull requests

2 participants