? f ? infinity_date_failure.patch ? pgjdbc_infinity4.patch ? org/postgresql/test/jdbc2/.TimestampTest.java.swp Index: org/postgresql/PGStatement.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/PGStatement.java,v retrieving revision 1.13 diff -c -r1.13 PGStatement.java *** org/postgresql/PGStatement.java 11 Jan 2005 08:25:43 -0000 1.13 --- org/postgresql/PGStatement.java 25 Jan 2005 08:29:34 -0000 *************** *** 18,23 **** --- 18,32 ---- */ public interface PGStatement { + // We can't use Long.MAX_VALUE or Long.MIN_VALUE for java.sql.date + // because this would break the 'normalization contract' of the + // java.sql.Date API. + // The follow values are the nearest MAX/MIN values with hour, + // minute, second, millisecond set to 0 - this is used for + // -infinity / infinity representation in Java + public static final long DATE_POSITIVE_INFINITY = 9223372036825200000l; + public static final long DATE_NEGATIVE_INFINITY = -9223372036832400000l; + /** * Returns the Last inserted/updated oid. Index: org/postgresql/jdbc2/AbstractJdbc2Statement.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v retrieving revision 1.66 diff -c -r1.66 AbstractJdbc2Statement.java *** org/postgresql/jdbc2/AbstractJdbc2Statement.java 25 Jan 2005 06:21:21 -0000 1.66 --- org/postgresql/jdbc2/AbstractJdbc2Statement.java 25 Jan 2005 08:29:34 -0000 *************** *** 21,26 **** --- 21,27 ---- import java.util.GregorianCalendar; import org.postgresql.Driver; + import org.postgresql.PGStatement; import org.postgresql.largeobject.*; import org.postgresql.core.*; import org.postgresql.util.PSQLException; *************** *** 2823,2828 **** --- 2824,2837 ---- static java.util.Calendar changeTime(java.util.Date t, java.util.Calendar cal, boolean Add) { long millis = t.getTime(); + + if (millis == PGStatement.DATE_POSITIVE_INFINITY || + millis == PGStatement.DATE_NEGATIVE_INFINITY) + { + cal.setTimeInMillis(millis); + return cal; + } + int localoffset = t.getTimezoneOffset() * 60 * 1000 * -1; int caloffset = cal.getTimeZone().getRawOffset(); if (cal.getTimeZone().inDaylightTime(t)) Index: org/postgresql/jdbc2/TimestampUtils.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/TimestampUtils.java,v retrieving revision 1.12 diff -c -r1.12 TimestampUtils.java *** org/postgresql/jdbc2/TimestampUtils.java 14 Jan 2005 01:20:20 -0000 1.12 --- org/postgresql/jdbc2/TimestampUtils.java 25 Jan 2005 08:29:35 -0000 *************** *** 16,21 **** --- 16,22 ---- import java.util.TimeZone; import java.util.SimpleTimeZone; + import org.postgresql.PGStatement; import org.postgresql.util.GT; import org.postgresql.util.PSQLState; import org.postgresql.util.PSQLException; *************** *** 26,32 **** */ public class TimestampUtils { - /** * Load date/time information into the provided calendar * returning the fractional seconds. --- 27,32 ---- *************** *** 34,44 **** private static int loadCalendar(GregorianCalendar cal, String s, String type) throws SQLException { int slen = s.length(); ! // java doesn't have a concept of postgres's infinity ! // so there's not much we can do here. ! if ((slen == 8 && s.equals("infinity")) || (slen == 9 && s.equals("-infinity"))) { ! throw new PSQLException(GT.tr("Infinite value found for timestamp. Java has no corresponding representation."), ! PSQLState.DATETIME_OVERFLOW); } // Zero out all the fields. --- 34,48 ---- private static int loadCalendar(GregorianCalendar cal, String s, String type) throws SQLException { int slen = s.length(); ! // convert postgres's infinity values to Long extremes ! if (slen == 8 && s.equals("infinity")) { ! cal.setTimeInMillis(PGStatement.DATE_POSITIVE_INFINITY); ! return 0; ! } ! ! if (slen == 9 && s.equals("-infinity")) { ! cal.setTimeInMillis(PGStatement.DATE_NEGATIVE_INFINITY); ! return 0; } // Zero out all the fields. *************** *** 195,200 **** --- 199,213 ---- if (s == null) return null; + int slen = s.length(); + + // infinity cannot be represented as Time + // so there's not much we can do here. + if ((slen == 8 && s.equals("infinity")) || (slen == 9 && s.equals("-infinity"))) { + throw new PSQLException(GT.tr("Infinite value found for timestamp/date. This cannot be represented as time."), + PSQLState.DATETIME_OVERFLOW); + } + synchronized(cal) { cal.set(Calendar.ZONE_OFFSET, 0); cal.set(Calendar.DST_OFFSET, 0); *************** *** 236,246 **** cal.setTime(x); sbuf.setLength(0); ! appendDate(sbuf, cal); ! sbuf.append(' '); ! appendTime(sbuf, cal, x.getNanos()); ! appendTimeZone(sbuf, x); ! appendEra(sbuf, cal); return sbuf.toString(); } } --- 249,265 ---- cal.setTime(x); sbuf.setLength(0); ! if (x.getTime() == PGStatement.DATE_POSITIVE_INFINITY) { ! sbuf.append("infinity"); ! } else if (x.getTime() == PGStatement.DATE_NEGATIVE_INFINITY) { ! sbuf.append("-infinity"); ! } else { ! appendDate(sbuf, cal); ! sbuf.append(' '); ! appendTime(sbuf, cal, x.getNanos()); ! appendTimeZone(sbuf, x); ! appendEra(sbuf, cal); ! } return sbuf.toString(); } } *************** *** 252,259 **** cal.setTime(x); sbuf.setLength(0); ! appendDate(sbuf, cal); ! appendEra(sbuf, cal); return sbuf.toString(); } } --- 271,284 ---- cal.setTime(x); sbuf.setLength(0); ! if (x.getTime() == PGStatement.DATE_POSITIVE_INFINITY) { ! sbuf.append("infinity"); ! } else if (x.getTime() == PGStatement.DATE_NEGATIVE_INFINITY) { ! sbuf.append("-infinity"); ! } else { ! appendDate(sbuf, cal); ! appendEra(sbuf, cal); ! } return sbuf.toString(); } } Index: org/postgresql/test/jdbc2/TimestampTest.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/test/jdbc2/TimestampTest.java,v retrieving revision 1.17 diff -c -r1.17 TimestampTest.java *** org/postgresql/test/jdbc2/TimestampTest.java 11 Jan 2005 08:25:48 -0000 1.17 --- org/postgresql/test/jdbc2/TimestampTest.java 25 Jan 2005 08:29:35 -0000 *************** *** 11,17 **** --- 11,23 ---- import org.postgresql.test.TestUtil; import junit.framework.TestCase; + import java.sql.*; + import java.util.TimeZone; + import java.util.GregorianCalendar; + + import org.postgresql.PGStatement; + import org.postgresql.jdbc2.TimestampUtils; /* * Test get/setTimestamp for both timestamp with time zone and *************** *** 42,47 **** --- 48,106 ---- TestUtil.closeDB(con); } + public void testInfinity() throws SQLException + { + runInfinityTests(TSWTZ_TABLE, PGStatement.DATE_POSITIVE_INFINITY); + runInfinityTests(TSWTZ_TABLE, PGStatement.DATE_NEGATIVE_INFINITY); + runInfinityTests(TSWOTZ_TABLE, PGStatement.DATE_POSITIVE_INFINITY); + runInfinityTests(TSWOTZ_TABLE, PGStatement.DATE_NEGATIVE_INFINITY); + } + + private void runInfinityTests(String table, long value) throws SQLException + { + GregorianCalendar cal = new GregorianCalendar(); + // Pick some random timezone that is hopefully different than ours + // and exists in this JVM. + cal.setTimeZone(TimeZone.getTimeZone("Europe/Warsaw")); + + String strValue; + if (value == PGStatement.DATE_POSITIVE_INFINITY) { + strValue = "infinity"; + } else { + strValue = "-infinity"; + } + + Statement stmt = con.createStatement(); + stmt.executeUpdate(TestUtil.insertSQL(table, "'" + strValue + "'")); + stmt.close(); + + PreparedStatement ps = con.prepareStatement(TestUtil.insertSQL(table, "?")); + ps.setTimestamp(1, new Timestamp(value)); + ps.executeUpdate(); + ps.setTimestamp(1, new Timestamp(value), cal); + ps.executeUpdate(); + ps.close(); + + stmt = con.createStatement(); + ResultSet rs = stmt.executeQuery("select ts from " + table); + while (rs.next()) { + assertEquals(strValue, rs.getString(1)); + + Timestamp ts = rs.getTimestamp(1); + assertEquals(value, ts.getTime()); + + Date d = rs.getDate(1); + assertEquals(value, d.getTime()); + + Timestamp tscal = rs.getTimestamp(1, cal); + assertEquals(value, tscal.getTime()); + } + rs.close(); + + assertEquals(3, stmt.executeUpdate("DELETE FROM " + table)); + stmt.close(); + } + /* * Tests the timestamp methods in ResultSet on timestamp with time zone * we insert a known string value (don't use setTimestamp) then see that *************** *** 167,193 **** assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS2WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS3WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS4WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS1WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS2WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS3WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS4WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS1WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS2WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS3WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS4WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpDate1WOTZ.getTime()) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpDate2WOTZ.getTime()) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpDate3WOTZ.getTime()) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpDate4WOTZ.getTime()) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpTime1WOTZ.getTime()) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpTime2WOTZ.getTime()) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpTime3WOTZ.getTime()) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpTime4WOTZ.getTime()) + "'"))); // Fall through helper timestampTestWOTZ(); ! assertEquals(20, stmt.executeUpdate("DELETE FROM " + TSWOTZ_TABLE)); stmt.close(); } --- 226,262 ---- assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS2WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS3WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS4WOTZ_PGFORMAT + "'"))); + assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS5WOTZ_PGFORMAT + "'"))); + assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS6WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS1WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS2WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS3WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS4WOTZ_PGFORMAT + "'"))); + assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS5WOTZ_PGFORMAT + "'"))); + assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS6WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS1WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS2WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS3WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS4WOTZ_PGFORMAT + "'"))); + assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS5WOTZ_PGFORMAT + "'"))); + assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TS6WOTZ_PGFORMAT + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpDate1WOTZ.getTime()) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpDate2WOTZ.getTime()) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpDate3WOTZ.getTime()) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpDate4WOTZ.getTime()) + "'"))); + assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TimestampUtils.toString(new StringBuffer(), new GregorianCalendar(), new java.sql.Timestamp(tmpDate5WOTZ.getTime())) + "'"))); + assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TimestampUtils.toString(new StringBuffer(), new GregorianCalendar(), new java.sql.Timestamp(tmpDate6WOTZ.getTime())) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpTime1WOTZ.getTime()) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpTime2WOTZ.getTime()) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpTime3WOTZ.getTime()) + "'"))); assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + new java.sql.Timestamp(tmpTime4WOTZ.getTime()) + "'"))); + assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TimestampUtils.toString(new StringBuffer(), new GregorianCalendar(), new java.sql.Timestamp(tmpTime5WOTZ.getTime())) + "'"))); + assertEquals(1, stmt.executeUpdate(TestUtil.insertSQL(TSWOTZ_TABLE, "'" + TimestampUtils.toString(new StringBuffer(), new GregorianCalendar(), new java.sql.Timestamp(tmpTime6WOTZ.getTime())) + "'"))); // Fall through helper timestampTestWOTZ(); ! assertEquals(30, stmt.executeUpdate("DELETE FROM " + TSWOTZ_TABLE)); stmt.close(); } *************** *** 215,220 **** --- 284,294 ---- pstmt.setTimestamp(1, TS4WOTZ); assertEquals(1, pstmt.executeUpdate()); + pstmt.setTimestamp(1, TS5WOTZ); + assertEquals(1, pstmt.executeUpdate()); + + pstmt.setTimestamp(1, TS6WOTZ); + assertEquals(1, pstmt.executeUpdate()); // With java.sql.Timestamp pstmt.setObject(1, TS1WOTZ, java.sql.Types.TIMESTAMP); *************** *** 225,230 **** --- 299,308 ---- assertEquals(1, pstmt.executeUpdate()); pstmt.setObject(1, TS4WOTZ, java.sql.Types.TIMESTAMP); assertEquals(1, pstmt.executeUpdate()); + pstmt.setObject(1, TS5WOTZ, java.sql.Types.TIMESTAMP); + assertEquals(1, pstmt.executeUpdate()); + pstmt.setObject(1, TS6WOTZ, java.sql.Types.TIMESTAMP); + assertEquals(1, pstmt.executeUpdate()); // With Strings pstmt.setObject(1, TS1WOTZ_PGFORMAT, java.sql.Types.TIMESTAMP); *************** *** 235,240 **** --- 313,322 ---- assertEquals(1, pstmt.executeUpdate()); pstmt.setObject(1, TS4WOTZ_PGFORMAT, java.sql.Types.TIMESTAMP); assertEquals(1, pstmt.executeUpdate()); + pstmt.setObject(1, TS5WOTZ_PGFORMAT, java.sql.Types.TIMESTAMP); + assertEquals(1, pstmt.executeUpdate()); + pstmt.setObject(1, TS6WOTZ_PGFORMAT, java.sql.Types.TIMESTAMP); + assertEquals(1, pstmt.executeUpdate()); // With java.sql.Date pstmt.setObject(1, tmpDate1WOTZ, java.sql.Types.TIMESTAMP); *************** *** 245,250 **** --- 327,336 ---- assertEquals(1, pstmt.executeUpdate()); pstmt.setObject(1, tmpDate4WOTZ, java.sql.Types.TIMESTAMP); assertEquals(1, pstmt.executeUpdate()); + pstmt.setObject(1, tmpDate5WOTZ, java.sql.Types.TIMESTAMP); + assertEquals(1, pstmt.executeUpdate()); + pstmt.setObject(1, tmpDate6WOTZ, java.sql.Types.TIMESTAMP); + assertEquals(1, pstmt.executeUpdate()); // With java.sql.Time pstmt.setObject(1, tmpTime1WOTZ, java.sql.Types.TIMESTAMP); *************** *** 255,264 **** assertEquals(1, pstmt.executeUpdate()); pstmt.setObject(1, tmpTime4WOTZ, java.sql.Types.TIMESTAMP); assertEquals(1, pstmt.executeUpdate()); // Fall through helper timestampTestWOTZ(); ! assertEquals(20, stmt.executeUpdate("DELETE FROM " + TSWOTZ_TABLE)); pstmt.close(); stmt.close(); --- 341,354 ---- assertEquals(1, pstmt.executeUpdate()); pstmt.setObject(1, tmpTime4WOTZ, java.sql.Types.TIMESTAMP); assertEquals(1, pstmt.executeUpdate()); + pstmt.setObject(1, tmpTime5WOTZ, java.sql.Types.TIMESTAMP); + assertEquals(1, pstmt.executeUpdate()); + pstmt.setObject(1, tmpTime6WOTZ, java.sql.Types.TIMESTAMP); + assertEquals(1, pstmt.executeUpdate()); // Fall through helper timestampTestWOTZ(); ! assertEquals(30, stmt.executeUpdate("DELETE FROM " + TSWOTZ_TABLE)); pstmt.close(); stmt.close(); *************** *** 380,385 **** --- 470,485 ---- t = rs.getTimestamp(1); assertNotNull(t); assertTrue(t.equals(TS4WOTZ)); + + assertTrue(rs.next()); + t = rs.getTimestamp(1); + assertNotNull(t); + assertTrue(t.equals(TS5WOTZ)); + + assertTrue(rs.next()); + t = rs.getTimestamp(1); + assertNotNull(t); + assertTrue(t.equals(TS6WOTZ)); } // Testing for Date *************** *** 403,408 **** --- 503,518 ---- assertNotNull(t); assertEquals(tmpDate4WOTZ.getTime(), t.getTime()); + assertTrue(rs.next()); + t = rs.getTimestamp(1); + assertNotNull(t); + assertEquals(tmpDate5WOTZ.getTime(), t.getTime()); + + assertTrue(rs.next()); + t = rs.getTimestamp(1); + assertNotNull(t); + assertEquals(tmpDate6WOTZ.getTime(), t.getTime()); + // Testing for Time assertTrue(rs.next()); t = rs.getTimestamp(1); *************** *** 424,429 **** --- 534,549 ---- assertNotNull(t); assertEquals(tmpTime4WOTZ.getTime(), t.getTime()); + assertTrue(rs.next()); + t = rs.getTimestamp(1); + assertNotNull(t); + assertEquals(tmpTime5WOTZ.getTime(), t.getTime()); + + assertTrue(rs.next()); + t = rs.getTimestamp(1); + assertNotNull(t); + assertEquals(tmpTime6WOTZ.getTime(), t.getTime()); + assertTrue(! rs.next()); // end of table. Fail if more entries exist. rs.close(); *************** *** 463,469 **** } return l_return; } ! private static final java.sql.Timestamp TS1WTZ = getTimestamp(1950, 2, 7, 15, 0, 0, 100000000, "PST"); private static final String TS1WTZ_PGFORMAT = "1950-02-07 15:00:00.1-08"; --- 583,589 ---- } return l_return; } ! private static final java.sql.Timestamp TS1WTZ = getTimestamp(1950, 2, 7, 15, 0, 0, 100000000, "PST"); private static final String TS1WTZ_PGFORMAT = "1950-02-07 15:00:00.1-08"; *************** *** 489,494 **** --- 609,620 ---- private static final java.sql.Timestamp TS4WOTZ = getTimestamp(2000, 7, 7, 15, 0, 0, 123456000, null); private static final String TS4WOTZ_PGFORMAT = "2000-07-07 15:00:00.123456"; + private static final java.sql.Timestamp TS5WOTZ = new Timestamp(PGStatement.DATE_NEGATIVE_INFINITY); + private static final String TS5WOTZ_PGFORMAT = "-infinity"; + + private static final java.sql.Timestamp TS6WOTZ = new Timestamp(PGStatement.DATE_POSITIVE_INFINITY); + private static final String TS6WOTZ_PGFORMAT = "infinity"; + private static final String TSWTZ_TABLE = "testtimestampwtz"; private static final String TSWOTZ_TABLE = "testtimestampwotz"; *************** *** 509,514 **** --- 635,644 ---- private static final java.sql.Time tmpTime3WOTZ = new java.sql.Time(TS3WOTZ.getTime()); private static final java.sql.Date tmpDate4WOTZ = new java.sql.Date(TS4WOTZ.getTime()); private static final java.sql.Time tmpTime4WOTZ = new java.sql.Time(TS4WOTZ.getTime()); + private static final java.sql.Date tmpDate5WOTZ = new java.sql.Date(TS5WOTZ.getTime()); + private static final java.sql.Date tmpTime5WOTZ = new java.sql.Date(TS5WOTZ.getTime()); + private static final java.sql.Date tmpDate6WOTZ = new java.sql.Date(TS6WOTZ.getTime()); + private static final java.sql.Date tmpTime6WOTZ = new java.sql.Date(TS6WOTZ.getTime()); }