Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two instances of PostgreSQL installed on my server: 8.3 and 9.0. There seams to be some problem with Polish diacritic characters (like ółęąśżźć) on postgresql 9.0 client - psql.

When I connect to DB (either 8.3 or 9.0) with psql 8.3 - I can type all diacritics on the terminal without any problems:

www:/tmp# sudo -u postgres /usr/lib/postgresql/8.3/bin/psql -q
postgres=# ółśćń

However, when I connect to the same DBs with psql 9.0 client - I can't type diacritics on the terminal anymore:

www:/tmp# sudo -u postgres /usr/lib/postgresql/8.3/bin/psql -q

Here are some encoding settings:

www:/tmp# sudo -u postgres /usr/lib/postgresql/9.0/bin/psql -q -c "show client_encoding"
 client_encoding
-----------------
 UTF8
(1 row)

.

www:/tmp# sudo -u postgres /usr/lib/postgresql/8.3/bin/psql -q -c "show client_encoding"
 client_encoding
-----------------
 UTF8
(1 row)

.

www:/tmp# sudo -u postgres /usr/lib/postgresql/9.0/bin/psql -q -l
                                         List of databases
        Name         |    Owner     | Encoding |  Collation  |    Ctype    |   Access privileges
---------------------+--------------+----------+-------------+-------------+-----------------------
 postgres            | postgres     | UTF8     | pl_PL.UTF-8 | pl_PL.UTF-8 |

.

www:/tmp# echo $LANG
pl_PL.UTF-8

It looks like DB/cluster configuration doesn't matter - if psql 8.x on terminal works fine and psql 9.x does not. Any idea how to fix that?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

It is probably related to psql 9.0.2 switching from readline to libedit. You could try (works for me, Ubuntu 10.04):

rlwrap psql -n ...

Alternatively:

LD_PRELOAD='/lib/libreadline.so.5' psql ...

Or, it is suggested to install termcap, but I haven't tried this (no apparent way to do this in Ubuntu).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.