Re: Issues with inconsistent COLLATION installation

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: Issues with inconsistent COLLATION installation
Дата
Msg-id 0df13b3e-cc8b-41b7-ab78-487315a28a59@manitou-mail.org
обсуждение исходный текст
Ответ на Issues with inconsistent COLLATION installation  (Cory Nemelka <cnemelka@gmail.com>)
Ответы Re: Issues with inconsistent COLLATION installation
Список pgsql-general
    Cory Nemelka wrote:

> ERROR:  22023: could not create locale "fr_FR.utf8": No such file or
> directory
> DETAIL:  The operating system could not find any locale data for the locale
> name "fr_FR.utf8".
> LOCATION:  report_newlocale_failure, pg_locale.c:1312

I can reproduce this by creating a new locale *after* starting
PostgreSQL and trying to use it before a restart.

Example with Ubuntu 18.04 and Postgres 11.5:

# locale-gen es_ES.utf8
Generating locales (this might take a while)...
  es_ES.UTF-8... done
Generation complete.

Immediately refering to the locale will fail:

$ sudo -u postgres psql -d test -U postgres

test=# create collation es (provider=libc, locale='es_ES.utf8');
ERROR:    could not create locale "es_ES.utf8": No such file or directory
DÉTAIL : The operating system could not find any locale data for the locale
name "es_ES.utf8".


Now restart postgresql

$ sudo /etc/init.d/postgresql restart
[ ok ] Restarting postgresql (via systemctl): postgresql.service.

And now it works:

$ sudo -u postgres psql -d test -U postgres

test=# create collation es (provider=libc, locale='es_ES.utf8');
CREATE COLLATION

test=# select * from pg_collation where collname='es' \gx
-[ RECORD 1 ]-+-----------
collname      | es
collnamespace | 2200
collowner     | 10
collprovider  | c
collencoding  | 6
collcollate   | es_ES.utf8
collctype     | es_ES.utf8
collversion   |


Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite



В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Issues with inconsistent COLLATION installation
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Issues with inconsistent COLLATION installation