Solved

Issues change to locale Portguese_Brasil.1252

Posted on 2012-03-30
6
1,229 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

708 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

13 Experts available now in Live!

Get 1:1 Help Now