Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7066A4758E6 for ; Mon, 18 Nov 2002 07:38:42 -0500 (EST) Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id 59F1F474E53 for ; Mon, 18 Nov 2002 07:38:38 -0500 (EST) Received: (qmail 6435 invoked from network); 18 Nov 2002 12:38:39 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 18 Nov 2002 12:38:39 -0000 Received: from unknown (HELO mcadnote1) (219.61.40.40) by sd.tpf.co.jp with SMTP; 18 Nov 2002 12:38:39 -0000 From: "Hiroshi Inoue" To: "Bo?ena Potempa" Cc: Subject: Re: PostgreSQL+ Beta bug? Date: Mon, 18 Nov 2002 21:40:07 +0900 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/83 X-Sequence-Number: 2260 > -----Original Message----- > From: Bo?ena Potempa [mailto:Bozena.Potempa@otc.pl] > > >From: Hiroshi Inoue [mailto:Inoue@tpf.co.jp] > >Sent: Saturday, November 16, 2002 12:38 AM > > [..] > >As long as you are using text(char or varchar) type, you can't > >store strings other than null terminated ones. > >Please use BYTEA type instead and bind the parameter using > >SQL_C_BINARY and SQL_VARBINARY. > > But that's true only in ODBC, so I think it _is_ a bug > in ODBC driver. It is perfectly possible to store 0 in > varchar or char fields. Please try from psql: > > INSERT INTO t values (chr(0)||chr(1)||chr(0)); > and then check: > select ascii(substring(fc,1,1)) from t; - 0 > select ascii(substring(fc,2,1)) from t; - 1 > select ascii(substring(fc,3,1)) from t; - 0 Which version of PostgreSQL server are you connecting ? Here I see all 0 i.e. select ascii(substring(fc,1,1)) from t; - 0 select ascii(substring(fc,2,1)) from t; - 0 select ascii(substring(fc,3,1)) from t; - 0 regards, Hiroshi Inoue