diff -ur --exclude=CVS --exclude='*.class' --exclude='*.txt' postgres-v5/org/postgresql/jdbc2/TimestampUtils.java postgres-clean2/org/postgresql/jdbc2/TimestampUtils.java
--- postgres-v5/org/postgresql/jdbc2/TimestampUtils.java	2006-11-26 13:37:51.000000000 +0200
+++ postgres-clean2/org/postgresql/jdbc2/TimestampUtils.java	2006-11-28 08:46:06.000000000 +0200
@@ -700,12 +700,26 @@
         
         if (usesDouble) {
             double time = ByteConverter.float8(bytes, 0);
-
+            if (time == Double.POSITIVE_INFINITY) {
+                return new Timestamp(PGStatement.DATE_POSITIVE_INFINITY);
+            } else if (time == Double.NEGATIVE_INFINITY) {
+                return new Timestamp(PGStatement.DATE_NEGATIVE_INFINITY);
+            }
+            
             secs = (long) time;
             nanos = (int) ((time - secs) * 1000000);
         } else {
             long time = ByteConverter.int8(bytes, 0);
             
+            // compatibility with text based receiving, not strictly necessary
+            // and can actually be confusing because there are timestamps
+            // that are larger than infinite 
+            if (time == Long.MAX_VALUE) {
+                return new Timestamp(PGStatement.DATE_POSITIVE_INFINITY);
+            } else if (time == Long.MIN_VALUE) {
+                return new Timestamp(PGStatement.DATE_NEGATIVE_INFINITY);
+            }
+            
             secs = time / 1000000;
             nanos = (int) (time - secs * 1000000);
         }
