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 4F05D529A0 for ; Tue, 19 Jul 2005 12:22:21 -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 52933-10 for ; Tue, 19 Jul 2005 15:22:12 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 7816C52995 for ; Tue, 19 Jul 2005 12:22:11 -0300 (ADT) Received: (qmail 10019 invoked from network); 19 Jul 2005 15:22:11 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 19 Jul 2005 15:22:11 -0000 In-Reply-To: <23396.1121781259@sss.pgh.pa.us> 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> Mime-Version: 1.0 (Apple Message framework v733) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <392278AB-987F-40CF-B59D-DDF53B9A4ACF@fastcrypt.com> Cc: Oliver Jowett , Christian Cryder , pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: Timestamp Conversion Woes Redux Date: Tue, 19 Jul 2005 11:22:09 -0400 To: Tom Lane X-Mailer: Apple Mail (2.733) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.015 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/138 X-Sequence-Number: 13286 What about creating two extension classes PGTimestamp, and PGTimestamptz then allowing setObject to recognize these internally and bind to Oid.Timestamp, and Oid.Timestamptz repectively for setString I am in favour of using UNKNOWN as this is no worse than what 7.4 drivers do now Dave On 19-Jul-05, at 9:54 AM, Tom Lane wrote: > Oliver Jowett writes: > >> Dave Cramer wrote: >> >>> I'm also thinking we should use UNKOWN for setString as well, >>> hopefully >>> this would reduce the number of upgrade problems people are >>> having when >>> they upgrade from 7.x to 8.x >>> > > >> I still think this is a bad idea. >> > > I think one main point against using UNKNOWN is that it creates a risk > of "could not resolve parameter type" query failures. That's OK for > generic setString() cases, since the user can always escape the > failure > by changing his code to specify the parameter type more clearly. > > The other argument against UNKNOWN is that the backend might choose an > unexpected data type. Again, that doesn't scare me a lot for > setString, > because the backend's rules for dealing with UNKNOWN are biased in > favor > of resolving the parameter type as TEXT, which seems perfectly > reasonable for setString cases. > > Unfortunately, both of these considerations speak *against* using > UNKNOWN for Timestamp. If the backend rejects the query --- or more > likely, makes the wrong datatype choice --- there will be no way for > the user to fix it. > > So I'm in favor of using UNKNOWN for setString, but I think we gotta > find another answer for Christian's problem. > > regards, tom lane > >