0

I have a server with postgresql 8.4 installed on it. But when I try to insert some data in russian, for example:

UPDATE category set question = '[there should be russian symbols]' WHERE id = 1;

terminal doesn't allow me to type russian symbols.

Here is piece of postgresql.conf file with locales:

lc_messages = 'ru_RU.UTF-8'
lc_monetary = 'ru_RU.UTF-8'
lc_numeric = 'ru_RU.UTF-8'
lc_time = 'ru_RU.UTF-8'

Here is locale command output:

LANG=ru_RU.UTF-8
LANGUAGE=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=ru_RU.UTF-8

What am I doing wrong?

Craig Ringer
  • 11,083
  • 9
  • 40
  • 61
user3734
  • 101
  • 2
  • If you cannot type Cyrillic symbols in your terminal, it's not a PostgreSQL problem, it's an issue with your operating system configuration. Can you type them at the normal bash command line, or into a text editor like nano? – Craig Ringer Apr 09 '14 at 12:16
  • No, it's psql problem, because when I try to type cyrillic symbols in terminal, not PostgreSQL, it works. – user3734 Apr 09 '14 at 12:24
  • 2
    When you say "PostgreSQL" do you mean the `psql` command line program that runs in a terminal? Or do you mean PgAdmin-III? Or something else? When you say you "can't type" them - is there any error? Does the wrong text appear? or does nothing at all appear? – Craig Ringer Apr 09 '14 at 12:28
  • What happens if you store the data in an sql file and run that, instead of typing it in? – Jenny D Apr 09 '14 at 12:36
  • When I execute an sql file with my cyrillic data it works. Thank you [Jenny-D](http://serverfault.com/users/120438/jenny-d) – user3734 Apr 09 '14 at 12:47
  • Executing queries in file - a reason to bypass the problem but not to fix it, I can't understand why I can't type cyrillic symbols. – user3734 Apr 09 '14 at 12:53
  • If you try connecting with `psql`again,, check to see what ENCODING is set to (by issuing the command `\set ENCODING`. – Jenny D Apr 09 '14 at 13:41
  • `server_encoding ----------------- UTF8` `client_encoding ----------------- UTF8` both encodings are UTF8, I think it's correct. – user3734 Apr 09 '14 at 14:21
  • Darn, I was hoping that would show something obvious. I am stumped. – Jenny D Apr 09 '14 at 14:23
  • This doesn't make a lot of sense. If you can type Cyrillic in the terminal it should be possible to type it in `psql` too. A more detailed description of the problem per my prev comment would be useful. – Craig Ringer Apr 10 '14 at 00:43

1 Answers1

0

I had the same problem, but on postgresql 9.3.

The problem was in what library load first. In my case it was

/usr/lib/postgresql/9.3/bin

with symlink:

ldd /usr/lib/postgresql/9.3/bin/psql 
libedit.so.2 => /usr/lib/x86_64-linux-gnu/libedit.so.2 (0x00007f1b54ac2000)

If you run psql like this:

LD_PRELOAD=/lib/x86_64-linux-gnu/libreadline.so.6.3 psql

then you can input cyrillic symbols.