Make regress tests safe for variable-resolution timestamps.
authorTom Lane
Thu, 4 Oct 2001 14:51:06 +0000 (14:51 +0000)
committerTom Lane
Thu, 4 Oct 2001 14:51:06 +0000 (14:51 +0000)
src/test/regress/expected/timestamp.out
src/test/regress/expected/timestamptz.out
src/test/regress/sql/timestamp.sql
src/test/regress/sql/timestamptz.sql

index c9e768461a20694abae195068f47ae1226cc4f70..9405e8ba1cb835a0e484e2196fe0d0d3b566e780 100644 (file)
@@ -7,6 +7,8 @@ CREATE TABLE TIMESTAMP_TBL ( d1 timestamp(2) without time zone);
 -- Shorthand values
 -- Not directly usable for regression testing since these are not constants.
 -- So, just try to test parser and hope for the best - thomas 97/04/26
+-- NB: could get a failure if local midnight passes during the next few
+-- statements.
 INSERT INTO TIMESTAMP_TBL VALUES ('now');
 INSERT INTO TIMESTAMP_TBL VALUES ('current');
 INSERT INTO TIMESTAMP_TBL VALUES ('today');
@@ -43,7 +45,7 @@ DELETE FROM TIMESTAMP_TBL;
 BEGIN;
 INSERT INTO TIMESTAMP_TBL VALUES ('now');
 INSERT INTO TIMESTAMP_TBL VALUES ('now');
-SELECT count(*) AS two FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'now';
+SELECT count(*) AS two FROM TIMESTAMP_TBL WHERE d1 = timestamp(2) without time zone 'now';
  two 
 -----
    2
index 142eb2508ccf45ce2365606511a866ef101cd3f2..ed11d1629d95ad539a93a7f6c4c5524be5f6853d 100644 (file)
@@ -40,7 +40,7 @@ DELETE FROM TIMESTAMPTZ_TBL;
 BEGIN;
 INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
 INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
-SELECT count(*) AS two FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'now';
+SELECT count(*) AS two FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp(2) with time zone 'now';
  two 
 -----
    2
index df1adf95225fb78755710d5cd31f6ad578303ec3..b08e81e80e472e141cc71538f4f4a0a48dda1234 100644 (file)
@@ -9,6 +9,8 @@ CREATE TABLE TIMESTAMP_TBL ( d1 timestamp(2) without time zone);
 -- Shorthand values
 -- Not directly usable for regression testing since these are not constants.
 -- So, just try to test parser and hope for the best - thomas 97/04/26
+-- NB: could get a failure if local midnight passes during the next few
+-- statements.
 
 INSERT INTO TIMESTAMP_TBL VALUES ('now');
 INSERT INTO TIMESTAMP_TBL VALUES ('current');
@@ -29,7 +31,7 @@ DELETE FROM TIMESTAMP_TBL;
 BEGIN;
 INSERT INTO TIMESTAMP_TBL VALUES ('now');
 INSERT INTO TIMESTAMP_TBL VALUES ('now');
-SELECT count(*) AS two FROM TIMESTAMP_TBL WHERE d1 = timestamp without time zone 'now';
+SELECT count(*) AS two FROM TIMESTAMP_TBL WHERE d1 = timestamp(2) without time zone 'now';
 END;
 DELETE FROM TIMESTAMP_TBL;
 
index 13ffb379a2d0a137be2878134b1c0abd8ab71e95..e60bacb96246715b712f2eb9bd9c6f2ade4b84f3 100644 (file)
@@ -25,7 +25,7 @@ DELETE FROM TIMESTAMPTZ_TBL;
 BEGIN;
 INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
 INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
-SELECT count(*) AS two FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp with time zone 'now';
+SELECT count(*) AS two FROM TIMESTAMPTZ_TBL WHERE d1 = timestamp(2) with time zone 'now';
 END;
 DELETE FROM TIMESTAMPTZ_TBL;