X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 5B4869F9C18 for ; Wed, 17 May 2006 10:39:50 -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 10820-04 for ; Wed, 17 May 2006 10:39:41 -0300 (ADT) X-Greylist: delayed 00:26:39.643942 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 601F49FA226 for ; Wed, 17 May 2006 10:39:34 -0300 (ADT) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr4.postgresql.org (Postfix) with ESMTP id 218355B561A for ; Wed, 17 May 2006 13:12:54 +0000 (GMT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FgLpL-0006aU-Tn for pgsql-jdbc@postgresql.org; Wed, 17 May 2006 15:12:37 +0200 Received: from 83.145.96.118 ([83.145.96.118]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 17 May 2006 15:12:35 +0200 Received: from Marc.Herbert by 83.145.96.118 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 17 May 2006 15:12:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Marc Herbert Subject: Re: how to handle data containing '\0' Date: Wed, 17 May 2006 15:13:03 +0200 Lines: 11 Message-ID: References: <001f01c679a9$a3627350$360aa8c0@ipljp.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 83.145.96.118 User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4 (Jumbo Shrimp, linux) Cancel-Lock: sha1:uhpGHRLyJY2axYbvZ1/BG4Xj6w8= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.178 tagged_above=0 required=5 tests=BAYES_00, FORGED_RCVD_HELO, RCVD_NUMERIC_HELO, SPF_FAIL X-Spam-Level: X-Archive-Number: 200605/71 X-Sequence-Number: 15199 "EBIHARA, Yuichiro" writes: > > I need to handle String data containing '\0' in my Java + JDBC program. Such data can happen at other systems and be sent to > PostgreSQL. Here is a sample to simulate it in Java code. As far as I know, it is not possible to store such strings in a postgreSQL database (whatever the client interface used). The reason seems to be that postgreSQL is written in C, and most C functions use \0 as a string terminator.