-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
postgres fails to start when template database with collation version mismatch is needed at startup #318777
Comments
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nextcloud-failed-to-run-since-recent-update/46938/1 |
Please test #320323 |
I have changed the collation version, as described in my workaround, so I can no longer readily test this. |
I basically do the same as you have described but for every database creation to make sure, it never fails. |
I'll close this now since I don't see anything actionable here. To quote https://www.postgresql.org/docs/current/sql-altercollation.html
This is the case here. This is a manual upgrade step. There are ideas how to do database upgrades here, but as long as we don't have such a mechanism in place, there's nothing we can do. Hence, won't fix. |
Why not make at least an addtional option to the postgresql package. I had this error as well and I totally would like my database to automatically REINDEX ... instead of breaking. It took me some time to fix this for something that shoudn't break on an update, thus making the system not reproducible anymore... |
Well, but the point is, that this should break. Otherwise you have silent corruption. If we can find a way to do this conditionally only on an upgrade, that would be ok. But doing a REINDEX on every start of the database is not. |
I already explained why that's a bad idea and it was outlined why that's happening.
The reason why it breaks instead of giving just a warning is because of ensureDatabases which does a Anyways, there are ideas on how to properly tackle state management for postgresql[2]. As you can see re. the solutions proposed, there's no reasonable way to solve this with the current implementation which is one sign of it being an antipattern. |
Describe the bug
postgresql.service
fails to start when databases are created during startup whiletemplate1
's has a collation version mismatch. Observed with postgresql 15.7.Steps To Reproduce
Steps to reproduce the behavior:
services.roundcube.enable = true
.Expected behavior
Postgresql runs and
roundcube
database gets createdAdditional context
Workaround:
nixos-rebuild switch
, allowing postgres database to startALTER DATABASE template1 REFRESH COLLATION VERSION
viapsql
Notify maintainers
@thoughtpolice @danbst @globin @ivan @Ma27 @wolfgangwalther
Metadata
The text was updated successfully, but these errors were encountered: