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 92E693A18FE for ; Fri, 14 Jan 2005 07:24:49 +0000 (GMT) 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 28093-07 for ; Fri, 14 Jan 2005 07:24:43 +0000 (GMT) Received: from mx.vitrado.de (mx.vitrado.de [194.97.5.172]) by svr1.postgresql.org (Postfix) with ESMTP id D0B6B3A18B8 for ; Fri, 14 Jan 2005 07:24:43 +0000 (GMT) Received: from morpheus.vitrado.de ([194.97.5.114] helo=vitrado-011.intranet.de) by mx.vitrado.de with asmtp (Exim 4.34 and XAMS pre-0.0.16) id 1CpLp4-0001tj-Hx; Fri, 14 Jan 2005 08:24:42 +0100 From: Oliver Siegmar Organization: Vitrado GmbH To: Kris Jurka Subject: Re: Problems with infinity Date: Fri, 14 Jan 2005 08:24:41 +0100 User-Agent: KMail/1.7.1 Cc: pgsql-jdbc@postgresql.org References: <200501131419.00993.o.siegmar@vitrado.de> <200501131452.31209.o.siegmar@vitrado.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501140824.41665.o.siegmar@vitrado.de> X-VITRADO-MailScanner: Not scanned X-MailScanner-From: o.siegmar@vitrado.de X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/109 X-Sequence-Number: 11989 On Thursday 13 January 2005 15:18, Kris Jurka wrote: > On Thu, 13 Jan 2005, Oliver Siegmar wrote: > > On Thursday 13 January 2005 14:42, Kris Jurka wrote: > > > This is indeed a bug in the 7.4 drivers. > > > > Will you fix it? ;-) > > Sure, but you should be aware that the driver only does this conversion on > output (rs.getTimestamp()). No conversion is done for setTimestamp, so > it's a one way solution. This was part of my reasoning for removing it. Of course it should work in both directions. > > Couldn't you make it configurable (like 'convert_infinite_to_min_max = > > true')? > > That could be done, but how do you define min/max. There are at least > three possible definitions I can think of: Java's min/max value for > Timestamp and pg's min/max, but pg's depends on how it was compiled > (--enable-integer-datetimes). So how do you pick which one? You've got > to pick the one with the smallest range, so it fits inside the other's > range, which kind of sucks because then you have a special magic value > that isn't even at the extremes of the type range. The user level > code to manipulate such a thing will certainly be ugly. Well, I'd set Long.MIN_VALUE / Long.MAX_VALUE to the Timestamp - the pgsql driver could simply convert this to '-infinity' / 'infinity' strings, not? This could be done for both directions. I agree, that these are special magic values but its better than someone can break down my java applications by inserting a infinity value to a timestamp field. What do you think? Cheers, Oliver