]> granicus.if.org Git - postgresql/commitdiff
Remove gratuitous discrepancy between extract() and date_part(),
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 10 Oct 2001 00:02:42 +0000 (00:02 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 10 Oct 2001 00:02:42 +0000 (00:02 +0000)
regarding timezone_hour, timezone_minute vs. tz_hour, tz_minute.
Document the former.

doc/src/sgml/func.sgml
src/backend/parser/gram.y
src/backend/parser/keywords.c
src/backend/utils/adt/datetime.c

index bbfb4fd3f09ee92bd9808ef505235101c3240ef4..334a8a9ee593840993492562d18260a6a969c9aa 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.76 2001/10/09 18:46:00 petere Exp $ -->
+<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.77 2001/10/10 00:02:42 petere Exp $ -->
 
 <chapter id="functions">
  <title>Functions and Operators</title>
@@ -2800,6 +2800,34 @@ SELECT EXTRACT(SECOND FROM TIME '17:12:28.5');
        </informalexample>
       </listitem>
      </varlistentry>
+<!--
+     <varlistentry>
+      <term><literal>timezone</literal></term>
+      <listitem>
+       <para>
+        The time zone offset. XXX But in what units?
+       </para>
+      </listitem>
+     </varlistentry>
+-->
+
+     <varlistentry>
+      <term><literal>timezone_hour</literal></term>
+      <listitem>
+       <para>
+        The hour component of the time zone offset.
+       </para>
+      </listitem>
+     </varlistentry>
+
+     <varlistentry>
+      <term><literal>timezone_minute</literal></term>
+      <listitem>
+       <para>
+        The minute component of the time zone offset.
+       </para>
+      </listitem>
+     </varlistentry>
 
      <varlistentry>
       <term><literal>week</literal></term>
@@ -2838,12 +2866,6 @@ SELECT EXTRACT(YEAR FROM TIMESTAMP '2001-02-16 20:38:40');
       </listitem>
      </varlistentry>
 
-<!--
-tz
-tz_hour
-tz_minute
--->
-
     </variablelist>
 
    </para>
index 4597a5e4af05633b4f10beda5be7929beb3a60a1..0be936069f6e6785f284e8b399d7945e82e1ddd7 100644 (file)
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.261 2001/10/09 22:32:32 petere Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.262 2001/10/10 00:02:42 petere Exp $
  *
  * HISTORY
  *       AUTHOR                        DATE                    MAJOR EVENT
@@ -315,8 +315,8 @@ static void doNegateFloat(Value *v);
                PARTIAL, POSITION, PRECISION, PRIMARY, PRIOR, PRIVILEGES, PROCEDURE, PUBLIC,
                READ, REFERENCES, RELATIVE, REVOKE, RIGHT, ROLLBACK,
                SCHEMA, SCROLL, SECOND_P, SELECT, SESSION, SESSION_USER, SET, SOME, SUBSTRING,
-               TABLE, TEMPORARY, THEN, TIME, TIMESTAMP, TIMEZONE_HOUR,
-               TIMEZONE_MINUTE, TO, TRAILING, TRANSACTION, TRIM, TRUE_P,
+               TABLE, TEMPORARY, THEN, TIME, TIMESTAMP,
+               TO, TRAILING, TRANSACTION, TRIM, TRUE_P,
                UNENCRYPTED, UNION, UNIQUE, UNKNOWN, UPDATE, USER, USING,
                VALUES, VARCHAR, VARYING, VIEW,
                WHEN, WHERE, WITH, WORK, YEAR_P, ZONE
@@ -5200,8 +5200,6 @@ extract_list:  extract_arg FROM a_expr
 extract_arg:  datetime                                         { $$ = $1; }
                | SCONST                                                        { $$ = $1; }
                | IDENT                                                         { $$ = $1; }
-               | TIMEZONE_HOUR                                         { $$ = "tz_hour"; }
-               | TIMEZONE_MINUTE                                       { $$ = "tz_minute"; }
                ;
 
 /* position_list uses b_expr not a_expr to avoid conflict with general IN */
@@ -5738,8 +5736,6 @@ TokenId:  ABSOLUTE                                                { $$ = "absolute"; }
                | TEMP                                                  { $$ = "temp"; }
                | TEMPLATE                                              { $$ = "template"; }
                | TEMPORARY                                             { $$ = "temporary"; }
-               | TIMEZONE_HOUR                                 { $$ = "timezone_hour"; }
-               | TIMEZONE_MINUTE                               { $$ = "timezone_minute"; }
                | TOAST                                                 { $$ = "toast"; }
                | TRIGGER                                               { $$ = "trigger"; }
                | TRUNCATE                                              { $$ = "truncate"; }
index 3beac5a6f4f16be8dc54309abd0c2e48f76c6fcf..fad08c849f1623bea915bdb93b65314a5ab7d119 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.98 2001/10/02 21:39:35 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.99 2001/10/10 00:02:42 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -252,8 +252,6 @@ static ScanKeyword ScanKeywords[] = {
        {"then", THEN},
        {"time", TIME},
        {"timestamp", TIMESTAMP},
-       {"timezone_hour", TIMEZONE_HOUR},
-       {"timezone_minute", TIMEZONE_MINUTE},
        {"to", TO},
        {"toast", TOAST},
        {"trailing", TRAILING},
index b5d32494f76b89cc1ac499e9e96785de30a93bc1..81d57faf74d7ed877a6c576b6e25b4470e15496a 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.70 2001/10/05 06:38:59 thomas Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.71 2001/10/10 00:02:42 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -293,9 +293,9 @@ static datetkn deltatktbl[] = {
        {"seconds", UNITS, DTK_SECOND},
        {"secs", UNITS, DTK_SECOND},
        {DTIMEZONE, UNITS, DTK_TZ}, /* "timezone" time offset */
-       {"tz", UNITS, DTK_TZ},          /* "timezone" time offset */
-       {"tz_hour", UNITS, DTK_TZ_HOUR},        /* timezone hour units */
-       {"tz_minute", UNITS, DTK_TZ_MINUTE},            /* timezone minutes units */
+       {"timezone", UNITS, DTK_TZ},            /* "timezone" time offset */
+       {"timezone_hour", UNITS, DTK_TZ_HOUR},  /* timezone hour units */
+       {"timezone_minute", UNITS, DTK_TZ_MINUTE},              /* timezone minutes units */
        {"undefined", RESERV, DTK_INVALID}, /* pre-v6.1 invalid time */
        {"us", UNITS, DTK_MICROSEC},/* "microsecond" relative time units */
        {"usec", UNITS, DTK_MICROSEC},          /* "microsecond" relative time