Storing and retreiving infinity timestamp values from postgres database
Storing and retreiving infinity timestamp values from postgres database
От:
Mario Splivalo <mario.splivalo@mobart.hr>
Дата:
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? I'm using postgres 8.1 with latest JDBC drivers, and from the postgres JDBC web page can be concluded that the infinity support has been added to the driver. Mario -- Mario Splivalo Mob-Art mario.splivalo@mobart.hr "I can do it quick, I can do it cheap, I can do it well. Pick any two."
Re: Storing and retreiving infinity timestamp values from
От:
Kris Jurka <books@ejurka.com>
Дата:
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