Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Issues change to locale Portguese_Brasil.1252

Posted on 2012-03-30
6
1,245 Views
Last Modified: 2012-08-14
Hi,

Is possible change default COLLATE/CTYPE  to Portugese_Brazil.1252 ?  I am using Centos6 with Postgres 9.1 in this installation of Postgres has only these locales installed.
 
pt_BR
pt_BR.iso88591
pt_BR.utf8
pt_PT
pt_PT@euro
pt_PT.iso88591
pt_PT.iso885915@euro
pt_PT.utf8

Are there some diference between  Portuguese_Brazil.1252 with others existent  locales

Thanks.
0
Comment
Question by:aspenbr
  • 3
  • 2
6 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 37790155
*1252 is a windows character set, usually, hence it's not recommended as default on *nix systems (which use international standards, usually:)
0
 
LVL 22

Accepted Solution

by:
earth man2 earned 375 total points
ID: 37790382
You need to do this when the database is created.

initdb --encoding=WIN1512 --locale=pt_BR

you can define COLLATE as part of table definition or query.
http://www.postgresql.org/docs/9.1/static/collation.html
0
 
LVL 1

Author Comment

by:aspenbr
ID: 37797132
Hi Earthman2

I create again cluster using your parameters , show this message pgstartup

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to "english".

fixing permissions on existing directory /var/lib/pgsql/9.0/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /var/lib/pgsql/9.0/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

Success. You can now start the database server using:

    /usr/pgsql-9.0/bin/postgres -D /var/lib/pgsql/9.0/data
or
    /usr/pgsql-9.0/bin/pg_ctl -D /var/lib/pgsql/9.0/data -l logfile start


I see that the idioms still EN_US not change to pt_BR , why ?
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 1

Author Comment

by:aspenbr
ID: 37797142
Hi ahoffmann

Is there  Portguese_Brazil.1252  only Windows and for Linux ?

I don´t why but the project is using this locale Portguese_Brasil.1252 all enviroment is in Windows Server 2003  I am triyng migrate to enviroment Linux Centos 6.

Thank you very much .
0
 
LVL 22

Expert Comment

by:earth man2
ID: 37798439
command

locale -a

will tell you if you have pt_br available on your system.
0
 
LVL 1

Author Comment

by:aspenbr
ID: 37825437
Hi Earthman2

I solve the issue using creating table using follow command

createdb  -E SQL_ASCII -T template0 --lc-collate=pt_BR --lc-ctype=pt_BR bd_Teste

bd_test | postgres | SQL_ASCII | pt_BR       | pt_BR          |


Thank very much
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AWS ELB 5 95
Run same command on multiple files in Linux 3 56
SonarQube on Linux vs Windows 3 52
Remove Resilio directory from Netgear ReadyNAS 212 via SSH. 2 47
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question