Solved

Issues change to locale Portguese_Brasil.1252

Posted on 2012-03-30
6
1,241 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now