Re: Problems with infinity
От | Oliver Siegmar |
---|---|
Тема | Re: Problems with infinity |
Дата | |
Msg-id | 200501140824.41665.o.siegmar@vitrado.de обсуждение исходный текст |
Ответ на | Re: Problems with infinity (Kris Jurka <books@ejurka.com>) |
Ответы |
Re: Problems with infinity
|
Список | pgsql-jdbc |
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
В списке pgsql-jdbc по дате отправления: