Back-patch fix for alphabetization mistakes in datetime token tables.
authorTom Lane <[email protected]>
Sun, 26 Jan 2003 22:33:16 +0000 (22:33 +0000)
committerTom Lane <[email protected]>
Sun, 26 Jan 2003 22:33:16 +0000 (22:33 +0000)
src/backend/utils/adt/datetime.c
src/test/regress/expected/timestamp.out
src/test/regress/expected/timestamptz.out

index 50c9ba8923c32fe5f76e02df11fc58e9739b9759..61a8b04fb179c7f132b0a76ae6de5f0d9de1a9fe 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.87.2.2 2002/09/30 20:57:11 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.87.2.3 2003/01/26 22:33:16 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -79,11 +79,11 @@ char           *days[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
 static datetkn datetktbl[] = {
 /*     text, token, lexval */
        {EARLY, RESERV, DTK_EARLY}, /* "-infinity" reserved for "early time" */
+       {"abstime", IGNORE, 0},         /* for pre-v6.1 "Invalid Abstime" */
        {"acsst", DTZ, 63},                     /* Cent. Australia */
        {"acst", DTZ, NEG(24)},         /* Atlantic/Porto Acre */
        {"act", TZ, NEG(30)},           /* Atlantic/Porto Acre */
        {DA_D, ADBC, AD},                       /* "ad" for years >= 0 */
-       {"abstime", IGNORE, 0},         /* for pre-v6.1 "Invalid Abstime" */
        {"adt", DTZ, NEG(18)},          /* Atlantic Daylight Time */
        {"aesst", DTZ, 66},                     /* E. Australia */
        {"aest", TZ, 60},                       /* Australia Eastern Std Time */
@@ -92,8 +92,8 @@ static datetkn datetktbl[] = {
        {"akdt", DTZ, NEG(48)},         /* Alaska Daylight Time */
        {"akst", DTZ, NEG(54)},         /* Alaska Standard Time */
        {"allballs", RESERV, DTK_ZULU},         /* 00:00:00 */
-       {"almt", TZ, 36},                       /* Almaty Time */
        {"almst", TZ, 42},                      /* Almaty Savings Time */
+       {"almt", TZ, 36},                       /* Almaty Time */
        {"am", AMPM, AM},
        {"amst", DTZ, 30},                      /* Armenia Summer Time (Yerevan) */
        {"amt", TZ, 24},                        /* Armenia Time (Yerevan) */
@@ -102,6 +102,8 @@ static datetkn datetktbl[] = {
 #endif
        {"anast", DTZ, 78},                     /* Anadyr Summer Time (Russia) */
        {"anat", TZ, 72},                       /* Anadyr Time (Russia) */
+       {"apr", MONTH, 4},
+       {"april", MONTH, 4},
 #if 0
 aqtst
 aqtt
@@ -112,8 +114,6 @@ arst
 ashst
 ast /* Atlantic Standard Time, Arabia Standard Time, Acre Standard Time */
 #endif
-       {"apr", MONTH, 4},
-       {"april", MONTH, 4},
        {"ast", TZ, NEG(24)},           /* Atlantic Std Time (Canada) */
        {"at", IGNORE, 0},                      /* "at" (throwaway) */
        {"aug", MONTH, 8},
@@ -171,12 +171,12 @@ cost
 #endif
        {"cot", TZ, NEG(30)},           /* Columbia Time */
        {"cst", TZ, NEG(36)},           /* Central Standard Time */
+       {DCURRENT, RESERV, DTK_CURRENT},        /* "current" is always now */
 #if 0
 cvst
 #endif
        {"cvt", TZ, 42},                        /* Christmas Island Time (Indian Ocean) */
        {"cxt", TZ, 42},                        /* Christmas Island Time (Indian Ocean) */
-       {DCURRENT, RESERV, DTK_CURRENT},        /* "current" is always now */
        {"d", UNITS, DTK_DAY},          /* "day of month" for ISO input */
        {"davt", TZ, 42},                       /* Davis Time (Antarctica) */
        {"ddut", TZ, 60},                       /* Dumont-d'Urville Time (Antarctica) */
@@ -402,8 +402,8 @@ sgt
 syot
 #endif
        {"t", ISOTIME, DTK_TIME},       /* Filler for ISO time fields */
-       {"that", TZ, NEG(60)},          /* Tahiti Time */
        {"tft", TZ, 30},                        /* Kerguelen Time */
+       {"that", TZ, NEG(60)},          /* Tahiti Time */
        {"thu", DOW, 4},
        {"thur", DOW, 4},
        {"thurs", DOW, 4},
@@ -504,9 +504,9 @@ static datetkn deltatktbl[] = {
        {DDAY, UNITS, DTK_DAY},         /* "day" relative */
        {"days", UNITS, DTK_DAY},       /* "days" relative */
        {"dec", UNITS, DTK_DECADE}, /* "decade" relative */
-       {"decs", UNITS, DTK_DECADE},    /* "decades" relative */
        {DDECADE, UNITS, DTK_DECADE},           /* "decade" relative */
        {"decades", UNITS, DTK_DECADE},         /* "decades" relative */
+       {"decs", UNITS, DTK_DECADE},    /* "decades" relative */
        {"h", UNITS, DTK_HOUR},         /* "hour" relative */
        {DHOUR, UNITS, DTK_HOUR},       /* "hour" relative */
        {"hours", UNITS, DTK_HOUR}, /* "hours" relative */
@@ -522,7 +522,6 @@ static datetkn deltatktbl[] = {
        {"mils", UNITS, DTK_MILLENNIUM},        /* "millennia" relative */
        {"min", UNITS, DTK_MINUTE}, /* "minute" relative */
        {"mins", UNITS, DTK_MINUTE},    /* "minutes" relative */
-       {"mins", UNITS, DTK_MINUTE},    /* "minutes" relative */
        {DMINUTE, UNITS, DTK_MINUTE},           /* "minute" relative */
        {"minutes", UNITS, DTK_MINUTE},         /* "minutes" relative */
        {"mon", UNITS, DTK_MONTH},      /* "months" relative */
@@ -543,7 +542,6 @@ static datetkn deltatktbl[] = {
        {"seconds", UNITS, DTK_SECOND},
        {"secs", UNITS, DTK_SECOND},
        {DTIMEZONE, UNITS, DTK_TZ}, /* "timezone" time offset */
-       {"timezone", UNITS, DTK_TZ},    /* "timezone" time offset */
        {"timezone_h", UNITS, DTK_TZ_HOUR}, /* timezone hour units */
        {"timezone_m", UNITS, DTK_TZ_MINUTE},           /* timezone minutes units */
        {"undefined", RESERV, DTK_INVALID}, /* pre-v6.1 invalid time */
index ad2f1d7ec9766ab49d5d33d16371925fedc394f2..58c5927bf3fb983e714613b2327730eaaf5f62ec 100644 (file)
@@ -11,7 +11,7 @@ CREATE TABLE TIMESTAMP_TBL ( d1 timestamp(2) without time zone);
 -- statements.
 INSERT INTO TIMESTAMP_TBL VALUES ('now');
 INSERT INTO TIMESTAMP_TBL VALUES ('current');
-ERROR:  Bad timestamp external representation 'current'
+ERROR:  'CURRENT' is no longer supported
 INSERT INTO TIMESTAMP_TBL VALUES ('today');
 INSERT INTO TIMESTAMP_TBL VALUES ('yesterday');
 INSERT INTO TIMESTAMP_TBL VALUES ('tomorrow');
@@ -64,9 +64,9 @@ ERROR:  TIMESTAMP 'invalid' no longer supported
 -- 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:  Bad timestamp external representation 'Invalid Abstime'
+ERROR:  TIMESTAMP 'Invalid Abstime' no longer supported
 INSERT INTO TIMESTAMP_TBL VALUES ('Undefined Abstime');
-ERROR:  Bad timestamp external representation 'Undefined Abstime'
+ERROR:  TIMESTAMP 'Undefined Abstime' no longer supported
 -- 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');
index 1741add0ac0d45a304b12c246b5f3cdf0ce0f61d..45ff280628818b2b431a4a85764c9b3dc252f6fd 100644 (file)
@@ -6,7 +6,7 @@ SET australian_timezones = 'off';
 CREATE TABLE TIMESTAMPTZ_TBL ( d1 timestamp(2) with time zone);
 INSERT INTO TIMESTAMPTZ_TBL VALUES ('now');
 INSERT INTO TIMESTAMPTZ_TBL VALUES ('current');
-ERROR:  Bad timestamp external representation 'current'
+ERROR:  'CURRENT' is no longer supported
 INSERT INTO TIMESTAMPTZ_TBL VALUES ('today');
 INSERT INTO TIMESTAMPTZ_TBL VALUES ('yesterday');
 INSERT INTO TIMESTAMPTZ_TBL VALUES ('tomorrow');
@@ -59,9 +59,9 @@ ERROR:  TIMESTAMP WITH TIME ZONE 'invalid' no longer supported
 -- 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:  Bad timestamp external representation 'Invalid Abstime'
+ERROR:  TIMESTAMP WITH TIME ZONE 'Invalid Abstime' no longer supported
 INSERT INTO TIMESTAMPTZ_TBL VALUES ('Undefined Abstime');
-ERROR:  Bad timestamp external representation 'Undefined Abstime'
+ERROR:  TIMESTAMP WITH TIME ZONE 'Undefined Abstime' no longer supported
 -- 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');