Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PostgreSQL 8 - handling accents for Portuguese 1

Status
Not open for further replies.

Dabase

Programmer
Apr 2, 2004
122
PT
Hi,

During or after installation of PostgreSQL 8 on FC4, is there a configuration option or an add-on that handles accents for the Portuguese languange?

Thanks
Dabase
 
create the cluster with the appropriate encoding ...

what exactly is your problem?
 
Hi ceco,

Thanks for the reply. After I installed Postgres, I tried to restore a database that contains characters with accents and I
got some errors.

Could you please advise me on where I can find information on encoding. My understanding of clustering is having more than one server, which is not my case.

Thanks
Dabase
 
well, in postgresql, a cluster is meant - a bunch of databases - actually the databases of the instalation (I'm not sure if its clear :))

actualy what initdb creates in postgresql is called a cluster of databases

so you have to do
initdb --locale=XXXX
(I don't know your correct locale, you better check your previous version what locale used) the locale just solves some of the problems (so you may not need this)

then when you create the database you should use
createdb -E UTF-8 new_database
(but again, I don't know which is the correct encoding for you :-()

the encoding will help you to see the characters as expected
the locale is helping so that ORDER BY some_text_field works correct, and UPPER/LOWER work as expect etc.

see here for
 
Hi ceco,

Once again, thanks for the response.

I have done the following:

...
/usr/local/pgsql/bin/initdb --locale=pt_PT -D /usr/local/pgsql/data

...

/usr/local/pgsql/bin/createdb -E SQL_ASCII test

When I performed the restore I did not get the errors I was experiencing before.

However, when I tried to install PGAdmin III (using rpm -Uvh pgadmin3-1.4.0-1.i686.rpm), to view the restored data, I am getting a Failed dependencies error:
postgresql is needed by pgadmin3-1.4.0-1.i686

NB. I installed PostgreSQL as follows:

gunzip postgresql-8.0.7.tar.gz
tar xf postgresql-8.0.7.tar

cd /usr/local/postgresql-8.0.7

./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb --locale=pt_PT -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb -E SQL_ASCII test


Thanks
Dabase
 
you didn't mention the encoding. you just gave the locale.

[joe@www postgresql]$ locale -a | grep ko_
ko_KR
ko_KR.euckr
ko_KR.utf8
[joe@www postgresql]$


the encoding comes at the end.

also, you must install the rpms to satisfy the dependency or use rpm --no-deps or rpm --force i can never remember the diff between those 2.
 
misterjoe,

Thanks for the response. The encoding is SQL_ASCII

Code:
/usr/local/pgsql/bin/createdb -E SQL_ASCII test

I did manage to connect to the server from PGAdmin installed on another machine and saw that it was picking the accents, etc... so a star for ceco

I will try to use rpm --no-deps or rpm --force as suggested.

Thanks
Dabase
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top