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

PostgreSQL 17 #4231

Merged
merged 1 commit into from
Sep 29, 2024
Merged

PostgreSQL 17 #4231

merged 1 commit into from
Sep 29, 2024

Conversation

swiffer
Copy link
Contributor

@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

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
Collaborator

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
Contributor Author

swiffer commented Sep 28, 2024

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

module.nix Outdated Show resolved Hide resolved
@swiffer
Copy link
Contributor Author

swiffer commented Sep 29, 2024

@JakobLichterfeld - ready for review

@JakobLichterfeld
Copy link
Collaborator

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
Collaborator

@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
10 checks passed
@swiffer swiffer deleted the postgres-17 branch September 29, 2024 16:29
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