Re: ERROR: new collation (en_US.UTF-8) is incompatible with the collation of the template database (en_US.utf-8)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomas Pospisek <tpo2(at)sourcepole(dot)ch>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: ERROR: new collation (en_US.UTF-8) is incompatible with the collation of the template database (en_US.utf-8)
Date: 2022-06-22 23:26:29
Message-ID: 3696626.1655940389@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tomas Pospisek <tpo2(at)sourcepole(dot)ch> writes:
> On 22.06.22 21:25, Adrian Klaver wrote:
>> On 6/22/22 12:17, Tomas Pospisek wrote:
>>> If I `pg_dump --create` some DB on the new server (13.7-1.pgdg18.04+1)
>>> I get:
>>>
>>>      CREATE DATABASE ... ENCODING = 'UTF8' LOCALE = 'en_US.utf-8';
>>>
>>> When I do the same on the old server (12.8-1.pgdg20.04+1) I get:
>>>
>>>      CREATE DATABASE ... ENCODING = 'UTF8' LC_COLLATE = 'en_US.UTF-8'
>>> LC_CTYPE = 'en_US.UTF-8';

>> Are dumping/restoring from one version of Postgres to another?

> Yes, indeed!

This is probably more about dumping from different operating systems.
The spelling of the locale name is under the control of the OS,
and Postgres doesn't know very much about the semantics of it
(so I think we conservatively assume that any difference in
spelling is significant).

Best bet might be to edit the dump file to adjust the locale
spellings to match your new system.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2022-06-23 02:51:38 Re: Tuning a query with ORDER BY and LIMIT
Previous Message Tom Lane 2022-06-22 23:22:13 Re: Tuning a query with ORDER BY and LIMIT