mirror of
https://github.com/postgres/postgres.git
synced 2025-05-01 01:04:50 +03:00
Remove gratuitous discrepancy between extract() and date_part(),
regarding timezone_hour, timezone_minute vs. tz_hour, tz_minute. Document the former.
This commit is contained in:
parent
ec5c62874d
commit
371f49bf9f
@ -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>
|
||||
|
@ -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"; }
|
||||
|
@ -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},
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user