Received: from ucs.co.za (ucs.co.za [196.23.43.2]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eAAANFs12044 for ; Fri, 10 Nov 2000 05:23:16 -0500 (EST) (envelope-from gaf@ucs.co.za) Received: from ucspost.ucs.co.za (IDENT:root@mailgw1.ucs.co.za [196.23.43.254]) by ucs.co.za (8.9.3/8.9.3) with ESMTP id MAA08426; Fri, 10 Nov 2000 12:32:46 +0200 Received: from jhb.ucs.co.za (jhb.ucs.co.za [172.31.1.73]) by ucspost.ucs.co.za (8.9.3/8.7.3) with ESMTP id MAA17818; Fri, 10 Nov 2000 12:21:23 +0200 Received: from ucs.co.za (IDENT:gaf@pc141.ucs.co.za [172.31.1.141]) by jhb.ucs.co.za (8.9.3/8.8.7) with ESMTP id MAA16355; Fri, 10 Nov 2000 12:26:15 +0200 Message-ID: <3A0BCC1D.2A2F9F87@ucs.co.za> Date: Fri, 10 Nov 2000 12:21:17 +0200 From: Grant Finnemore X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Peter Mount CC: Interfaces Subject: Re: JDBC 'Unterminated quoted string' References: <1B3D5E532D18D311861A00600865478CF1B50E@exchange1.nt.maidstone.gov.uk> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.postgresql.org id eAAANLs12045 X-Archive-Number: 200011/115 X-Sequence-Number: 151 Peter, Joseph Shraibman contacted me yesterday about whether or not the patch that I sent actually does the correct thing. I enclose my response below. In brief, there seems to be some problem at the backend inserting a \0. I have tested the query from the modified jdbc driver, psql and a standalone backend. Regards, Grant I tested by doing the following:- In psql... CREATE TABLE t ( aa char(1) ); INSERT INTO t VALUES ('\0'); In java test program... PreparedStatement ps = conn.prepareStatement("insert into t values (?)"); ps.setString(1, String.valueOf('\0')); ps.executeUpdate(); In psql... test=# select * from t; aa ---- (2 rows) test=# select ascii(aa) from t; ascii ------- 32 32 (2 rows) This is wierd! Both psql and the java app insert the same value and both are not 0. However, test=# select ascii('\0'); ascii ------- 0 (1 row) This appears correct, so the problem would appear to be in the insert. -- > Poorly planned software requires a genius to write it > and a hero to use it. Grant Finnemore BSc(Eng) (mailto:gaf@ucs.co.za) Software Engineer Universal Computer Services Tel (+27)(11)712-1366 PO Box 31266 Braamfontein 2017, South Africa Cell (+27)(82)604-5536 20th Floor, 209 Smit St., Braamfontein Fax (+27)(11)339-3421 Johannesburg, South Africa