Solved

Issues change to locale Portguese_Brasil.1252

Posted on 2012-03-30
6
1,250 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
[X]
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
  • 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

733 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