提交 6a37e13c authored 作者: Thomas Mueller's avatar Thomas Mueller

PostgreSQL compatibility: support for EXTRACT(WEEK FROM dateColumn). Thanks to…

PostgreSQL compatibility: support for EXTRACT(WEEK FROM dateColumn). Thanks to Prashant Bhat for the patch!
上级 27dd3927
...@@ -18,7 +18,8 @@ Change Log ...@@ -18,7 +18,8 @@ Change Log
<h1>Change Log</h1> <h1>Change Log</h1>
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>- <ul><li>PostgreSQL compatibility: support for EXTRACT(WEEK FROM dateColumn).
Thanks to Prashant Bhat for the patch!
</li></ul> </li></ul>
<h2>Version 1.3.169 (2012-09-09)</h2> <h2>Version 1.3.169 (2012-09-09)</h2>
......
...@@ -129,6 +129,7 @@ public class Function extends Expression implements FunctionCall { ...@@ -129,6 +129,7 @@ public class Function extends Expression implements FunctionCall {
DATE_PART.put("SQL_TSI_WEEK", Calendar.WEEK_OF_YEAR); DATE_PART.put("SQL_TSI_WEEK", Calendar.WEEK_OF_YEAR);
DATE_PART.put("WW", Calendar.WEEK_OF_YEAR); DATE_PART.put("WW", Calendar.WEEK_OF_YEAR);
DATE_PART.put("WK", Calendar.WEEK_OF_YEAR); DATE_PART.put("WK", Calendar.WEEK_OF_YEAR);
DATE_PART.put("WEEK", Calendar.WEEK_OF_YEAR);
DATE_PART.put("DAY", Calendar.DAY_OF_MONTH); DATE_PART.put("DAY", Calendar.DAY_OF_MONTH);
DATE_PART.put("DD", Calendar.DAY_OF_MONTH); DATE_PART.put("DD", Calendar.DAY_OF_MONTH);
DATE_PART.put("D", Calendar.DAY_OF_MONTH); DATE_PART.put("D", Calendar.DAY_OF_MONTH);
......
...@@ -361,6 +361,8 @@ select extract(hour from '2001-02-03 14:15:16'); ...@@ -361,6 +361,8 @@ select extract(hour from '2001-02-03 14:15:16');
> 14; > 14;
select hour('2001-02-03 14:15:16'); select hour('2001-02-03 14:15:16');
> 14; > 14;
select extract(week from timestamp '2001-02-03 14:15:16');
> 5;
CREATE TABLE TEST(A int NOT NULL, B int NOT NULL, C int) ; CREATE TABLE TEST(A int NOT NULL, B int NOT NULL, C int) ;
ALTER TABLE TEST ADD CONSTRAINT CON UNIQUE(A,B); ALTER TABLE TEST ADD CONSTRAINT CON UNIQUE(A,B);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论