Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d63571a

Browse files
author
Thomas G. Lockhart
committed
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.
1 parent 892d46e commit d63571a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/backend/parser/gram.y

+7-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.221 2001/02/18 18:06:10 petere Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.222 2001/05/01 01:36:10 thomas Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -4986,8 +4986,13 @@ extract_list: extract_arg FROM a_expr
49864986
{ $$ = NIL; }
49874987
;
49884988

4989+
/* Allow delimited string SCONST in extract_arg as an SQL extension.
4990+
* - thomas 2001-04-12
4991+
*/
4992+
49894993
extract_arg: datetime { $$ = $1; }
4990-
| IDENT { $$ = $1; }
4994+
| SCONST { $$ = $1; }
4995+
| IDENT { $$ = $1; }
49914996
| TIMEZONE_HOUR { $$ = "tz_hour"; }
49924997
| TIMEZONE_MINUTE { $$ = "tz_minute"; }
49934998
;

0 commit comments

Comments
 (0)