X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 0EB369FA5BA for ; Thu, 15 Jun 2006 10:19:37 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 98982-01 for ; Thu, 15 Jun 2006 10:19:26 -0300 (ADT) X-Greylist: delayed 00:34:49.564561 by SQLgrey- Received: from fil.office.ngn.de (port-83-236-131-42.static.qsc.de [83.236.131.42]) by postgresql.org (Postfix) with ESMTP id AE7189F9CAA for ; Thu, 15 Jun 2006 10:19:26 -0300 (ADT) Received: from [192.168.9.222] (taifun.becks.net [192.168.9.222]) by fil.office.ngn.de (8.13.6/8.13.6) with ESMTP id k5FCiXgh024002; Thu, 15 Jun 2006 14:44:33 +0200 Message-ID: <44915630.7000702@laokoon.IN-Berlin.DE> Date: Thu, 15 Jun 2006 14:44:32 +0200 From: Thomas Beutin Organization: (private) User-Agent: Thunderbird 1.5.0.4 (X11/20060607) MIME-Version: 1.0 To: pgsql-sql@postgresql.org CC: Milen Kulev Subject: Re: UTF-8 Problem ? References: <016d01c6906b$1e5c6570$0a00a8c0@trivadis.com> In-Reply-To: <016d01c6906b$1e5c6570$0a00a8c0@trivadis.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/176 X-Sequence-Number: 25412 Hi Milen, Milen Kulev wrote: > Hi Listers, > I want to insert some german specific characters (umlaut characters) into a table, but I am getting the following > Error message: > postgres=# EXECUTE stmt (1, 1 , 1 , 'Grün') ; > ERROR: invalid UTF-8 byte sequence detected near byte 0xfc > > Or > > postgres=# EXECUTE stmt (1, 1 , 1 , 'MAßßtab') ; > ERROR: invalid UTF-8 byte sequence detected near byte 0xdf > > Here are my object/statement definitions : > > A) PREPARE stmt( int, int, int, varchar) as insert INTO part values ($1,$2,$3,$4); > > B) > postgres=# \d+ part > Table "public.part" > Column | Type | Modifiers | Description > --------+------------------------+-----------+------------- > id1 | integer | not null | > id2 | integer | not null | > id3 | integer | not null | > filler | character varying(200) | | > > C) > > postgres=# l\l > List of databases > Name | Owner | Encoding > ------------+-------+----------- > db1 | user1 | SQL_ASCII > postgres | pg | UTF8 > template0 | pg | UTF8 > template1 | pg | UTF8 > > > How to solve my problem ? You should insert only correct utf8 strings or set the client encoding correctly: SET client_encoding = 'LATIN1'; or SET client_encoding = 'LATIN9'; IIRC postgresql must be compiled with --enable-recode to support this. Regards, -tb