X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7145652A11 for ; Tue, 19 Jul 2005 19:58:27 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 90511-02 for ; Tue, 19 Jul 2005 22:58:18 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id B0CE152A01 for ; Tue, 19 Jul 2005 19:58:17 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Dv12X-0000X5-Kd; Wed, 20 Jul 2005 10:58:17 +1200 Message-ID: <42DD8589.2070906@opencloud.com> Date: Wed, 20 Jul 2005 10:58:17 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Dave Cramer , Christian Cryder , pgsql-jdbc@postgresql.org Subject: Re: Timestamp Conversion Woes Redux References: <90876a9e05071810503606d431@mail.gmail.com> <16335.1121714809@sss.pgh.pa.us> <10C90079-DD0A-43D7-9389-7486803F0AB1@fastcrypt.com> <42DC37AC.5030704@opencloud.com> <42DCF0C9.4030501@opencloud.com> <23396.1121781259@sss.pgh.pa.us> <42DD0824.9060002@opencloud.com> <23729.1121783651@sss.pgh.pa.us> In-Reply-To: <23729.1121783651@sss.pgh.pa.us> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/146 X-Sequence-Number: 13294 Tom Lane wrote: > My previous response was based on what was in my inbox, which I now see > wasn't the whole thread. I agree with you that if we make setString > default to UNKNOWN, there had better be a way to say "by golly this > really is TEXT" for the corner cases. It'd be a good idea if it wasn't > limited to TEXT, either, but could allow specification of any random > datatype. We already have a mechanism for setting values of arbitary type: pass a PGobject implementation to setObject(). We could extend this easily so that passing a String with Types.UNKNOWN is a shorthand for passing a PGobject with a type of 'unknown'. It seems very odd to have a situation where the standard JDBC way of setting a VARCHAR parameter -- setString -- sometimes doesn't work and you have to go and use a non-standardi postgresql-specific method to say "no, really, this *is* VARCHAR". If we change setString() then we've gone from the existing case where correct applications work and broken applications break, to a situation where some correct applications do *not* work and must add this nonstandard code to continue to work, and broken applications have the breakage hidden. I can understand why people want this from the perspective of supporting existing apps that expect implicit casting of string parameters, but from a driver-correctness and new-development perspective it seems all wrong. Maybe a driver URL parameter that changes the behaviour of setString() is a reasonable compromise between the two? -O