a month ago
I have the following warning message constantly in my deployment logs โ WARNING: database "railway" has a collation version mismatch
Following connecting to the database through the terminal and executing commands to upgrade or rebuild, the terminal reports no change in version, and the warning is not resolved.
Perhaps I am attempting to resolve this in an incorrect way?
I am working on Windows through GitBash.
9 Replies
a month ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
a month ago
For reference, trying the previously mentioned command:
ALTER DATABASE railway REFRESH COLLATION VERSION;
REINDEX DATABASE railway;
Was unsuccessful
jamesmparry87
For reference, trying the previously mentioned command:ALTER DATABASE railway REFRESH COLLATION VERSION;REINDEX DATABASE railway;Was unsuccessful
a month ago
Hey, another approach that will certainly work, is to pg_dump your current database and restore it to a new one. This way you will have a new healthy database with all the data you previously had and ready to be used. The old one can then be deleted once you have updated your services to point to the new database.
a month ago
Do you have any docs for how to do that? Or is it a single command?
jamesmparry87
Do you have any docs for how to do that? Or is it a single command?
a month ago
Hey, it would be two commands you would have to execute, pg_dump to dump your database and pg_restore or psql (if you dump it as sql) to restore it. Dumping and restoring your database can be as easy as runningpg_dump '[DATABASE_URL_ORIGIN]' --no-owner --no-privileges > dump.sql and psql '[DATABASE_URL_DESTINATION]' -f dump.sql. Please follow the Railway blog for the installation of the required psql CLI.
a month ago
Thanks uxuz, I'll give it a try and report back. It sounds a bit scary as it feels like something which would make you lose data, but since you specifically called out that I will have all the data I previously had it shouldn't be a problem. Fingers crossed 
a month ago
Unfortunately that approach didn't work effectively, although it did lead me to trying the original ALTER DATABASE railway REFRESH COLLATION VERSION; command and it worked this time so at least the issue is resolved. Thank you for the support.
jamesmparry87
Unfortunately that approach didn't work effectively, although it did lead me to trying the original ALTER DATABASE railway REFRESH COLLATION VERSION; command and it worked this time so at least the issue is resolved. Thank you for the support.
a month ago
Hey, do you mind elaborating on why the backup and restore didn't work effectively?
Status changed to Solved uxuz โข about 1 month ago
