summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-09-22 23:48:20 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2010-09-22 23:48:20 -0400
commitfcb2326180ebad04106f745f646c4e02bc9ff10f (patch)
tree7b3c3fb35dabc0ab576fce8af560c3b022c6d548 /src/test
parent41b04faf7d5aacbf613fc5ab6cf85899b99ef9f8 (diff)
Re-allow input of Julian dates prior to 0001-01-01 AD.
This was unintentionally broken in 8.4 while tightening up checking of ordinary non-Julian date inputs to forbid references to "year zero". Per bug #5672 from Benjamin Gigot.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/horology.out13
-rw-r--r--src/test/regress/sql/horology.sql3
2 files changed, 16 insertions, 0 deletions
diff --git a/src/test/regress/expected/horology.out b/src/test/regress/expected/horology.out
index 26d7541b720..b13f7d7c5b5 100644
--- a/src/test/regress/expected/horology.out
+++ b/src/test/regress/expected/horology.out
@@ -264,6 +264,19 @@ SELECT time with time zone 'T040506.789 -08';
(1 row)
SET DateStyle = 'Postgres, MDY';
+-- Check Julian dates BC
+SELECT date 'J1520447' AS "Confucius' Birthday";
+ Confucius' Birthday
+---------------------
+ 09-28-0551 BC
+(1 row)
+
+SELECT date 'J0' AS "Julian Epoch";
+ Julian Epoch
+---------------
+ 11-24-4714 BC
+(1 row)
+
--
-- date, time arithmetic
--
diff --git a/src/test/regress/sql/horology.sql b/src/test/regress/sql/horology.sql
index 615755e3de0..97ff9f20c79 100644
--- a/src/test/regress/sql/horology.sql
+++ b/src/test/regress/sql/horology.sql
@@ -56,6 +56,9 @@ SELECT time with time zone 'T040506.789-08';
SELECT time with time zone 'T040506.789 +08';
SELECT time with time zone 'T040506.789 -08';
SET DateStyle = 'Postgres, MDY';
+-- Check Julian dates BC
+SELECT date 'J1520447' AS "Confucius' Birthday";
+SELECT date 'J0' AS "Julian Epoch";
--
-- date, time arithmetic