My replicated database warns about a collation version mismatch, how seriously should I take it?
I replicated a database onto a new host. Everything appears to work, but connecting to it prints a warning that the database was created with one collation version while the operating system now provides a different one, and advises rebuilding all objects using the default collation.
The database functions normally as far as I can tell, which makes it tempting to ignore.
What is actually at risk here, and what does rebuilding involve?
@postgres_polat · last mo. · 3 replies
The remedy is to rebuild the affected indexes and then tell the database that the version is now current.
In practice:
Step 3 alone makes the message go away and fixes nothing. That is the shortcut people find and it converts a visible warning into an invisible problem. If you do only one of the steps, do step 2.
Also worth checking constraints and partitions, since unique constraints and range partitioning on text both depend on the same ordering.
Reply
Report
@reindex_at_3am · 3w ago · 2 replies
Did this on a database large enough that it mattered, so the practical warning: rebuilding text indexes is not a quick operation and the plain version takes write locks.
Plan it as maintenance rather than fitting it in. There is a concurrent variant that avoids the locking and takes considerably longer, and picking it at 3am because you did not check first is how a one hour job becomes an outage.
Reply
Report
@postgres_polat · 3w ago
Yes, and take the backup first is not boilerplate here. A rebuild that fails partway leaves you with indexes in mixed states.
Reply
Report