Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id A907E9FBAA2 for ; Wed, 14 Feb 2007 15:29:19 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 70170-07 for ; Wed, 14 Feb 2007 15:29:10 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by postgresql.org (Postfix) with ESMTP id 0E3529FBAE4 for ; Wed, 14 Feb 2007 15:29:08 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id x4so853878nfb for ; Wed, 14 Feb 2007 11:29:06 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bgJEegl5eGBYgvoVWLoMauUkWHtbfdqC6p37a9bvNve7nufZhDpWxcUP0RPFHANdSl+Kg5KAsWwKm7dFtr6KfxytZXKkT8T3yTEMAAA0c2fQfm1c+Z1rOyDMDY5VVvhZ5Ea98B9HM6eP8Zj5PuYpaygYrjk17WIm91NgIjH3cyw= Received: by 10.82.120.14 with SMTP id s14mr1368514buc.1171481346077; Wed, 14 Feb 2007 11:29:06 -0800 (PST) Received: by 10.82.185.18 with HTTP; Wed, 14 Feb 2007 11:29:06 -0800 (PST) Message-ID: <9cc55f600702141129l152d6e68i8c32fa0bb11bc788@mail.gmail.com> Date: Wed, 14 Feb 2007 14:29:06 -0500 From: "Chris Gamache" To: pgsql-jdbc@postgresql.org Subject: Re: stringtype=unspecified problem In-Reply-To: <45CED295.8050808@opencloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9cc55f600702091415r22648579uf5bc0d00e4c9932b@mail.gmail.com> <45CED295.8050808@opencloud.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/64 X-Sequence-Number: 16620 Here's a test case... Since I'm handling these UUIDs as Strings throughout the java code, they are indistinguishable from an actual string. /* * CREATE TABLE bomb_test (uuid uniqueidentifier); */ try { DriverManager.registerDriver(new org.postgresql.Driver()); Connection conn = DriverManager.getConnection("jdbc:postgresql://10.10.0.1:5432/data/public?stringtype=unspecified","postgres","password"); PreparedStatement bombOnNull = conn.prepareStatement("INSERT INTO bomb_test (uuid) values (?)"); //bombOnNull.setString(1, UUID.randomUUID().toString()); //this works //bombOnNull.setString(1, null); //this works //bombOnNull.setNull(1, java.sql.Types.NULL); //this works //bombOnNull.setNull(1, java.sql.Types.OTHER); //this works bombOnNull.setNull(1, java.sql.Types.VARCHAR); //this bombs bombOnNull.executeUpdate(); bombOnNull.close(); conn.close(); } catch (Exception e) { e.printStackTrace(); } Thank you for taking a look! On 2/11/07, Oliver Jowett wrote: > Chris Gamache wrote: > > > I'm running into a problem when I want to explicitly set one of those > > unspecified types to NULL. > > How exactly are you doing this, in terms of JDBC API calls? A testcase > showing the problem would be useful. > > -O >