I looked at similar questions, but still have not found a suitable solution.
On my Ubuntu OS I created some database by:
createdb PADB -W
And created a table.
create table teacher(
id_teacher integer PRIMARY KEY,
name varchar(120),
experience integer
);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "teacher_pkey" for table "teacher"
I want to add some data contains Cyrillic, but I got this error:
PADB=# insert into teacher (name, experience) values ("Пупкин Василий Иванович", 15);
ERROR: invalid byte sequence for encoding "UTF8": 0xd0d0
Here is my lc settings:
PADB=# select name, setting from pg_settings where name like 'lc_%';
name | setting
-------------+-------------
lc_collate | ru_RU.UTF-8
lc_ctype | ru_RU.UTF-8
lc_messages | ru_RU.UTF-8
lc_monetary | ru_RU.UTF-8
lc_numeric | ru_RU.UTF-8
lc_time | ru_RU.UTF-8
(6 rows)
What is wrong?
Postgresql 9.1.11
id_teacher integer PRIMARY KEY,: id_teacher cannot be NULL, so your insert will fail since it does not supply a value for id_teacher. (did you meanSERIAL?)localecommand in the terminal you're runningpsqlfrom. Edit the question and comment here when done.