SUSE Support

Here When You Need Us

Postgresql migration from 9.6 to 10 fails

This document (7023640) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Manager 3.2

Situation

While running /usr/lib/susemanager/bin/pg-migrate-96-to-10.sh on SUSE Manager 3.2 / SLES12 SP3, the migration fails with error:

encodings for database "postgres" do not match:  old "UTF8", new "LATIN1" Failure, exiting
Upgrading database to version 10 failed!

Resolution

Following workaround can be used, until the fix is released for SUSE Manager :

Change line 88 of script "/usr/lib/susemanager/bin/pg-migrate-96-to-10.sh" :

Before : 
su -s /bin/bash - postgres -c "initdb -D /var/lib/pgsql/data"

After :
su -s /bin/bash - postgres -c "initdb -D /var/lib/pgsql/data --locale=en_US.UTF-8"

The change simply enforces using the correct locale and encoding settings for the new database. Following this, please remove the directory containing the incorrectly initialized database :

rm -rf /var/lib/pgsql/data-new-failed

Then, once again call the migration script, and this time the migration should work.

Cause

Encoding of the system has been changed from UTF8 to LATIN1. 
The new database needs to use the same encoding as before, so we are seeing this failure. 
There are measures in place to ensure that always UTF8 encoding is being used, 
but due to some flaw in the logic for now this only works correctly for the initial database creation.

Additional Information


Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7023640
  • Creation Date: 15-Jan-2019
  • Modified Date:03-Mar-2020
    • SUSE Manager

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.