Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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"
(1 row)


www:/tmp# sudo -u postgres /usr/lib/postgresql/8.3/bin/psql -q -c "show client_encoding"
(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

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
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 ...


LD_PRELOAD='/lib/' 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

Your Answer


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.