Skip to content

Conversation

@swiffer
Copy link
Collaborator

@swiffer swiffer commented Sep 28, 2024

PostgreSQL 17 is mentioning a change in how functions are using search_path. "Functions used by expression indexes and materialized views that need to reference non-default schemas must specify a search path during function creation."

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=2af07e2f7

OOTB earthdistance is not specifying a search path causing migration failures as earth_box and ll_to_earth have been used in indexes (they aren't any longer).

Therefore:

  • change the migrations executed in the past to allow setup & testsuite to complete when using PostgreSQL 17

And as last indexes involing ll_to_earth / earth_box have been dropped in 20200502140646_drop_unused_indexes.exs / 20191007105010_add_new_fkey_indexes.exs:

  • Add a new migration that drops and recreates the extensions so we ensure they are not manipulated any longer (20191008191431_fix_ll_to_earth.exs)
  • rework Backup & Restore, as ll_to_earth is not used in indexes anymore the SQL used there is not needed

Updated Solution is taken from here (Adrian mentioned this issue back in 2019 as well):

Next to upgrading to PostgreSQL 17 I changed / updated some install docs as well to stay in line with currently supported / recommended versions of Grafana & Postgres.

Updated Restore instructions have been tested successfully on my instance.

PostgreSQL issue discussion: https://postgrespro.com/list/thread-id/2377019

@netlify
Copy link

netlify bot commented Sep 28, 2024

Deploy Preview for teslamate ready!

Name Link
🔨 Latest commit 16fe7aa
🔍 Latest deploy log https://app.netlify.com/sites/teslamate/deploys/66f8f8b9d15d770008829480
😎 Deploy Preview https://deploy-preview-4231--teslamate.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@JakobLichterfeld
Copy link
Member

I have read about it as well. I do like the new incremental backups' functionality.

@JakobLichterfeld JakobLichterfeld added enhancement New feature or request dependencies Pull requests that update a dependency file labels Sep 28, 2024
@swiffer
Copy link
Collaborator Author

swiffer commented Sep 28, 2024

yes, running on pg17 locally without any problems but see tests failing in the pipeline now 😬

@swiffer
Copy link
Collaborator Author

swiffer commented Sep 29, 2024

@JakobLichterfeld - ready for review

@JakobLichterfeld
Copy link
Member

Thanks!

We will handle postgres in nix installs in #4227

Next to upgrading to PostgreSQL 17 I changed / updated some install docs as well to stay in line with currently supported / recommended versions of Grafana & Postgres.

Not sure if PostgreSQL 17 is available on freebsd for examle but we can keep it this way.

Updated Restore instructions have been tested successfully on my instance.

I do love the reduction of commands needed.

Copy link
Member

@JakobLichterfeld JakobLichterfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your efforts!

@JakobLichterfeld JakobLichterfeld merged commit c67573e into teslamate-org:master Sep 29, 2024
@swiffer swiffer deleted the postgres-17 branch September 29, 2024 16:29
@swiffer
Copy link
Collaborator Author

swiffer commented Oct 6, 2024

As docs have been published already and users start installing with PostgreSQL 17 (https://tff-forum.de/t/teslamate-erfahrungs-und-datenthread/84179/2824?u=spongyhat) we should aim for a release soon. Guess you want to finish #4219 first?

@parkr parkr mentioned this pull request Oct 19, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants