Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 4A0409FB1E1 for ; Wed, 27 Sep 2006 15:37:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 80770-09 for ; Wed, 27 Sep 2006 18:37:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by postgresql.org (Postfix) with SMTP id 786159FA7BA for ; Wed, 27 Sep 2006 15:37:44 -0300 (ADT) Received: (qmail 4832 invoked by uid 1112); 27 Sep 2006 18:37:43 -0000 Date: Wed, 27 Sep 2006 13:37:43 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary2.csoft.net To: Mario Splivalo cc: pgsql-jdbc@postgresql.org Subject: Re: Storing and retreiving infinity timestamp values from In-Reply-To: <1159310836.18217.5.camel@localhost.localdomain> Message-ID: References: <1159310836.18217.5.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1253717014-1159382263=:6334" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200609/133 X-Sequence-Number: 15851 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1253717014-1159382263=:6334 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Wed, 27 Sep 2006, Mario Splivalo wrote: > I have read some posts on this mailinglist concerning the infinity value > of the timestamp data type, where it was stated that an exception is > thrown when one attempts to read infinity value. Now, on the postgresql > jdbc there is an entry in TODO list wich mentions adding handling of > 'infinity' values to the jdbc documentation. > > Is it possible for someone to post some code here for reading/storing > infinity timestamp values to and from postgres database? > See attached. We use special constants to indicate infinity because Java has no equivalent. Looking at this test output, the displayed value of our negative infinity value looks a little suspect and I suspect there's something timezone dependent going on there. Any change to that shouldn't affect your code, just the constants value. Kris Jurka --0-1253717014-1159382263=:6334 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=InfTS.java Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=InfTS.java aW1wb3J0IGphdmEuc3FsLio7DQoNCmltcG9ydCBvcmcucG9zdGdyZXNxbC5Q R1N0YXRlbWVudDsNCg0KcHVibGljIGNsYXNzIEluZlRTIHsNCgkNCglwdWJs aWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmcgYXJnc1tdKSB0aHJvd3MgRXhj ZXB0aW9uIHsNCgkJQ2xhc3MuZm9yTmFtZSgib3JnLnBvc3RncmVzcWwuRHJp dmVyIik7DQoJCUNvbm5lY3Rpb24gY29ubiA9IERyaXZlck1hbmFnZXIuZ2V0 Q29ubmVjdGlvbigiamRiYzpwb3N0Z3Jlc3FsOi8vbG9jYWxob3N0OjU0MzIv anVya2EiLCJqdXJrYSIsIiIpOw0KDQoJCVN0YXRlbWVudCBzdG10ID0gY29u bi5jcmVhdGVTdGF0ZW1lbnQoKTsNCgkJc3RtdC5leGVjdXRlKCJDUkVBVEUg VEVNUCBUQUJMRSBpbmZ0cyAoYSB0aW1lc3RhbXB0eikiKTsNCg0KCQlQcmVw YXJlZFN0YXRlbWVudCBwc3RtdCA9IGNvbm4ucHJlcGFyZVN0YXRlbWVudCgi SU5TRVJUIElOVE8gaW5mdHMgVkFMVUVTICg/KSIpOw0KCQlwc3RtdC5zZXRU aW1lc3RhbXAoMSwgbmV3IFRpbWVzdGFtcChQR1N0YXRlbWVudC5EQVRFX1BP U0lUSVZFX0lORklOSVRZKSk7DQoJCXBzdG10LmV4ZWN1dGVVcGRhdGUoKTsN CgkJcHN0bXQuc2V0VGltZXN0YW1wKDEsIG5ldyBUaW1lc3RhbXAoUEdTdGF0 ZW1lbnQuREFURV9ORUdBVElWRV9JTkZJTklUWSkpOw0KCQlwc3RtdC5leGVj dXRlVXBkYXRlKCk7DQoNCgkJUmVzdWx0U2V0IH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