Solved

Issues change to locale Portguese_Brasil.1252

Posted on 2012-03-30
6
1,265 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
Technology Partners: 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!

 
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

Webinar: Security & Encryption in the MySQL world

Join Percona’s Solutions Engineer, Dimitri Vanoverbeke as he presents “Security and Encryption in the MySQL world” on Thursday, July 6, 2017 at 7:00 am PDT / 10:00 am EDT (UTC-7).

Question has a verified solution.

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

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

729 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