Обсуждение: Issue with database Postgresql :(

Поиск
Список
Период
Сортировка

Issue with database Postgresql :(

От
Gerard M
Дата:
Hello dear postgres community, I'm having a bad time with an issue
that I haven't been able to solve with my database, the problem is
this:
Whenever I try to save a word containing "special" characters in it
(for example áéíóú) I get the following django error:
"invalid byte sequence for encoding "UTF8": 0xe92020 HINT: This error
can also happen if the byte sequence does not match the encoding
expected by the server, which is controlled by "client_encoding"."
I know that I need to set something to my database/table but I dont
know where or how to achieve this, when I type" show;" at the
postgresql shell it tells me that my database is UTF-8 encoding.

I solved a problem like this in MySQL with the following commands:

alter database <DBname> character set utf8 collate utf8_general_ci;
alter table <tablename> convert to character set utf8 collate
utf8_general_ci;

I dont know if something like this exists in postgresql, or if there
is something else I can do or I should be doing, thanks for your help,
and your time for reading this post.


Re: Issue with database Postgresql :(

От
Peter Eisentraut
Дата:
Am Dienstag, 8. Mai 2007 19:20 schrieb Gerard M:
> Whenever I try to save a word containing "special" characters in it
> (for example áéíóú) I get the following django error:
> "invalid byte sequence for encoding "UTF8": 0xe92020 HINT: This error
> can also happen if the byte sequence does not match the encoding
> expected by the server, which is controlled by "client_encoding"."
> I know that I need to set something to my database/table but I dont
> know where or how to achieve this,

Set client_encoding to the encoding that your client application is really
producing.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: Issue with database Postgresql :(

От
Gerard M
Дата:
how can I set the client_encoding to what I need?


Re: Issue with database Postgresql :(

От
"Albe Laurenz"
Дата:
> how can I set the client_encoding to what I need?

With SQL:

SET client_encoding = <whatever>

Yours,
Laurenz Albe