summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2009-03-22 01:12:32 +0000
committerTom Lane2009-03-22 01:12:32 +0000
commit0fd85d78792a5c88df684385124eb92e38a2f037 (patch)
treedf933ed0a71a9c70739ea89c2def72af970e5858
parent596efd27edce20bba706f50de99a0f15bcc2a567 (diff)
Remove the datetime keywords ABSTIME and RELTIME, which we'd been treating as
noise words for the last twelve years, for compatibility with Berkeley-era output formatting of the special INVALID values for those datatypes. Considering that the datatypes themselves have been deprecated for awhile, this is taking backwards compatibility a little far. Per gripe from Josh Berkus.
-rw-r--r--doc/src/sgml/datetime.sgml15
-rw-r--r--src/backend/utils/adt/datetime.c4
-rw-r--r--src/backend/utils/adt/nabstime.c8
-rw-r--r--src/interfaces/ecpg/pgtypeslib/dt_common.c4
-rw-r--r--src/test/regress/expected/timestamp.out12
-rw-r--r--src/test/regress/expected/timestamptz.out12
-rw-r--r--src/test/regress/sql/timestamp.sql3
-rw-r--r--src/test/regress/sql/timestamptz.sql3
8 files changed, 14 insertions, 47 deletions
diff --git a/doc/src/sgml/datetime.sgml b/doc/src/sgml/datetime.sgml
index df715144dbc..d0721188696 100644
--- a/doc/src/sgml/datetime.sgml
+++ b/doc/src/sgml/datetime.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.59 2008/02/16 21:51:04 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.60 2009/03/22 01:12:31 tgl Exp $ -->
<appendix id="datetime-appendix">
<title>Date/Time Support</title>
@@ -309,10 +309,6 @@
</thead>
<tbody>
<row>
- <entry><literal>ABSTIME</literal></entry>
- <entry>Ignored</entry>
- </row>
- <row>
<entry><literal>AM</literal></entry>
<entry>Time is before 12:00</entry>
</row>
@@ -339,15 +335,6 @@
</tbody>
</tgroup>
</table>
-
- <para>
- The key word <literal>ABSTIME</literal> is ignored for historical
- reasons: In very old releases of
- <productname>PostgreSQL</productname>, invalid values of type <type>abstime</type>
- were emitted as <literal>Invalid Abstime</literal>. This is no
- longer the case however and this key word will likely be dropped in
- a future release.
- </para>
</sect1>
<sect1 id="datetime-config-files">
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index b1f606fecca..034e030f72e 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.202 2009/03/17 18:39:39 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.203 2009/03/22 01:12:31 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -109,7 +109,6 @@ static int sztimezonetktbl = 0;
static const datetkn datetktbl[] = {
/* text, token, lexval */
{EARLY, RESERV, DTK_EARLY}, /* "-infinity" reserved for "early time" */
- {"abstime", IGNORE_DTF, 0}, /* for pre-v6.1 "Invalid Abstime" */
{DA_D, ADBC, AD}, /* "ad" for years > 0 */
{"allballs", RESERV, DTK_ZULU}, /* 00:00:00 */
{"am", AMPM, AM},
@@ -230,7 +229,6 @@ static datetkn deltatktbl[] = {
{"msecs", UNITS, DTK_MILLISEC},
{"qtr", UNITS, DTK_QUARTER}, /* "quarter" relative */
{DQUARTER, UNITS, DTK_QUARTER}, /* "quarter" relative */
- {"reltime", IGNORE_DTF, 0}, /* pre-v6.1 "Undefined Reltime" */
{"s", UNITS, DTK_SECOND},
{"sec", UNITS, DTK_SECOND},
{DSECOND, UNITS, DTK_SECOND},
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c
index 5c4ac788685..b25938a205d 100644
--- a/src/backend/utils/adt/nabstime.c
+++ b/src/backend/utils/adt/nabstime.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.159 2009/01/01 17:23:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.160 2009/03/22 01:12:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -30,12 +30,6 @@
#define MIN_DAYNUM (-24856) /* December 13, 1901 */
#define MAX_DAYNUM 24854 /* January 18, 2038 */
-#define INVALID_RELTIME_STR "Undefined RelTime"
-#define INVALID_RELTIME_STR_LEN (sizeof(INVALID_RELTIME_STR)-1)
-#define RELTIME_LABEL '@'
-#define RELTIME_PAST "ago"
-#define DIRMAXLEN (sizeof(RELTIME_PAST)-1)
-
/*
* Unix epoch is Jan 1 00:00:00 1970.
* Postgres knows about times sixty-eight years on either side of that
diff --git a/src/interfaces/ecpg/pgtypeslib/dt_common.c b/src/interfaces/ecpg/pgtypeslib/dt_common.c
index 6850c22a20b..a778960bc4d 100644
--- a/src/interfaces/ecpg/pgtypeslib/dt_common.c
+++ b/src/interfaces/ecpg/pgtypeslib/dt_common.c
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.47 2009/02/05 08:28:47 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.48 2009/03/22 01:12:32 tgl Exp $ */
#include "postgres_fe.h"
@@ -26,7 +26,6 @@ typedef long AbsoluteTime;
static datetkn datetktbl[] = {
/* text, token, lexval */
{EARLY, RESERV, DTK_EARLY}, /* "-infinity" reserved for "early time" */
- {"abstime", IGNORE_DTF, 0}, /* for pre-v6.1 "Invalid Abstime" */
{"acsst", DTZ, POS(42)}, /* Cent. Australia */
{"acst", DTZ, NEG(16)}, /* Atlantic/Porto Acre */
{"act", TZ, NEG(20)}, /* Atlantic/Porto Acre */
@@ -471,7 +470,6 @@ static datetkn deltatktbl[] = {
{"msecs", UNITS, DTK_MILLISEC},
{"qtr", UNITS, DTK_QUARTER}, /* "quarter" relative */
{DQUARTER, UNITS, DTK_QUARTER}, /* "quarter" relative */
- {"reltime", IGNORE_DTF, 0}, /* pre-v6.1 "Undefined Reltime" */
{"s", UNITS, DTK_SECOND},
{"sec", UNITS, DTK_SECOND},
{DSECOND, UNITS, DTK_SECOND},
diff --git a/src/test/regress/expected/timestamp.out b/src/test/regress/expected/timestamp.out
index 7646f1aee25..d99c1107240 100644
--- a/src/test/regress/expected/timestamp.out
+++ b/src/test/regress/expected/timestamp.out
@@ -84,20 +84,16 @@ INSERT INTO TIMESTAMP_TBL VALUES ('invalid');
ERROR: date/time value "invalid" is no longer supported
LINE 1: INSERT INTO TIMESTAMP_TBL VALUES ('invalid');
^
+INSERT INTO TIMESTAMP_TBL VALUES ('undefined');
+ERROR: date/time value "undefined" is no longer supported
+LINE 1: INSERT INTO TIMESTAMP_TBL VALUES ('undefined');
+ ^
INSERT INTO TIMESTAMP_TBL VALUES ('current');
ERROR: date/time value "current" is no longer supported
LINE 1: INSERT INTO TIMESTAMP_TBL VALUES ('current');
^
-- Postgres v6.0 standard output format
INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
-INSERT INTO TIMESTAMP_TBL VALUES ('Invalid Abstime');
-ERROR: date/time value "Invalid Abstime" is no longer supported
-LINE 1: INSERT INTO TIMESTAMP_TBL VALUES ('Invalid Abstime');
- ^
-INSERT INTO TIMESTAMP_TBL VALUES ('Undefined Abstime');
-ERROR: date/time value "Undefined Abstime" is no longer supported
-LINE 1: INSERT INTO TIMESTAMP_TBL VALUES ('Undefined Abstime');
- ^
-- Variations on Postgres v6.1 standard output format
INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
diff --git a/src/test/regress/expected/timestamptz.out b/src/test/regress/expected/timestamptz.out
index 7b12a2c2c83..f35bb14d352 100644
--- a/src/test/regress/expected/timestamptz.out
+++ b/src/test/regress/expected/timestamptz.out
@@ -83,20 +83,16 @@ INSERT INTO TIMESTAMPTZ_TBL VALUES ('invalid');
ERROR: date/time value "invalid" is no longer supported
LINE 1: INSERT INTO TIMESTAMPTZ_TBL VALUES ('invalid');
^
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('undefined');
+ERROR: date/time value "undefined" is no longer supported
+LINE 1: INSERT INTO TIMESTAMPTZ_TBL VALUES ('undefined');
+ ^
INSERT INTO TIMESTAMPTZ_TBL VALUES ('current');
ERROR: date/time value "current" is no longer supported
LINE 1: INSERT INTO TIMESTAMPTZ_TBL VALUES ('current');
^
-- Postgres v6.0 standard output format
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
-INSERT INTO TIMESTAMPTZ_TBL VALUES ('Invalid Abstime');
-ERROR: date/time value "Invalid Abstime" is no longer supported
-LINE 1: INSERT INTO TIMESTAMPTZ_TBL VALUES ('Invalid Abstime');
- ^
-INSERT INTO TIMESTAMPTZ_TBL VALUES ('Undefined Abstime');
-ERROR: date/time value "Undefined Abstime" is no longer supported
-LINE 1: INSERT INTO TIMESTAMPTZ_TBL VALUES ('Undefined Abstime');
- ^
-- Variations on Postgres v6.1 standard output format
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.999999 1997 PST');
diff --git a/src/test/regress/sql/timestamp.sql b/src/test/regress/sql/timestamp.sql
index 8f73e9f45bd..790ade31377 100644
--- a/src/test/regress/sql/timestamp.sql
+++ b/src/test/regress/sql/timestamp.sql
@@ -52,12 +52,11 @@ INSERT INTO TIMESTAMP_TBL VALUES ('infinity');
INSERT INTO TIMESTAMP_TBL VALUES ('epoch');
-- Obsolete special values
INSERT INTO TIMESTAMP_TBL VALUES ('invalid');
+INSERT INTO TIMESTAMP_TBL VALUES ('undefined');
INSERT INTO TIMESTAMP_TBL VALUES ('current');
-- Postgres v6.0 standard output format
INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
-INSERT INTO TIMESTAMP_TBL VALUES ('Invalid Abstime');
-INSERT INTO TIMESTAMP_TBL VALUES ('Undefined Abstime');
-- Variations on Postgres v6.1 standard output format
INSERT INTO TIMESTAMP_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');
diff --git a/src/test/regress/sql/timestamptz.sql b/src/test/regress/sql/timestamptz.sql
index 7da3f8fc92f..e74691cc04e 100644
--- a/src/test/regress/sql/timestamptz.sql
+++ b/src/test/regress/sql/timestamptz.sql
@@ -51,12 +51,11 @@ INSERT INTO TIMESTAMPTZ_TBL VALUES ('infinity');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('epoch');
-- Obsolete special values
INSERT INTO TIMESTAMPTZ_TBL VALUES ('invalid');
+INSERT INTO TIMESTAMPTZ_TBL VALUES ('undefined');
INSERT INTO TIMESTAMPTZ_TBL VALUES ('current');
-- Postgres v6.0 standard output format
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01 1997 PST');
-INSERT INTO TIMESTAMPTZ_TBL VALUES ('Invalid Abstime');
-INSERT INTO TIMESTAMPTZ_TBL VALUES ('Undefined Abstime');
-- Variations on Postgres v6.1 standard output format
INSERT INTO TIMESTAMPTZ_TBL VALUES ('Mon Feb 10 17:32:01.000001 1997 PST');