Commit d63571a7 authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Allow a string argument to the EXTRACT() function.

 This is an extension to the SQL9x standard, but is consistant with usage
 of the underlying date_part() function used to implement it.
 Example: EXTRACT('YEAR',...)
No impact on regression tests.
parent 892d46e7
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.221 2001/02/18 18:06:10 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.222 2001/05/01 01:36:10 thomas Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -4986,7 +4986,12 @@ extract_list: extract_arg FROM a_expr ...@@ -4986,7 +4986,12 @@ extract_list: extract_arg FROM a_expr
{ $$ = NIL; } { $$ = NIL; }
; ;
/* Allow delimited string SCONST in extract_arg as an SQL extension.
* - thomas 2001-04-12
*/
extract_arg: datetime { $$ = $1; } extract_arg: datetime { $$ = $1; }
| SCONST { $$ = $1; }
| IDENT { $$ = $1; } | IDENT { $$ = $1; }
| TIMEZONE_HOUR { $$ = "tz_hour"; } | TIMEZONE_HOUR { $$ = "tz_hour"; }
| TIMEZONE_MINUTE { $$ = "tz_minute"; } | TIMEZONE_MINUTE { $$ = "tz_minute"; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment