pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: EBIHARA, Yuichiro <ebihara@iplocks.co.jp>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: how to handle data containing '\0'
Date: Mon, 22 May 2006 02:28:52 -0500 (EST)
Message-ID: <Pine.BSO.4.63.0605220223540.21575@leary2.csoft.net> (raw)
In-Reply-To: <001f01c679a9$a3627350$360aa8c0@ipljp.local>
References: <001f01c679a9$a3627350$360aa8c0@ipljp.local>



On Wed, 17 May 2006, EBIHARA, Yuichiro wrote:

> I need to handle String data containing '\0' in my Java + JDBC program. 
>
> Now I have to support two versions of drivers, 7.4 and 8.1, but the 
> behavior of driver depends on versions when I insert this String value.
>

This was changed between 7.4 and 8.0 when prepared statements changed from 
dynamically creating a sql string from the parameters to passing the 
parameters separately.  When creating a sql string the parameters had to 
be carefully checked for ' and \ so checking for \0 was also done.  When 
passing the parameters separately there is no need for the ' and \ checks 
so the \0 check was removed as well either unintentionally or for 
perfomance reasons.

New server releases for all versions will be out this week that fix the 
problem on the server side by explicitly rejecting \0 rather than 
truncating.

Kris Jurka




view thread (7+ messages)  latest in thread

Message-ID: <Pine.BSO.4.63.0605220223540.21575@leary2.csoft.net>
Permalink:  ../Pine.BSO.4.63.0605220223540.21575@leary2.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.63.0605220223540.21575@leary2.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, ebihara@iplocks.co.jp
  Subject: Re: how to handle data containing '\0'
  In-Reply-To: <Pine.BSO.4.63.0605220223540.21575@leary2.csoft.net>
  References: <001f01c679a9$a3627350$360aa8c0@ipljp.local> <Pine.BSO.4.63.0605220223540.21575@leary2.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox