Make the test case added in the previous commit current time agnostic
authorPavan Deolasee <[email protected]>
Fri, 4 Sep 2015 10:56:37 +0000 (16:26 +0530)
committerPavan Deolasee <[email protected]>
Fri, 4 Sep 2015 10:56:37 +0000 (16:26 +0530)
src/test/regress/expected/timestamp.out
src/test/regress/sql/timestamp.sql

index a4bb8daf2f5b28be5405f0d0d468364c92f4e5b4..3a2a671c2b5c2cf801edfb618ad7c78a9f106d5f 100644 (file)
@@ -1595,24 +1595,23 @@ SELECT make_timestamp(2014,12,28,6,30,45.887);
 
 -- test if now() gives a correct timestamp and does not marely reports the
 -- value saved from the previous transaction
-SELECT now();
-                 now                 
--------------------------------------
- Wed Aug 26 03:33:29.228878 2015 PDT
-(1 row)
-
+CREATE TABLE testnow(t timestamp);
+INSERT INTO testnow SELECT now();
 BEGIN;
-SELECT now();
-                 now                 
--------------------------------------
- Wed Aug 26 03:33:29.229567 2015 PDT
+INSERT INTO testnow SELECT now();
+SELECT COUNT(DISTINCT t) FROM testnow;
+ count 
+-------
+     2
 (1 row)
 
 CREATE TABLE test_now(a timestamp);
-SELECT now();
-                 now                 
--------------------------------------
- Wed Aug 26 03:33:29.229567 2015 PDT
+INSERT INTO testnow SELECT now();
+SELECT COUNT(DISTINCT t) FROM testnow;
+ count 
+-------
+     2
 (1 row)
 
 ROLLBACK;
+DROP TABLE testnow;
index 9e88d120abb38ea6c3d9b3bdc1d64a9685bd2aa4..d55aa13bdcc6fdc21844a8eb4f7bf68d3a133d1a 100644 (file)
@@ -229,9 +229,13 @@ SELECT make_timestamp(2014,12,28,6,30,45.887);
 -- test if now() gives a correct timestamp and does not marely reports the
 -- value saved from the previous transaction
 
-SELECT now();
+CREATE TABLE testnow(t timestamp);
+INSERT INTO testnow SELECT now();
 BEGIN;
-SELECT now();
+INSERT INTO testnow SELECT now();
+SELECT COUNT(DISTINCT t) FROM testnow;
 CREATE TABLE test_now(a timestamp);
-SELECT now();
+INSERT INTO testnow SELECT now();
+SELECT COUNT(DISTINCT t) FROM testnow;
 ROLLBACK;
+DROP TABLE testnow;