×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

PostgreSQL 8 - handling accents for Portuguese

PostgreSQL 8 - handling accents for Portuguese

PostgreSQL 8 - handling accents for Portuguese

(OP)
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

RE: PostgreSQL 8 - handling accents for Portuguese

create the cluster with the appropriate encoding ...

what exactly is your problem?

RE: PostgreSQL 8 - handling accents for Portuguese

(OP)
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

RE: PostgreSQL 8 - handling accents for Portuguese

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

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 sad)

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 http://www.postgresql.org/docs/8.1/interactive/charset.html

RE: PostgreSQL 8 - handling accents for Portuguese

(OP)
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

RE: PostgreSQL 8 - handling accents for Portuguese

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.

RE: PostgreSQL 8 - handling accents for Portuguese

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close