Ola Juliano

a primeira coisa que faria antes e ir no /etc/sysconfig/i18n e trocar
LANG=en.UTF8 para LANG=pt_BR ou LANG=pt_BR.ISO-8859-1

[]s
Luiz
----- Original Message ----- 
From: Juliano
To: Comunidade PostgreSQL Brasileira
Sent: Wednesday, October 07, 2009 5:23 PM
Subject: Re: [pgbr-geral] Bancos com Encoding Difentes no Mesmo Cluster


Já havia tentado isso antes também:

postgres=# CREATE DATABASE latino ENCODING 'latin1' TEMPLATE=template0;
ERROR:  encoding LATIN1 does not match locale en_US.UTF-8
DETAIL:  The chosen LC_COLLATE setting requires encoding UTF8.


--- Em qua, 7/10/09, Osvaldo Kussama <[email protected]> escreveu:


De: Osvaldo Kussama <[email protected]>
Assunto: Re: [pgbr-geral] Bancos com Encoding Difentes no Mesmo Cluster
Para: "Comunidade PostgreSQL Brasileira"
<[email protected]>
Data: Quarta-feira, 7 de Outubro de 2009, 17:13




2009/10/7 Juliano <[email protected]>

Boa tarde a todos.

Eu simplesmente gostaria de poder criar bancos com encoding UTF-8 e LATIN1
em um mesmo cluster.
Sei que o assunto já foi muito debatido, mas pelo que vi dos casos
referentes a ENCODING (pesquisei li todos até aqui) e testei sem sucesso :(
Estou usando a versão 8.4 com o Ubuntu Server 9.04.

Criei o cluster com o comando:

initdb -E utf8

Exibição inicial dos bancos:


\l
                           List of databases
   Name    | Owner | Encoding |  Collation  | Ctype | Access privileges
-----------+-------+----------+-------------+-------+-------------------
 postgres  | own   | UTF8     | en_US..UTF-8 | C     |
 template0 | own   | UTF8     | en_US.UTF-8 | C     | =c/dba
                                                    : dba=CTc/dba
 template1 | own   | UTF8     | en_US.UTF-8 | C     | =c/dba
                                                    : dba=CTc/dba

Tentativa frustrada:

postgres=# CREATE DATABASE latino ENCODING 'latin1';
ERROR:  encoding LATIN1 does not match locale en_US.UTF-8
DETAIL:  The chosen LC_COLLATE setting requires encoding UTF8.
STATEMENT:  CREATE DATABASE latino ENCODING 'latin1';
ERROR:  encoding LATIN1 does not match locale en_US.UTF-8
DETAIL:  The chosen LC_COLLATE setting requires encoding UTF8.

Estou ciente de que as novas versões estão desoneradas de fazer esse tipo de
tratamento deixando isso para o Sistema Operacional e seguem abaixo os
comandos de locale:

#locale

LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE=C
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=


#locale -a

C
en_US.iso88591
en_US.utf8
POSIX
pt_BR.iso88591
pt_BR.utf8

"For C or POSIX locale, any character set is allowed, but for other locales
there is only one character set that will work correctly."

Já tentei o que diz acima também e não deu certo..
Desde já agradeço.





Tente usar a opção:

TEMPLATE=template0Veja
em:http://www.postgresql.org/docs/current/interactive/multibyte.html"CREATE
DATABASE korean WITH ENCODING 'EUC_KR' LC_COLLATE='ko_KR.euckr'
LC_CTYPE='ko_KR.euckr' TEMPLATE=template0; Notice that the above commands
specify copying the template0 database. When copying any other database, the
encoding and locale settings cannot be changed from those of the source
database, because that might result in corrupt data."Osvaldo

-----Anexo incorporado-----


_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral




Veja quais são os assuntos do momento no Yahoo! + Buscados: Top 10 -
Celebridades - Música - Esportes



_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a