Encontrei o erro que cometi no seguinte comando:
Comando errado:
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
Comando correto:
localedef -v -c -i en_US -f utf8 en_US.UTF-8
Ontem à noite houve falha de energia e o sistema foi desligado.
Quando o sistema foi declarado de manhã, o servidor de banco de dados do PostgreSQL não pôde iniciar.
Enquanto observa o arquivo pgstartup.log, as seguintes linhas foram encontradas.
< 2017-01-23 15:26:17.577 IST >DETAIL: The database was initialized with LC_COLLATE "en_US.UTF-8", which is not recognized by setlocale().
< 2017-01-23 15:26:17.577 IST >HINT: Recreate the database with another locale or install the missing locale.
Ficou claro que o local requerido pelo PostgreSQL (en_US.UTF-8) não estava disponível no sistema.
eu também verifiquei cruzando executando o comando locale, aqui está a saída.
$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=
enquanto pesquisava na internet, descobri que posso criar o local ausente usando o seguinte comando.
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
No entanto, quando executo esse comando, ele falha com o seguinte erro:
$ sudo localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
[sudo] password for anil:
/usr/share/i18n/locales/en_US:7: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:8: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:9: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:11: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:14: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:15: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:16: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:17: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:19: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:20: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:21: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:22: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:23: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:24: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:25: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:26: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:27: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:28: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:29: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:34: non-symbolic character value should not be used
/usr/share/i18n/locales/en_GB:50: non-symbolic character value should not be used
/usr/share/i18n/locales/i18n:1425: non-symbolic character value should not be used
/usr/share/i18n/locales/i18n:1674: non-symbolic character value should not be used
/usr/share/i18n/locales/i18n:1719: non-symbolic character value should not be used
/usr/share/i18n/locales/i18n:1756: non-symbolic character value should not be used
/usr/share/i18n/locales/en_GB:53: non-symbolic character value should not be used
/usr/share/i18n/locales/en_GB:59: non-symbolic character value should not be used
/usr/share/i18n/locales/en_GB:152: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:40: non-symbolic character value should not be used
/usr/share/i18n/locales/iso14651_t1:3: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:10: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:11: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:12: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:13: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:14: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:15: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:16: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:17: non-symbolic character value should not be used
LC_NAME: field 'name_gen' not defined
LC_IDENTIFICATION: field 'audience' not defined
LC_IDENTIFICATION: field 'application' not defined
LC_IDENTIFICATION: field 'abbreviation' not defined
LC_IDENTIFICATION: no identification for category 'LC_MEASUREMENT'
LC_CTYPE: table for class "upper": 1756 bytes
LC_CTYPE: table for class "lower": 1756 bytes
LC_CTYPE: table for class "alpha": 4320 bytes
LC_CTYPE: table for class "digit": 600 bytes
LC_CTYPE: table for class "xdigit": 600 bytes
LC_CTYPE: table for class "space": 856 bytes
LC_CTYPE: table for class "print": 5976 bytes
LC_CTYPE: table for class "graph": 5976 bytes
LC_CTYPE: table for class "blank": 856 bytes
LC_CTYPE: table for class "cntrl": 664 bytes
LC_CTYPE: table for class "punct": 4824 bytes
LC_CTYPE: table for class "alnum": 4320 bytes
LC_CTYPE: table for class "combining": 3152 bytes
LC_CTYPE: table for class "combining_level3": 2832 bytes
LC_CTYPE: table for map "toupper": 16924 bytes
LC_CTYPE: table for map "tolower": 15388 bytes
LC_CTYPE: table for map "totitle": 16924 bytes
LC_CTYPE: table for width: 26712 bytes
$
Ainda não encontrei nenhuma solução para esse erro.
Detalhes do Env:
$ uname -r
2.6.32-573.18.1.el6.x86_64
Todos os locais do en_US:
$ locale -a | grep en_US
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
en_US
en_US.iso88591
en_US.iso885915
en_US.utf8
Tags locale postgresql glibc centos