aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-10-04 14:51:06 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-10-04 14:51:06 +0000
commit04d975f0ca84438eb3095481b5153a7461c469bf (patch)
tree95d285495a72282413cd83b0b09fdae2cc1cea35 /src
parent64dff0beac3c76dd7035bfaa2e4357aa4798cc96 (diff)
downloadpostgresql-04d975f0ca84438eb3095481b5153a7461c469bf.tar.gz
postgresql-04d975f0ca84438eb3095481b5153a7461c469bf.zip
Make regress tests safe for variable-resolution timestamps.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/timestamp.out4
-rw-r--r--src/test/regress/expected/timestamptz.out2
-rw-r--r--src/test/regress/sql/timestamp.sql4
-rw-r--r--src/test/regress/sql/timestamptz.sql2
4 files changed, 8 insertions, 4 deletions
diff --git a/src/test/regress/expected/timestamp.out b/src/test/regress/expected/timestamp.out
index c9e768461a2..9405e8ba1cb 100644
--- a/src/test/regress/expected/timestamp.out
+++ b/src/test/regress/expected/timestamp.out
@@ -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
diff --git a/src/test/regress/expected/timestamptz.out b/src/test/regress/expected/timestamptz.out
index 142eb2508cc..ed11d1629d9 100644
--- a/src/test/regress/expected/timestamptz.out
+++ b/src/test/regress/expected/timestamptz.out
@@ -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
diff --git a/src/test/regress/sql/timestamp.sql b/src/test/regress/sql/timestamp.sql
index df1adf95225..b08e81e80e4 100644
--- a/src/test/regress/sql/timestamp.sql
+++ b/src/test/regress/sql/timestamp.sql
@@ -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;
diff --git a/src/test/regress/sql/timestamptz.sql b/src/test/regress/sql/timestamptz.sql
index 13ffb379a2d..e60bacb9624 100644
--- a/src/test/regress/sql/timestamptz.sql
+++ b/src/test/regress/sql/timestamptz.sql
@@ -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;